In a distributed database system, each database must have a unique name… a global database name. Global database names uniquely identify a database in the system.
To query a database’s global name issue this instruction:
SQL> SELECT * FROM global_name;
A global database name is formed by two components: a database name and a domain, as I said before, uniquely identifies it from any other database. An example global name might be mydb.beyondoracle.com. There are 2 parameters that define the global database name. The DB_NAME (no more than 8 chars) and the DB_DOMAIN (Must follow Internet conventions).
To change our database global name, do this:
SQL> ALTER DATABASE RENAME GLOBAL_NAME TO db1.beyondoracle.com
When we change / set the database to use global names (GLOBAL_NAMES parameter set to TRUE), all database links must be valid global names. When you create a database link with global names set to true, the database link will be formed by the database name plus the domain. In this environment Oracle enforces the requirement that the database.domain portion of the database link name must match the complete global name of the remote database. For instance, if your remote database is called db1.beyondoracle.com then the database link you create to access this remote database, must have the same name… db1.beyondoracle.com!
When using or enabling global names, when we didn’t create the database link with the previous rules I talked about (db_name.db_domain), it’s common getting this error: ORA-02085: database link string connects to string.
When you create a database link we must mention the connect_string that you want to connect to. This connect_string is the tnsnames entry that you have on your database server tnsnames.ora file. For instance when you create this db link:
SQL> CREATE DATABASE LINK db1.beyondoracle.com CONNECT TO myuser IDENTIFIED BY mypass USING ‘remotedb’;
Database Link Created
Then you must ensure that your database tnsnames.ora has the entry remotedb such as:
To finish, remember that almost every oracle distributed environment using replication uses global names. There’s only some custom replication processes that don’t need it, but Oracle Replication technology, like Streams for instance, needs global names database compliance.
My prayers and thoughts go to Carl Backstrom and his family. Wherever you are, rest in peace!