The parameter GLOBAL_NAMES specifies whether a database link is required to have the same name as the global database name to which it connects.
Simply If you set GLOBAL_NAMES to True ; Whenever you create a database link the name of the db link must equal to global database name.
If you set GLOBAL_NAMES to False ; Oracle does not make this check.
Oracle recommends the use of this parameter to ensure the use of consistent naming conventions.
But for security there is more than namig convention;
If you set global_names=FALSE ; someone can change the definition of the link and you can connect to wrong database. Simply this parameter assures that you connected the right database.
In order to see the value of this parameter
SQL> show parameter global_Names
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
global_names boolean FALSE
If you create a database link with the name a1 to connect OIDSRC database.
SQL> create database link a1 connect to a1 identified by a1 using 'OIDSRC';
Database link created.
Check the connection
SQL> select * from dual@a1;
D
-
X
And then set Global_Names to TRUE
SQL> alter system set global_Names =TRUE;
System altered.
Check the database Link Now
SQL> select * from dual@a1;
select * from dual@a1
*
ERROR at line 1:
ORA-02085: database link A1 connects to OIDSRC
Now you can get ORA-02085 because Oracle checks the name of the database link link with database name to assure that you are trying to connect the right database.
Now correct the database link definition and it works.
SQL> create database link OIDSRC connect to a1 identified by a1 using 'OIDSRC';
Database link created.
SQL> select * from dual@OIDSRC;
D
-
X
No comments:
Post a Comment