GoldenGate 12c + Oracle 12c Multitenant Container databases

下面为GoldenGate 12c + Oracle 12c Multitenant Container databases例子

1、安装OGG

源 端OGG: C:\Oracle\product\12.1.2\OGG_Source

目标端OGG: C:\Oracle\product\12.1.2\OGG_Target

2、创建测试的用户及表格

源表:

SQL> alter session set container=pdborcl;

会话已更改。

SQL> show con_name;

CON_NAME

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

PDBORCL

SQL> create user gg_src identified by gg_src;

用户已创建。

SQL> grant dba to gg_src;

授权成功。

SQL> create table tab01(id number(8),name varchar2(20));

表已创建。

目标表

SQL> alter session set container=pdborcl2;

会话已更改。

SQL> show con_name;

CON_NAME

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

PDBORCL2

SQL> create user gg_stg identified by gg_stg;

用户已创建。

SQL> grant dba to gg_stg;

授权成功。

SQL> create table tab01(id number(8),name varchar2(20));

表已创建。

3、配置数据库归档模式

查看归档模式

select log_mode from v$database;

更改为归档模式

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

4、设置supplemental logging and FORCE LOGGING;

sql> alter database add supplemental log data;

sql> alter database force logging;

sql> alter system switch logfile;

sql>select supplemental_log_data_min, force_logging from v$database;

5、创建Common User

SQL*Plus: Release 12.1.0.1.0 Production on 星期二 5月 26 15:42:19 2015

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

请输入用户名: sys as sysdba

输入口令:

连接到:

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

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

SQL> create user C##GGADMIN identified by ggadmin;

用户已创建。

