Determining Whether Global Naming Is Enforced
remote database
SQL> select global_name from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SALE.US.ORACLE.COM
Local database
SQL> show parameter global_names;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
global_names boolean FALSE
SQL> create public database link hq_sales CONNECT TO test IDENTIFIED BY test USING 'sales'
SQL> SELECT count(*) from test@hq_sales;
COUNT(*)
----------
28026
SQL> alter system set global_names=true ;
System altered.
SQL> create public database link hq_sales_true CONNECT TO test IDENTIFIED BY test USING 'sales';
Database link created.
SQL> select count(*) from test@hq_sales_true;
select count(*) from test@hq_sales_true
*
ERROR at line 1:
ORA-02085: database link HQ_SALES_TRUE.US.ORACLE.COM connects to
SALE.US.ORACLE.COM
结论:测试证明,当local database 的Global_names=true时, Database link name必须与Remote database global_name的名称一致
但与P895<
Determining Whether Global Naming Is Enforced
The name that you give to a link on the local database depends on whether the remote database that you want to access enforces global naming. If the remote database enforces global naming, then you must use the remote database’s global database name as the name of the link. For example, if you are connected to the local hq server and want to create a link to the remote mfg database, and mfg enforces global naming, then you must use mfg’s global database name as the link name.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10248702/viewspace-624035/ ,如需转载,请注明出处,否则将追究法律责任。