The following articles mainly describe the synchronous replication of ORACLE Advanced Replication. If you need to set up related servers (Oracle) in several regions across the country ), the requirement is the consistency of related dB data. The following describes the specific solution and hopes to help you in your future study.
One of the following is a test scheme: Synchronous Replication
Detailed steps for configuring ORACLE Advanced Replication and synchronous Replication
[Oracle] ORACLE Advanced copy synchronization configuration steps
First, the database must have the Oracle Advanced Replication function (log on to the database as a system and view the V $ option view. If Advanced Replication is true, the Advanced Replication function is supported; otherwise, the Advanced Replication function is not supported)
I. basic information about the database
Database version a: oracle 10.2.0.1 database name Sid: eread
Database B version Oracle 10.1.0.3 database name Sid: Test
Subject-defined site: A eread
Main Site: B Test
Note: The subject-defined site refers to the site configured for replication.
Users involved in this example.
Copy administrator: repadmin
Application User: CQM
In this example, the Oracle Advanced copy object is the reptest data table.
Prerequisites for this example: You need to set the corresponding parameters. job_queue_processes must be greater than 0, global_name = true, and the corresponding dB link is created.
- alter system set global_names=true scope=both;
2. Create application users CQM on the two databases respectively
- CREATE USER CQM IDENTIFIED BY CQM DEFAULT TABLESPACE CQM TEMPORARY TABLESPACE TEMP;
- GRANT DBA TO CQM;
3. Create a copy administrator user repadmin on the two databases respectively.
Create a repadmin user management replication Environment
- CREATE USER REPADMIN IDENTIFIED BY REPADMIN;
- ALTER USER REPADMIN DEFAULT TABLESPACE USERS;
- ALTER USER REPADMIN TEMPORARY TABLESPACE TEMP;
- GRANT connect, resource TO REPADMIN;
Grant repadmin user permissions to manage any subject groups on the current site
- EXECUTE dbms_repcat_admin.grant_admin_any_schema('REPADMIN');
Grant the repadmin user permission to create a snapshot logs for any table
- GRANT comment any table TO REPADMIN;
- GRANT lock any table TO REPADMIN;
Specify the repadmin user as propagator and grant the permission to execute any procedure.
- EXECUTE dbms_defer_sys.register_propagator('REPADMIN');
- GRANT execute any procedure TO REPADMIN;
4. Change the global names of the two databases
- alter database rename global_name to A.TEST.COM.CN;
- alter database rename global_name to B.TEST.COM.CN;
A: eread.im.com.cn
B: test.im.com.cn
5. Create database links on two databases
- create public database link test.im.com.cn connect to REPADMIN identified by REPADMIN using 'test';
- create public database link eread.im.com.cn connect to REPADMIN identified by REPADMIN using 'eread';
6. Create a table under CQM of two Database Application Users
In the database eread user CQM: note that the table for advanced Oracle replication must have a primary key.
- CREATE TABLE TEST(ID NUMBER(10),TIMESTAMP DATE DEFAULT sysdate);
- ALTER TABLE TEST ADD(CONSTRAINT TEST_PK PRIMARY KEY(ID));
Under user CQM on Database eread:
- CREATE TABLE TEST(ID NUMBER(10),TIMESTAMP DATE DEFAULT sysdate);
- ALTER TABLE TEST ADD(CONSTRAINT TEST_PK PRIMARY KEY(ID));
7. Start operations on the subject-defined site (Database A: eread)
Log on to the database eread with repadmin
Create a replication group:
- execute dbms_repcat.create_master_repgroup('rep_hh');
- execute dbms_repcat.create_master_repgroup('repg');
Add a copy object to the copy group:
- execute dbms_repcat.create_master_repobject
(sname=>'cqm',oname=>'test',type=>'table',
use_existing_object=>true,gname=>'repg');,copy_rows=>false);
Supports copying objects:
- execute dbms_repcat.generate_replication_support('cqm','test','table');
Add a master copy node:
- execute dbms_repcat.add_master_database(gname=>'repg',master=>'
test.im.com.cn',use_existing_objects=>true,
copy_rows=>false, propagation_mode => 'synchronous');
Start ORACLE Advanced Replication at the subject-defined site:
- execute dbms_repcat.resume_master_activity('repg',true);
8. Now the configuration is complete.
Test:
1) Test the simulated small data volume: OK
2) simulate a large data volume test:
- CREATE OR REPLACE procedure insert_into_test
- as
- i number;
- m NUMBER;
- n NUMBER;
- BEGIN
- n:=0;
- FOR i IN 1..10000 LOOP
- m:=i;
- INSERT INTO test(id)VALUES (m);
- nn:=n+1;
- IF n=1000 THEN
- COMMIT;
- n:=0;
- END IF;
- END LOOP;
- COMMIT;
- END;
- /
The above content is an introduction to the synchronization replication of ORACLE Advanced Replication. I hope you will have some gains.