The test is successful between the two Oracle databases. The following is A summary: the existing two Oracle database servers A and B (A and B can be on the same Intranet or on the Internet.
The test is successful between the two Oracle databases. The following is A summary: the existing two Oracle database servers A and B (A and B can be on the same Intranet or on the Internet.
The test is successful between two Oracle databases. The following is a summary:
Requirements:
There are two Oracle database servers A and B (A and B can be on the same Intranet or two independent machines on the Internet ). Both A and B have testable tables with the same structure. Now, when the testable table in database A changes, the testable data in database B also changes accordingly.
My solutions:
Create A link to database B in database A, create A synonym for the table to be synchronized, and create A trigger. Of course, the current user you are using must have the appropriate permissions to perform these operations.
When synchronizing data from A to B, all settings should be made on:
1. To ensure connection to the database of another remote server, you need to create a DB Link. However, pay attention to the syntax format: using + "connect string ", this connect string should exist in the TNSNAMES of the oracle server. in the ORA file, the listener obtains the remote server from here.
The IP address and other information. I have defined a '123' connect string as follows:
251 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.20.) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = mychoice)
)
)
Store it in your TNSNAMES. ORA file.
2. Then you can define the DB Link:
Create public database link TEST2.US. ORACLE. COM
Connect to user name
Identified by "password"
Using '000000 ';
3. Create synonym (synonymous)
Create or replace synonym TEST01
For MYCHOICE.TESTABLE@TEST2.US.ORACLE.COM;
After the creation is complete, you can use:
Select * from test01
The preceding statement is equivalent to executing on server B:
Select * from testable
4. feudal triggers:
When the testable table in Table A changes (insert operation is only considered here), the corresponding data will be inserted to the testable of remote database B:
Create or replace trigger rtest
After insert on testable
For each row
Begin
Insert into test01 (something) values (: new. something );
End;
OK. Now we can test it. you can insert A record to the testable table in database A to see if database B has been added accordingly.