SQL> exec dbms_goldengate_auth.grant_admin_privilege(‘C##GGADMIN‘,container=>‘ALL‘);

PL/SQL 过程已成功完成。

SQL> grant dba to c##ggadmin container=all;

授权成功。

6、源端OGG配置

Add supplemental logging for the gg_src schema

Note: here we are connecting to the pluggable database pdborcl

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Source

C:\Oracle\product\12.1.2\OGG_Source>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> dblogin userid C##[email protected] password ggadmin

Successfully logged into database PDBORCL.

GGSCI (XQZT-PC as C##[email protected]/PDBORCL) 2> ADD SCHEMATRANDATA gg_src ALLCOLS

2015-05-26 15:53:53 INFO OGG-01788 SCHEMATRANDATA has been added on schema

gg_src.

2015-05-26 15:53:53 INFO OGG-01976 SCHEMATRANDATA for scheduling columns ha

s been added on schema gg_src.

2015-05-26 15:53:53 INFO OGG-01977 SCHEMATRANDATA for all columns has been

added on schema gg_src.

GGSCI (XQZT-PC as C##[email protected]/PDBORCL) 3>

Register the Integrated Extract

Note: here we are connecting to the root container database.

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Source

C:\Oracle\product\12.1.2\OGG_Source>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> dblogin userid C##GGADMIN password ggadmin

Successfully logged into database CDB$ROOT.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 2> REGISTER EXTRACT ext1 DATABASE C

ONTAINER (pdborcl)

Extract EXT1 successfully registered with database at SCN 4296859.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 3>

Add the Extract and Data Pump process groups

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Source

C:\Oracle\product\12.1.2\OGG_Source>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> dblogin userid C##GGADMIN password ggadmin

Successfully logged into database CDB$ROOT.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 2> REGISTER EXTRACT ext1 DATABASE C

ONTAINER (pdborcl)

Extract EXT1 successfully registered with database at SCN 4296859.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 3> ADD EXTRACT ext1 INTEGRATED TRANL

OG, BEGIN NOW

EXTRACT added.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 4> ADD EXTTRAIL C:\Oracle\product\1

2.1.2\OGG_Source\dirdat\lt EXTRACT ext1

EXTTRAIL added.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 5> ADD EXTRACT extdp1 EXTTRAILSOURCE

C:\Oracle\product\12.1.2\OGG_Source\dirdat\lt BEGIN NOW

EXTRACT added.

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 6> ADD RMTTRAIL C:\Oracle\product\12

.1.2\OGG_Target\dirdat\rt EXTRACT extdp1

RMTTRAIL added.

GGSCI (orasql-001-dev.mydomain) 7> edit params ext1

GGSCI (orasql-001-dev.mydomain) 8> view params ext1

EXTRACT ext1

SETENV (ORACLE_SID=‘ORCL‘)

userid C##[email protected], password ggadmin 

LOGALLSUPCOLS

UPDATERECORDFORMAT COMPACT

EXTTRAIL C:\Oracle\product\12.1.2\OGG_Source\dirdat\lt

SOURCECATALOG PDBORCL

TABLE gg_src.*;

GGSCI (orasql-001-dev.mydomain) 9> edit params extdp1

GGSCI (orasql-001-dev.mydomain) 10> view params extdp1

EXTRACT extdp1

SETENV (ORACLE_SID=‘ORCL‘)

userid C##[email protected], password ggadmin

RMTHOST 127.0.0.1, MGRPORT 7810

RMTTRAIL C:\Oracle\product\12.1.2\OGG_Target\dirdat\rt

SOURCECATALOG PDBORCL

TABLE gg_src.*;

GGSCI (XQZT-PC as C##[email protected]/CDB$ROOT) 11>

7、目标端配置OGG

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Target

C:\Oracle\product\12.1.2\OGG_Target>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> DBLOGIN USERID C##[email protected], PASSWORD ggadmin

Successfully logged into database PDBORCL2.

GGSCI (XQZT-PC as C##[email protected]/PDBORCL2) 2> ADD REPLICAT rep1 INTEGRATED EXTT

RAIL C:\Oracle\product\12.1.2\OGG_Target\dirdat\rt

REPLICAT (Integrated) added.

GGSCI (XQZT-PC as C##[email protected]/PDBORCL2) 3> edit params rep1

GGSCI (XQZT-PC as C##[email protected]/PDBORCL2) 4> view params rep1

REPLICAT rep1

SETENV (ORACLE_SID=‘ORCL‘)

DBOPTIONS INTEGRATEDPARAMS(parallelism 6)

USERID C##[email protected], PASSWORD ggadmin

ASSUMETARGETDEFS

MAP PDBORCL.gg_src.*, TARGET PDBORCL2.gg_stg.*;

GGSCI (XQZT-PC as C##[email protected]/PDBORCL2) 5> view param mgr

PORT 7810

GGSCI (XQZT-PC as C##[email protected]/PDBORCL2) 6>

8、启动extract和replicat进程

源端:

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Source

C:\Oracle\product\12.1.2\OGG_Source>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> start mgr

Manager started.

GGSCI (XQZT-PC) 2> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT STOPPED EXT1 00:00:02 00:00:59

EXTRACT STOPPED EXTDP1 00:00:00 00:00:59

GGSCI (XQZT-PC) 3> start extract ext1

Sending START request to MANAGER ...

EXTRACT EXT1 starting

GGSCI (XQZT-PC) 4> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING EXT1 00:01:15 00:00:04

EXTRACT STOPPED EXTDP1 00:00:00 00:01:17

GGSCI (XQZT-PC) 5> start extract extdp1

Sending START request to MANAGER ...

EXTRACT EXTDP1 starting

GGSCI (XQZT-PC) 6> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING EXT1 00:00:02 00:00:08

EXTRACT RUNNING EXTDP1 00:19:01 00:00:00

GGSCI (XQZT-PC) 7> info extract ext1

EXTRACT EXT1 Last Started 2015-05-26 16:17 Status RUNNING

Checkpoint Lag 00:00:01 (updated 00:00:06 ago)

Process ID 9872

Log Read Checkpoint Oracle Integrated Redo Logs

2015-05-26 16:18:16

SCN 0.4345601 (4345601)

GGSCI (XQZT-PC) 8> info extract extdp1

EXTRACT EXTDP1 Last Started 2015-05-26 16:18 Status RUNNING

Checkpoint Lag 00:00:00 (updated 00:00:06 ago)

Process ID 7892

Log Read Checkpoint File C:\Oracle\product\12.1.2\OGG_Source\dirdat\lt000001

2015-05-26 16:17:57.784000 RBA 1458

GGSCI (XQZT-PC) 9>

目标端:

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\XQZT>cd C:\Oracle\product\12.1.2\OGG_Target

C:\Oracle\product\12.1.2\OGG_Target>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Windows x64 (optimized), Oracle 12c on Sep 20 2014 14:25:39

Operating system character set identified as GBK.

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

GGSCI (XQZT-PC) 1> start mgr

Manager started.

GGSCI (XQZT-PC) 2> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

REPLICAT STOPPED REP1 00:00:00 00:06:59

GGSCI (XQZT-PC) 3> start replicat rep1

Sending START request to MANAGER ...

REPLICAT REP1 starting

GGSCI (XQZT-PC) 4> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING REP1 00:00:00 00:13:39

GGSCI (XQZT-PC) 5>

9、测试配置结果

连接到源PDB并插入数据

SQL> show con_name;

CON_NAME

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

PDBORCL

SQL> select * from tab01;

未选定行

SQL> insert into tab01(id,name) values(1,‘1‘);

已创建 1 行。

SQL> commit;

提交完成。

SQL>

连接到目标PDB,查看是否已经同步

SQL> show con_name;

CON_NAME

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

PDBORCL2

SQL> select * from tab01;

ID NAME

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

1 1

SQL>

查看extract

GGSCI (XQZT-PC) 11> STATS EXT1

Sending STATS request to EXTRACT EXT1 ...

Start of Statistics at 2015-05-26 16:34:06.

DDL replication statistics (for all trails):

*** Total statistics since extract started ***

Operations 1.00

Output to C:\Oracle\product\12.1.2\OGG_Source\dirdat\lt:

Extracting from PDBORCL.GG_SRC.TAB01 to PDBORCL.GG_SRC.TAB01:

*** Total statistics since 2015-05-26 16:30:01 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2015-05-26 16:30:01 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2015-05-26 16:30:01 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2015-05-26 16:30:01 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

End of Statistics.

GGSCI (XQZT-PC) 12> STATS EXTDP1

Sending STATS request to EXTRACT EXTDP1 ...

Start of Statistics at 2015-05-26 16:34:16.

Output to C:\Oracle\product\12.1.2\OGG_Target\dirdat\rt:

Extracting from PDBORCL.GG_SRC.TAB01 to PDBORCL.GG_SRC.TAB01:

*** Total statistics since 2015-05-26 16:30:08 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2015-05-26 16:30:08 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2015-05-26 16:30:08 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2015-05-26 16:30:08 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

End of Statistics.

GGSCI (XQZT-PC) 13>

查看replicat

GGSCI (XQZT-PC) 5> stats rep1

Sending STATS request to REPLICAT REP1 ...

Start of Statistics at 2015-05-26 16:32:11.

Integrated Replicat Statistics:

Total transactions 1.00

Redirected 0.00

DDL operations 0.00

Stored procedures 0.00

Datatype functionality 0.00

Event actions 0.00

Direct transactions ratio 0.00%

Replicating from PDBORCL.GG_SRC.TAB01 to PDBORCL2.GG_STG.TAB01:

*** Total statistics since 2015-05-26 16:30:14 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2015-05-26 16:30:14 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2015-05-26 16:30:14 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2015-05-26 16:30:14 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total discards 0.00

Total operations 1.00

End of Statistics.

GGSCI (XQZT-PC) 6>

原文地址

http://gavinsoorma.com/2014/01/using-goldengate-12c-with-an-oracle-12c-multitenant-database/

http://www.zhongweicheng.com/?p=755

http://docs.oracle.com/goldengate/1212/gg-winux/GIORA/config_containerdb.htm#GIORA942

goldengate 12c 针对oracle 12c配置的主要变化

oracle12c configured Integrated Capture mode

oracle12c configured Integrated REPLICAT mode

时间: 2024-10-10 21:28:52

GoldenGate 12c + Oracle 12c Multitenant Container databases的相关文章

[原创]zero downtime using goldengate实现oracle 12C升级系列 第四篇:集群安装

1. 图形化界面,我用的软件是MobaXterm Personal Edition, 直接ssh [email protected]_server,然后./runInstaller就可以弹出图形化界面,当然还有其他工具如vnc可以实现图形化,这里就略过不提了,下面直接开始安装. 2.关于软件下载,在mos上面下载 Installation Type Zip File Oracle Database (includes Oracle Database, Oracle RAC, and Deinst

[原创]zero downtime using goldengate实现oracle 12C升级系列 第三篇:asmlib配置

1. All nodes as root rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm rpm -qa *asm* kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64 oracleasm-support-2.1.8-1.el6.x86_64 oracleasmlib-2.0.4-1.el6.x86_64 rpm -qa cvu*cvuqdisk-1.0.9-1.x86_64 2.装完上述必备的rpm之后就可以开始配置asm

goldengate 12c 针对oracle 12c配置的主要变化

由于oracle 12c已经是多租户架构,在使用OGG同步的时候,需要考虑下面一些情况 一个 CDB包含多个PDB,源端部署的一个extract可访问所有pdb redo,理论上不需要每个pdb单独配置extract. 抽取模式只能是integrated(集成)模式,不支持claasic capture传统方式捕获: 因为要使用integrated extract,因此,需要能访问log mining server,而这个只能从cdb$root中访问: 源端要使用common user,即c##

转 Oracle 12c: Managing Resources

http://www.oracle-class.com/?p=3058 1. Introduction: Oracle database 12c comes with several Resource management enhancements to handle resources within CDBs and PDBs. In this article we will focus on the use of Resource Manager in a CDB environment.

Oracle 12c新特性(For DBA)

一: Multitenant Architecture (12.1.0.1)      多租户架构是Oracle 12c(12.1)的新增重磅特性,内建的多分租(Multi-tenancy),一个容器数据库(container database)中可以存放多个Pluggable Databases,每个Pluggable Database均独立于其他Pluggable Database. 对于外部应用程序和开发者来说,Pluggable Databases看上去就是一个普通的12.1版本之前的单

Oracle 12c 用户创建、角色、权限

一.创建用户 创建用户默认的是container=all,在cdb中只能创建全局用户(c##开头),会在cdb和所有的pdb中创建该用户(但是pdb中的全局用户需要另外授权才能够在pdb中访问).在pdb中只能创建的用户为本地用户 SQL> show con_name; CON_NAME ------------------------------ CDB$ROOT SQL> create user user1 identified by user1; create user user1 id

浅谈oracle 12C的新特性-CDB和PDB

最近看到好多人都在尝试oracle中的12C新特性-容器数据库,今年3月orcle退出了Release2版本,可以算是一个稳定版本了.下午着手尝试了一下,还是蛮不错得 1.前言 CDB与PDB是Oracle 12C引入的新特性,在ORACLE 12C数据库引入的多租用户环境(Multitenant Environment)中,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB).CDB全称为ContainerDatabase,中文翻译为数据库容器,PDB全称为Pluggable Datab

Oracle 12c创建用户是出现“ORA-65096: invalid common user or role name”的错误

这篇文章主要介绍CDB和PDB的基本管理,资料来源oracle官方. 基本概念: Multitenant Environment:多租户环境 CDB(Container Database):数据库容器 PD(Pluggable Database):可插拔数据库 CDB与PDB关系图 COMMON USERS(普通用户):经常建立在CDB层,用户名以C##或c##开头: LOCAL USERS(本地用户):仅建立在PDB层,建立的时候得指定CONTAINER. 在oracle 12c中,使用了一个

oracle 12c 创建PDB用户即Local User (PDB与CDB)

Oracle 12C用户创建与表空间分配 数据库安装完成后,首先用系统用户链接数据库容器(CDB), 在数据库容器(CDB)中创建表空间‘imei’ SQL>create tablespace iemi datafile'E:\Oracle_DB\ cdb_iemi.dbf'size 10240m autoextend on next 200m; 表空间已创建. 接下来在Oracle 12C数据库中创建用户时会报ORA-65096错误. SQL> create user imei identi