Configuration steps for Oracle Advanced Replication

Source: Internet
Author: User
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 the test scheme: Synchronous replication of Oracle Advanced Replication

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 the test scheme: Synchronous replication of Oracle Advanced Replication

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.

 
 
  1. alter system set global_names=true scope=both;

2. Create application users CQM on the two databases respectively

 
 
  1. CREATE USER CQM IDENTIFIED BY CQM DEFAULT TABLESPACE CQM TEMPORARY TABLESPACE TEMP;
  2. GRANT DBA TO CQM;

3. Create a copy administrator user REPADMIN on the two databases respectively.

Create a repadmin user management replication Environment

 
 
  1. CREATE USER REPADMIN IDENTIFIED BY REPADMIN;
  2. ALTER USER REPADMIN DEFAULT TABLESPACE USERS;
  3. ALTER USER REPADMIN TEMPORARY TABLESPACE TEMP;
  4. GRANT connect, resource TO REPADMIN;

Grant repadmin user permissions to manage any subject groups on the current site

 
 
  1. EXECUTE dbms_repcat_admin.grant_admin_any_schema('REPADMIN');

Grant the repadmin user permission to create a snapshot logs for any table

 
 
  1. GRANT comment any table TO REPADMIN;
  2. GRANT lock any table TO REPADMIN;

Specify the repadmin user as propagator and grant the permission to execute any procedure.

 
 
  1. EXECUTE dbms_defer_sys.register_propagator('REPADMIN');
  2. GRANT execute any procedure TO REPADMIN;

4. Change the global names of the two databases

 
 
  1. alter database rename global_name to A.TEST.COM.CN;
  2. 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

 
 
  1. create public database link test.im.com.cn connect to REPADMIN identified by REPADMIN using 'test';
  2. 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.

 
 
  1. CREATE TABLE TEST(ID NUMBER(10),TIMESTAMP DATE DEFAULT sysdate);
  2. ALTER TABLE TEST ADD(CONSTRAINT TEST_PK PRIMARY KEY(ID));

Under user CQM on Database EREAD:

 
 
  1. CREATE TABLE TEST(ID NUMBER(10),TIMESTAMP DATE DEFAULT sysdate);
  2. 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:

 
 
  1. execute dbms_repcat.create_master_repgroup('rep_hh');
  2. execute dbms_repcat.create_master_repgroup('repg');

Add a copy object to the copy group:

 
 
  1. execute dbms_repcat.create_master_repobject
    (sname=>'cqm',oname=>'test',type=>'table',
    use_existing_object=>true,gname=>'repg');,copy_rows=>false);

Supports copying objects:

 
 
  1. execute dbms_repcat.generate_replication_support('cqm','test','table');

Add a master copy node:

 
 
  1. 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:

 
 
  1. 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:

 
 
  1. CREATE OR REPLACE procedure insert_into_test
  2. as
  3. i number;
  4. m NUMBER;
  5. n NUMBER;
  6. BEGIN
  7. n:=0;
  8. FOR i IN 1..10000 LOOP
  9. m:=i;
  10. INSERT INTO test(id)VALUES (m);
  11. nn:=n+1;
  12. IF n=1000 THEN
  13. COMMIT;
  14. n:=0;
  15. END IF;
  16. END LOOP;
  17. COMMIT;
  18. END;
  19. /

The above content is an introduction to the synchronization replication of Oracle Advanced Replication. I hope you will have some gains.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.