First, use PL SQL to establish A connection to the target database B in source database A. The statement is as follows:
Drop database link orclAB; create shared database link orclAB connect to TargetUserName identified by "TargetUser password" authenticated by TargetUserName identified by "TargetUser password" using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 172. *. *. *) (PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = TargetServiceName )))';
After the above connection is established, the table in the target database B can be directly used in the source database A. The statement for querying the table B in the source database A is as follows, that is, add @ orclAB: Select * from target database table name @ orclAB behind the user table name; Description: orclAB: Custom connection name; TargetUserName: logon username of the target database B; targetUser password: logon password of the target database B; 172. *. *. *: IP address of the machine where the target database B is located; 1521: port opened for the target oracle database; TargetServiceName: Service name of the target oracle database;