During Oracle cross-database query and insertion, data from the GIS_WEICHAI_DATA_1S table in one database must be imported to the GIS_WEICHAI_DATA_1S table in another database. The database servers are all remote <IP addresses: 221.131.228.256 211.161.192.46>! My implementation method is to use PL/SQL locally to operate two remote servers. The implementation method is as follows: www.2cto.com 1. create a local service name for the remote database server you want to operate on: in the local database installation file, find $ ORACLE_HOME/network/admin/tnsnames. add the service name of the first remote server to the end of the ora file: MYORACLE1 www.2cto.com MYORACLE1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 221.131.228.256) (PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = orcl) -- service name of the first remote server: MYORACLE2 MYORACLE2 = (DESCRIPTION = (ADDRESS_LIST = (ADD RESS = (PROTOCOL = TCP) (HOST = 211.161.192.46) (PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = orcl ))) -- If more remote databases need to be operated at the same time, you can add them in sequence! -- If you are using a Windows operating system, you can use the Net Manager tool that comes with Oracle to create a service name in a graphical way! 2. log on to the local database using the sysdba role on the local machine and create database link: execute the following SQL statement: -- The database link create public database link MYDBLINK1 of Remote Server 1 -- you can name it at will. Of course, it cannot be a keyword or reserved word connect to dbUserName1 identified by dbpwd1 using 'myoracle1'; -- the database link create public database link MYDBLINK2 corresponding to remote server 2 -- you can name it at will, of course, cannot be a keyword or reserved word connect to dbUserName2 identified by dbpwd2 using 'myoracle2'; -- enter the corresponding database service name, dbUserName1, and dbpwd1 after using Server login name, password -- delete database link Drop database link MYDBLINK1; -- in this example, MYDBLINK1 and MYDBLINK23. operate the tables on the remote server, adding @ linkName (corresponding database link name) to the corresponding table is similar to operating the table in the local database. You can extract data from different database servers! Very convenient! Insert into GIS_WEICHAI_DATA_1S @ MYDBLINK1 select * from GIS_WEICHAI_DATA_1S @ MYDBLINK2 where rownum <= 10000; 4. if you need to frequently use tables on the remote server, the above statement is a bit annoying. In this case, you can create a synonym for this table: create synonym syName for GIS_WEICHAI_DATA_1S @ MYDBLINK1; you can use syName to use GIS_WEICHAI_DATA_1S @ MYDBLINK1 in the future! Syntax for deleting Synonyms: drop synonym syName; 5. view the DB Link of the current database; select * from user_db_links; -- User DB Link select * from dba_db_links; -- dba DB Link select * from v $ dblink; -- current DB Link