Recently encountered a problem: Adding and changing data to a table in another remote database in an Oracle database
The customer requested that the two tables be synchronized on a regular basis, and began to prepare for writing them into the Windows service form. In case of any trouble, he searched the internet and found a way to change the data to the remote database.
Configure the remote database in TNS
Proxy name: temporary name given to the remote user table
User name and password: the user name and password of the tablespace you want to connect
Primary service name: The Sid you configured in TNS
Format:
Create Database Link proxy name connect To User name identified By Password using ' Main service name '
For example:Create DatabaseLink Kenshin connectToZdt identifiedByZdt using'Jndb';
Check whether the link is set up:Select * FromUser_db_links
After completing the preceding steps, you can operate the remote ORACLE database table in the database.
For example:
Select * From Dual @ Kenshin
Recently, the most important thing is to commit transactions after the update, insert into, and delete statements; otherwise, distributed transactions cannot be committed!Delete FromDual;
Commit;