Oracle-DBLINK Analysis of ORACLE build DB-LINK Test Conditions www.2cto.com two servers remote: IP: 192.168.0.18, SID: usertest, Username: usertest, password: 123456 local: IP: 192.168.8.90, SID: wjn, username: userwjn, password: mosquito0 parameter setting 1. view the database global_name and execute select * from global_name; remote database 18 return: USERTEST. US. ORACLE. COM returned from the local database 90: DB_WJN.REGRESS.RDBMS.DEV.US.ORACLE.COM
2. view the global_name parameter SQL> show parameterglobal_name; NAME TYPE VALUE when ------------------------------ global_names boolean if this parameter is TRUE, the NAME of the local connection DBLINK must be consistent with the remote global_name. 3. check whether Advanced replication is supported. view the v $ option view. If Advanced replication is set to true, select * from v $ option t wheret is not supported. PARAMETER like 'advanced replication % '; method of establishing www.2cto.com 1. the first way to create dblink is to create tnsnames in the local database. ora File The database to be remotely accessed is configured. Create database link USERTEST_18connect to USERTEST identified by xxxx using 'usertest _ 192.168.0.18 ';
USERTEST_18 indicates the dblink name you created, usertest indicates the Instance name of the remote database, and USERTEST/xxxx indicates the user/password that logs on to the remote database. Then access the dual table in remote database 18 through dblink in the local database. The SQL statement is as follows: select * from dual @ USERTEST_18; 2. the second method for creating dblink is to create tnsnames in the local database. the ora file does not contain the remote database create public database link USERTEST_18connect to USERTESTidentified by 123456 using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.18) (PORT = 1521) (CONNECT_DATA = (SID = usertest) (SERVER = DEDICATED) www.2cto.com )';
The second is to put the first information configured in the tnsnames. ora file directly after the dblink statement is created. The first case is tnsnames. the information in the ora file is as follows: USERTEST_192.168.0.18 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.18) (PORT = 1521 ))) (CONNECT_DATA = (SID = usertest) (SERVER = DEDICATED) by belief1117