Sometimes, DBLink is one of the most convenient and convenient ways to manually synchronize data between two Oracle databases. The DBLink creation method is generally as follows:
SQL code
Create public database link <DBLink Name> connect to <username of the connected database> identified by <password of the connected database> using '<The service name of the connected database established by the Oracle client Tool> ';
Create public database link <DBLink Name> connect to <username of the connected database> identified by <password of the connected database> using '<The service name of the connected database established by the Oracle client Tool> ';
For example:
SQL code
Create public database link XMDS_KF connect to XMDS identified by XMDS using 'xmds _ KF ';
Create public database link XMDS_KF connect to XMDS identified by XMDS using 'xmds _ KF ';
However, this method has the disadvantage that a service name of the connected database must be created on the server. If it is not created, an error is returned:
ORA-12154: TNS: unable to process service name
But if you directly use the address to create the DBLink, you can save the trouble of configuring the service name:
SQL code
Create public database link XMDS_KF connect to XMDS identified by XNDS using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 145.24.16.182) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = XMDS)
)
)';