官术网_书友最值得收藏!

Preparing the environment

Preparation is the key to just about any task. Get the preparation right and you will be rewarded with the best results. This is also true for GoldenGate, where a number of fundamental areas need to be prepared before the installation can take place.

Preparing the database for data replication

To successfully create, configure and start our Extract, Data Pump, and Replicat processes, it's important to configure the source database. As described in Chapter 1, Getting Started, GoldenGate relies on the database's changed data to accomplish data replication.

Enabling supplemental logging

In order to extract the committed transactions from the source Oracle database's online redo logs, as a minimum the database must be configured for supplemental logging on Primary Key columns. This can be enabled at database level using the following DDL executed as SYSDBA:

[oracle@dbserver1 ggs]$ sqlplus '/as sysdba'
SQL> alter database add supplemental log data (primary key) columns;

Database altered

Initiate a log file switch to start supplemental logging:

SQL> alter system switch logfile;

System altered.

The following SQL shows the result of enabling the supplemental logging:

SQL> select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_UI from v$database;

SUPPLEME SUP SUP
-------- --- ---
IMPLICIT YES NO

We now need to configure GoldenGate to add supplemental log data to the source tables using GGSCI's ADD TRANDATA command. This is shown in the following example for the SCOTT.DEPT and SCOTT.EMP tables:

[oracle@dbserver1 ggs]$ ggsci
GGSCI (dbserver1) 1> DBLOGIN USERID ggs_admin, PASSWORD ggs_admin
Successfully logged into database.

GGSCI (dbserver1) 2> ADD TRANDATA scott.DEPT

Logging of supplemental redo data enabled for table SCOTT.DEPT.

GGSCI (dbserver1) 3> ADD TRANDATA scott.EMP

Logging of supplemental redo data enabled for table SCOTT.EMP.

Tip

Every source table must have a Primary Key enabled else GoldenGate will define all viable columns to represent uniqueness. This will increase the volume of supplemental log data being written to the redologs and subsequent trail files.

The source database is now ready for data replication!

If you have a lot of tables in your source schema that you wish to replicate, then you could use SQL to generate the ADD TRANDATA statements. Log on to the source database schema using SQL*Plus and execute the following commands:

SQL> set pages 0
SQL> select 'ADD TRANDATA SRC.'||tname from tab;

Preparing the operating system

GoldenGate relies heavily on TCP/IP networking and therefore must be configured correctly. In the earlier sections of this chapter, we configured a Data Pump process that sends data across a TCP/IP network from the source to the target system. In the Data Pump parameter file we specified a remote hostname, which must be resolved to an IP address.

On Linux, the hosts file provides the mapping between host and IP address. For example:

[oracle@dbserver1 ~]$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.65 dbserver1
192.168.1.66 dbserver2

Note

To edit the hosts file you must be the root (super) user.

In the case of a clustered environment, such as Oracle RAC, the hosts file must contain the Virtual IP (VIP) address of the remote nodes.

主站蜘蛛池模板: 南投市| 兴城市| 大理市| 花莲市| 蓝山县| 潼关县| 静乐县| 四川省| 孝义市| 耒阳市| 德安县| 伊吾县| 嘉祥县| 子长县| 遵化市| 江永县| 宁陵县| 井陉县| 闸北区| 景泰县| 涡阳县| 宜都市| 攀枝花市| 文化| 东至县| 鹰潭市| 马鞍山市| 内丘县| 中卫市| 和政县| 河北省| 靖江市| 博客| 兴海县| 大兴区| 天全县| 泉州市| 塘沽区| 花垣县| 新绛县| 桂东县|