In ORACLE, remote data access, such as query and update, can be achieved through DatabaseLink. The database connection needs to be run on both databases that have created DatabaseLink.
In ORACLE, remote data access, such as query and update, can be achieved through Database Link. The Database connection must be run on the two sub-hosts that have created the Database Link.
In Oracle, remote data access, such as query and update, can be achieved through Database Link. The Database connection needs to be established on the two machines on which the Database Link is established.Run Oracle Net (formerly SQL * NET and NET 8 ).
Syntax:
1 Create a Database Link:
There are two database servers A/B, where IP address A is 172.20.36.245, and server B is the local machine. The database instance name on server B is ORCL, And the instance configuration on server A is available in the Service Listening configuration on the local machine:
BIWG_TEST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.20.36.245) (PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = biwg )))
The account for BIWG_TEST is WGODS and the password is WGODS.Create DB Links on the local machine
Method 1:
Create public database link wgods. ORACLE. comconnect to wgods identified by wgods using'BIWG'
CREATE [PUBLIC] database link database connection name connect to user name identified by password USING 'instance name of locally configured Data ';
[Public] means that public is a global db link, that is, all users in the database can query, sys or system users are required to create the database (of course, users with sysdba permissions can also). If public is not used, the database link is private. Only users who create the database link can query the database link.
Check whether the connection is successful
SELECT * FROM DUAL@WGODS.ORACLE.COMSELECT * FROM REF.TR_WGG_GDAREA_INFO@WGODS.ORACLE.COM
Method 2: do not configure the service.
Create public database link REMOTE_DEVE_HOSTCONNECT to wgods identified by wgodsusing'(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.20.36.245) (PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = biwg )))'
This implementation is not recommended. I don't feel the convenience of the above method.
Check whether the connection is successful
SELECT * FROM DUAL@WGODS.ORACLE.COMSELECT * FROM REF.TR_WGG_GDAREA_INFO@WGODS.ORACLE.COM