Parameter GLOBAL_NAMES

GLOBAL_NAMES initialization parameter controls how database links can be named. It takes either of two values TRUE or FALSE. Default value is FALSE. If set to TRUE, database links cannot be named anything other than the name of the database that the link connects to. For example, if the database link connects to database CHOCOLATE, then the below database link can be created :

CREATE DATABASE LINK abc CONNECT TO thomas identified by thomas123 USING 'to_chocolate';
Database link created.

But, using database link will not be permitted and is thrown below error :

SQL> select count (*) from table1@abc;
select count (*) from table1@abc
                      *
ERROR at line 1:
ORA-02085: database link abc connects to CHOCOLATE

Database does not check what name a database link is created with if the GLOBAL_NAMES is set to FALSE.

How to set GLOBAL_NAMES

Setting the values at the instance level is as below :

ALTER SYSTEM set GLOBAL_NAMES = false SCOPE = both;

This is a dynamic parameter and does not required bouncing the database

Workaround

Setting GLOBAL_NAMES to FALSE at session level permits the use of DB link "abc";

ALTER SESSION SET global_names = false;

The value of this parameter is FALSE only to the current user and only for this current session. This does not affect the value of GLOBAL_NAMES at instance level.

select count (*) from table1@abc;
COUNT(*)
--------
200

1 rows selected.
Comments