Environments
On master database server
Global db name: orcl.example.com SID = orcl IP : 192.168.50.103 (Some IP you want)
On slave server
Global db name: orcl2.example.com SID = orcl2 IP : 192.168.50.63
See more information: Global db name, SID if you forgot.
start -> run -> regedit -> Software -> Oracle
Folder and dir
<Home_database_oracle_dir>/NETWORK/ADMIN - listener.ora : This configuration file allows listening to replace certain database in server. Can listen to multiple databases in one summary report. Be construed as headphones Database Server.
- sqlnet.ora : Contains declarations for the file listener.ora and tnsname.ora
- tnsname.ora : This file contains declarations for the clients to have access to the database that the server is listening in the declaration in the listener.ora file.
Configuration database on two machines can communicate with each other:
- On the master: Configure listener.ora file that listens for database orc1.example.com in 1521. default gateway can be configured using graphical tools (Net Configuration Assistants) or by writing directly to the listener.ora file.
- Here is declared the master machine:
listener.ora
tnsname.ora
The same with slave server
Restart listener
start -> run -> cmd (admin) > tsnrctl stop > tsnrctl start
Check the connection between the two databases on master and slave server.
On slave serverstart -> cmd (admin) > tnsping orclOn master server
> tnsping orcl2
Create user reptest / reptest and assign the necessary permissions on the 2 sides:
On masterOn slave
- Create db links
- Create obj_1 table and add data to the table on the master machine. (Implementation by reptest users can perform with SQL Development graphical tool or by the following command.)
- Create snapshot logs (only master server)
- On slave server, create reptest user
- Create a link to the master database and checking links.
- Create snapshots, and perform sync (Snapshot, just perform the slave)
Value sysdate: the current system date,
At line 14, as shown above: The system will automatically synchronize the data from the master every 60 seconds (sysdate + 1/1440 = 60s <=> 24/01/60).
Perform basic test replication, at the slave machine executes the query: SQL> select * from obj_1;
If the result is successful, as shown below.
Perform check the updates added to the master:
Wait 1 minute, perform queries on the slave, the following results are successful.
database oracle replication












0 comments:
Post a Comment