oracle 12c pdb ogg,oracle 12c goldengate 12c pdb1,pdb2 in same container 数据同步测试

本文档记录了在Oracle 12c环境中配置GoldenGate进行PDB (Pluggable Database) 数据同步的步骤。内容包括设置GoldenGate管理权限、创建用户、分配表空间、初始化数据库连接、创建和管理抽取进程EXT1,以及处理同步过程中遇到的问题,如错误的用户名/密码和checkpoint表的创建等。
摘要由CSDN通过智能技术生成

[oracle@node1 ogg12c]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 07:25:11 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect /as sysDBA

Connected.

SQL> alter system set enable_goldengate_replication=true;

System altered.

SQL> grant set container to c##ggadmin;

Grant succeeded.

SQL> grant dba to c##ggadmin;

Grant succeeded.

SQL> select privilege from dba_sys_privs where grantee = 'C##GGADMIN';

PRIVILEGE

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

DROP ANY EDITION

CREATE JOB

ALTER ANY TABLE

UNLIMITED TABLESPACE

ALTER SESSION

CREATE RULE SET

LOGMINING

SET CONTAINER

FLASHBACK ANY TABLE

CREATE ANY EDITION

CREATE RULE

PRIVILEGE

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

EXECUTE ANY RULE SET

CREATE EVALUATION CONTEXT

SELECT ANY TABLE

CREATE SESSION

DEQUEUE ANY QUEUE

UNLIMITED TABLESPACE

17 rows selected.

SQL> exec dbms_goldengate_auth.grant_admin_privilege('c##ggadmin','capture',container=>'all');

PL/SQL procedure successfully completed.

SQL> grant create session to c##ggadmin;

Grant succeeded.

SQL> grant alter session to c##ggadmin;

Grant succeeded.

SQL> grant set container to c##ggadmin;

Grant succeeded.

SQL> select privilege from dba_sys_privs where grantee = 'C##GGADMIN';

PRIVILEGE

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

CREATE JOB

ALTER ANY TABLE

UNLIMITED TABLESPACE

ALTER SESSION

CREATE RULE SET

LOGMINING

SET CONTAINER

FLASHBACK ANY TABLE

CREATE RULE

EXECUTE ANY RULE SET

CREATE EVALUATION CONTEXT

PRIVILEGE

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

SELECT ANY TABLE

CREATE SESSION

DEQUEUE ANY QUEUE

UNLIMITED TABLESPACE

15 rows selected.

SQL> alter user c##ggadmin default tablespace users;

User altered.

SQL> alter user c##ggadmin quota unlimited on users;

User altered.

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

[oracle@node1 ogg12c]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO

Linux, x64, 64bit (optimized), Oracle 12c on Dec 12 2015 02:56:48

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

GGSCI (node1) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING

GGSCI (node1) 2> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING

GGSCI (node1) 3> dblogin userid c#ggadmin,password oracle

ERROR: Unable to connect to database using user c#ggadmin. Please check privileges.

Unable to initialize database connection because of error ORA-01017: invalid username/password; logon denied.

GGSCI (node1) 4> dblogin userid c#ggadmin ,password oracle

ERROR: Unable to connect to database using user c#ggadmin. Please check privileges.

Unable to initialize database connection because of error ORA-01017: invalid username/password; logon denied.

GGSCI (node1) 5> dblogins userid c##ggadmin,password oracle

ERROR: Invalid command.

GGSCI (node1) 6> dblogin userid c##ggadmin,password oracle

Successfully logged into database CDB$ROOT.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 7>

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 7>

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 7>

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 7>  add extract ext1, integrated tranlog, begin now

EXTRACT (Integrated) added.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 8> register extract ext1 database container(pdb1)

2016-10-07 07:32:08  INFO    OGG-02003  Extract EXT1 successfully registered with database at SCN 1879420.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 9> add schematrandata pdb1.source

2016-10-07 07:32:40  ERROR   OGG-01789  Failed to ADD SCHEMATRANDATA on schema source, because schema does not exist.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 10> add schematrandata pdb1.test

2016-10-07 07:32:59  INFO    OGG-01788  SCHEMATRANDATA has been added on schema test.

2016-10-07 07:32:59  INFO    OGG-01976  SCHEMATRANDATA for scheduling columns has been added on schema test.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 11> add exttrail ./dirdat/ex, extract ext1

EXTTRAIL added.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 12> add checkpointtable pdb1.c##ggadmin.checkpoint

Successfully created checkpoint table pdb1.c##ggadmin.checkpoint.

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 13> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING

EXTRACT     STOPPED     EXT1        00:00:00      00:04:29

GGSCI (node1 as c##ggadmin@dev12c/CDB$ROOT) 14> exit

[oracle@node1 ogg12c]$ sqlplus c##ggadmin/pdb2

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 07:36:14 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name: ^C

[oracle@node1 ogg12c]$

[oracle@node1 ogg12c]$ sqlplus c##ggadmin/oracle@pdb2

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 07:36:33 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:

ORA-12154: TNS:could not resolve the connect identifier specified

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

[oracle@node1 ogg12c]$ cd

[oracle@node1 ~]$ cd $ORACLE_HOME/network/admin

[oracle@node1 admin]$ ls

listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

[oracle@node1 admin]$ vi tnsnames.ora

[oracle@node1 admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

DEV12C =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = dev12c)

)

)

PDB1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = pdb1)

)

)

PDB2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = pdb2)

)

)

[oracle@node1 admin]$

[oracle@node1 admin]$

[oracle@node1 admin]$ sqlplus c##ggadmin/oracle@pdb2

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 07:37:53 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Last Successful login time: Fri Oct 07 2016 07:31:11 -04:00

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> create user test identified by oracle account unlock;

User created.

SQL> alter user test quota unlimited on users;

User altered.

SQL> grant connect,resource,create session to test;

Grant succeeded.

SQL> connect test/oracle

ERROR:

ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

SQL> connect test/oracle@pdb2

Connected.

SQL> create table source(id int primary key);

Table created.

SQL> commit;

Commit complete.

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Applicat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值