A brief discussion on Oracle database set replication Method _oracle

Source: Internet
Author: User
Tags oracle database
The Oracle tutorial you are looking at is: a brief discussion of Oracle database set replication methods. Objective

The growing demand for distributed applications requires a better distributed software environment, which drives the development of distributed technology. Oracle data replication is a technology for implementing distributed data environments, which can be used to create distributed data environments by copying data from different physical sites. Unlike a distributed database, in a distributed database, although each data object is also available to all sites, a particular data object exists only in a particular site. Data replication enables all sites to have copies of the same data objects available.

In a typical distributed business application, it is often necessary to back up the data of the region to the database at Headquarters, on the one hand, it can be used as a backup, on the other hand, it facilitates the comprehensive statistics in the headquarter application. This is a simple application in Oracle data replication, and this article will describe how to implement Oracle data replication with an example.

The reality is that company A is headquartered in Beijing, with three sales offices located in Shanghai (ORACLE, respectively). shanghai.com), Hangzhou (ORACLE. hangzhou.com) and Wuhan (ORACLE.
wuhan.com). Three business departments of the same software system, database structure is the same. It is now necessary to back up the data in all three sales offices to the database at Headquarters.

Preparatory work

There are a lot of things you need to prepare before replicating, and of course the basics are that the network must be unblocked, and then you need to collect some basic information about the replication environment:

1. Number of database sites that need to be replicated

2. Oracle version number for each site

3. The size of each database that needs to be replicated

4. The character set used by each database

5. The scenario name used for each data that needs to be replicated

After gathering the environment information, you can start to build a centralized database at Headquarters, the centralized database requires a version higher than all the main points of the version, preferably all databases are in the same character set. After building the library for each main site backup data to build a table space, table space is larger than the need to replicate the amount of data, as to reserve the future development of space depending on the actual situation.

Create a scenario for each primary site's corresponding replication data, and if each primary site uses a different scenario name, create a corresponding scenario with the same name in the centralized database site. Otherwise, the corresponding schema name is established for each primary site's replicated data. The actual situation is the latter, the database of each sales department is using Oracle's scheme name, here we establish three counterparts
Case: Shoracl, Hzoracl and Whoracl. All databases have a version of 9i.

Basic concepts

Before you copy, explain some of the concepts in replication:

1. Primary site (Mater site): The site that provides the data source during the replication process. such as the Shanghai database site in the figure above.

2. The materialized view site (materialized view site): The target site in the materialized view replication. such as the Beijing database site in the above figure.

3. Multi-agent Site Replication (multimaster Replication): The sites in the replication environment are the primary sites that have the same administrative permissions on the replicated database objects.

4. Materialized view replication (materialized view Replication): A principal site provides source replication objects, and a materialized view site copies primary site data.

5. Materialized view: Materialized the materialized view site for each replicated table or view to create a corresponding table to save the corresponding data, the table can only be through the Oracle replication mechanism for the operation of data deletion.

6. Quick Refresh, full refresh, and force refresh: three ways to refresh during replication. Quick Refresh copies only the changes to the source data object; Full refresh copy the source data object every time; Force Refresh is a compromise of the database and use full refresh if the quick refresh fails.

7. Principal group: A collection of source data objects that are replicated in the principal site.

8. Materialized View group (materialized view site): A collection of replicated objects in a materialized view site.

9. Materialized view log (materialized view log): A table that records the action log of the principal source data object in a materialized view copy using a quick refresh.

Synchronous replication and asynchronous replication are not explained, and this example uses asynchronous replication once a day.

For replication

Configure a good local Service name: Shanghai site: SH, Hangzhou site: HZ, Wuhan site: WH, Beijing site: BJ, into the sqlplus without login, let us start copying!

A Set up the primary site.

Here the Shanghai main site is set up as an example.

1. Connect to the primary site, create a replication administrator, and grant the appropriate permissions, and the replication administrator is the user who manages the entire replication environment and creates the replicated objects. Only the data administrator can establish a body group and a materialized view group.


The following two grant statements enable replication administrators to establish a materialized view log for any table. If you want to change the user to use View Manager, you need the following command:


2. Registers the disseminator, the propagator pushes the deferred transaction queue of the principal site into the other principal site or the materialized view site.


3. Schedules a purge job that periodically clears the deferred transaction queue and propagates deferred transactions to other principal sites or to the materialized view site. To change the user first:


Next_date: Next execution date, sysdate indicates immediately.

Interval: Interval period, sysdate + 1 means interval one day, sysdate+ 1/24 indicates an hour interval

Delay_seconds: The delay time at which the secondary purge operation is stopped when the delay queue does not delay the event.

4. Establish a replication agent for the materialized view site. Create a replication agent user and grant view subject permissions. The replication agent is the user who replicates the recipient's connection to the principal site


5. Create a body group.

Related Article

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.