GoldenGate配置(一)之单向复制配置(二)

2015-07-24 10:24:03 ? 作者: ? 浏览: 7
files /u01/app/ogg/dirver: created

Veridata Lock files /u01/app/ogg/dirver/lock: created

Veridata Out-Of-Sync files /u01/app/ogg/dirver/oos: created

Veridata Out-Of-Sync XML files/u01/app/ogg/dirver/oosxml: created

Veridata Parameter files /u01/app/ogg/dirver/params: created

Veridata Report files /u01/app/ogg/dirver/report: created

Veridata Status files /u01/app/ogg/dirver/status: created

Veridata Trace files /u01/app/ogg/dirver/trace: created

Stdout files /u01/app/ogg/dirout: created?

gc1:建立GoldenGate用户、授权

[oracle@gc1~]$ mkdir -p /u01/app/oracle/oradata/soraeuc/

SQL>create tablespace tbs_gguser datafile'/u01/app/oracle/oradata/soraeuc/gguser.dbf' size 50M autoextend on; --创建表空间

SQL>create user ogg identified by Ogg default tablespacetbs_gguser temporary tablespace TEMPTS quota unlimited on tbs_gguser;

SQL>grant CONNECT, RESOURCE to ogg;

SQL>grant CREATE SESSION, ALTER SESSION to ogg;

SQL>grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;

SQL>grant ALTER ANY TABLE to ogg;

SQL>grant FLASHBACK ANY TABLE to ogg;

SQL>grant EXECUTE on DBMS_FLASHBACK to ogg;

SQL>@/u01/app/ogg/demo_ora_create --创建模拟同步的表

Table dropped.

Table created.

Table dropped.

Table created.

SQL>@/u01/app/ogg/demo_ora_insert --向模拟同步的表中插入数据

1 row created.

1 row created.

1 row created.

1 row created.

Commit complete.

SQL>select * from tcustmer;

CUST NAME CITY ST

------------------------------------------------------------------------------------ --

WILL BG SOFTWARE CO. SEATTLE WA

JANE ROCKY FLYER INC. DENVER CO

SQL>select * from tcustord;

CUST ORDER_DATE PRODUCT_ ORDER_ID PRODUCT_PRICEPRODUCT_AMOUNT TRANSACTION_ID

---- ------------ -------- ----------------------- -------------- --------------

WILL 30-SEP-94 CAR 144 17520 3 100

JANE 11-NOV-95 PLANE 256 133300 1 100?

gc2: 建立GoldenGate用户、授权

[oracle@gc2~]$ mkdir -p /u01/app/oracle/oradata/soraeuc/

SQL>create tablespace tbs_gguser datafile'/u01/app/oracle/oradata/soraeuc/gguser.dbf' size 50M autoextend on; --创建与源库相同的表空间

SQL>create user ogg identified by Ogg default tablespacetbs_gguser temporary tablespace TEMPTS quota unlimited on tbs_gguser;

SQL>grant CONNECT, RESOURCE to ogg;

SQL>grant CREATE SESSION, ALTER SESSION to ogg;

SQL>grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;

SQL>grant CREATE TABLE to ogg;

SQL>conn scott/tiger

SQL>@/u01/app/ogg/demo_ora_create --创建表,但不插入数据

Table dropped.

Table created.

Table dropped.

Table created.

SQL>grant INSERT, UPDATE, DELETE on scott.tcustmer to ogg; --把需要同步表的DML操作授权给ogg

SQL>grant INSERT, UPDATE, DELETE on scott.tcustord to ogg; --把需要同步表的DML操作授权给ogg

gc1:开启补充日志

SQL>select SUPPLEMENTAL_LOG_DATA_MIN from v$database; --检查源端是否开启补充日志

SUPPLEME

--------

NO

SQL>alter database add supplemental log data; --开启补充日志

SQL>alter system switch logfile; --切归档

gc1: 开启归档

SQL>conn /as sysdba

SQL>alter system set log_archive_dest=' /u01/app/oracle/oradata/soraeuc/arch';

SQL>shutdown immediate

SQL>startup mount

SQL>alter database archivelog;

SQL>alter database open;

SQL>alter system archive log current; --检查归档日志信息

SQL>archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination /u01/app/oracle/oradata/soraeuc/arch

Oldest online log sequence 14

Next log sequence to archive 16

Current log sequence 16?

gc1:开启补充日志

SQL>SELECT force_logging FROM v$databa

-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: