GoldenGate单向表DML同步(三)

2014-11-24 14:59:24 · 作者: · 浏览: 2
alvin) 3> info mgr
Manager is running (IP port kf2.calvin.7809).
6. 创建源数据库和目标数据库实验用户:
在源数据库端建立:
[oracle@dd1 ogg11]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 11:13:54 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create tablespace testdata datafile'/data/oracle/oradata/test1/testdata01.dbf' size 1G;
Tablespace created.
SQL> create user ogguser identified by ogguser default tablespace testdata quota unlimited on testdata;
User created.
SQL> grant connect,resource to ogguser;
Grant succeeded.
SQL> conn ogguser/ogguser
Connected.
创建实验表:
SQL> @demo_ora_create.sql
DROP TABLE tcustmer
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
DROP TABLE tcustord
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
往实验表插入数据记录:
SQL> @demo_ora_insert.sql
1 row created.
1 row created.
1 row created.
1 row created.
Commit complete.
在目标目标库端建立:
GGSCI (kf2.calvin) 4> quit
[oracle@kf2 ogg11]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 11:24:40 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create tablespace testdata datafile'/data/oracle/oradata/test2/testdata01.dbf' size 1G;
Tablespace created.
SQL> create user ogguser identified by ogguser default tablespace testdata quota unlimited on testdata;
User created.
SQL> grant connect,resource to ogguser;
Grant succeeded.
SQL> conn ogguser/ogguser
Connected.
目标库创建实验表,但不插入数据:
SQL> @demo_ora_create.sql
DROP TABLE tcustmer
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
DROP TABLE tcustord
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
查看源库表数据:
SQL> show user
USER is "OGGUSER"
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_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
---- --------- -------- ---------- ------------- -------------- --------------
WILL 30-SEP-94 CAR 144 17520 3 100
JANE 11-NOV-95 PLANE 256 133300 1 100
查看目标库数据记录:
SQL> show user
USER is "OGGUSER"
SQL> select * from tcustmer;
no rows selected
SQL> select * from tcustord;