1. 如何知道一个12c DB是否为容器数据库?
(1) container DB
SQL> select cdb from v$database;
CDB
---
YES

(2) non container DB
SQL> select cdb from v$database;
CDB
---
NO

2. 如何查看所有PDB?
SQL> select name, open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY <===== this is a seed PDB
PDBORCL MOUNTED <===== this is a PDB at mount status
PDB1 READ WRITE <===== this is a PDB at read/write open status

3. 如何打开一个PDB?
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT

SQL> alter session set container=PDBORCL;
Session altered.

SQL> show con_name <==== 查看当前的DB会话
CON_NAME
------------------------------
PDBORCL

SQL> alter database PDBORCL open;
Database altered.

SQL> select name, open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDBORCL READ WRITE

4. 如何在服务上列出所有PDB(包括CDB)?
(1) 在CDB根会话中
SQL> connect /as sysdba
Connected.
SQL> select NAME,CON_ID,PDB from v$services;
NAME CON_ID PDB
----------------------------------- ---------- ------------------------------
pdb1 4 PDB1
pdborcl 3 PDBORCL
orclXDB 1 CDB$ROOT
orcl 1 CDB$ROOT
SYS$BACKGROUND 1 CDB$ROOT
SYS$USERS 1 CDB$ROOT
(注:只读的PDB$SEED未在此列出)

(2) 在PDB会话中
SQL> alter session set container=PDBORCL;
Session altered.

SQL> select NAME,CON_ID,PDB from v$services;
NAME CON_ID PDB
----------------------------------- ---------- ------------------------------
pdborcl 3 PDBORCL

5. 如何直接连接到一个PDB,而不是通过'alter session set container'?
[oracle@ffzhang-linux ~]$ sqlplus pdb1_u1/pdb1_u1@pdb1
SQL*Plus: Release 12.1.0.1.0 Production on Thu Dec 19 12:03:14 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Thu Dec 19 2013 12:02:49 -08:00
Connected to:
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> show con_name
CON_NAME
------------------------------
PDB1

6. 如何创建一个给OGG extract使用的CDB用户?
SQL> connect /as sysdba
Connected.

SQL> create user C##GGADMIN identified by ggadmin;
User created.

SQL> exec dbms_goldengate_auth.grant_admin_privilege('C##GGADMIN',container=>'ALL');
PL/SQL procedure successfully completed.

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

注意:密码可能区分大小写:
SQL> connect C##GGADMIN/GGADMIN
ERROR:
ORA-01017: invalid username/password; logon denied
SQL> connect C##GGADMIN/ggadmin
Connected.
SQL> connect c##ggadmin/ggadmin
Connected.

因此,在extract/replicat参数文件中,密码的大小写也应该一致。
如, userid c##ggadmin, password ggadmin

7. 下面是一个extract示例和简单的测试
(1) 参数文件
extract e1
userid c##ggadmin, password ggadmin
exttrail ./dirdat/e1
ddl include mapped
ddloptions report
sequence pdb1.pdb1_u1.*;
table pdborcl.pdborcl_u1.*;
table pdb1.pdb1_u1.s1;

(2) 配置 (CDB中只能使用集成抽取数据)
GGSCI  31> dblogin userid c##ggadmin, password ggadmin
Successfully logged into database CDB$ROOT.

GGSCI  32> add extract e1, integrated tranlog, begin now
EXTRACT added.

GGSCI  33> add exttrail ./dirdat/e1, extract e1
EXTTRAIL added.

GGSCI  37> REGISTER EXTRACT e1 DATABASE CONTAINER (pdborcl, pdb1)
Extract E1 successfully registered with database at SCN 2664333.

SQL> select CAPTURE_NAME,CAPTURE_USER,STATUS,START_SCN,PURPOSE from dba_capture;
CAPTURE_NAME CAPTURE_USER STATUS START_SCN PURPOSE
----------------- ------------------ -------- ---------- -------------------
OGG$CAP_E1 C##GGADMIN ENABLED 2664333 GoldenGate Capture

(3) 测试
SQL> connect pdb1_u1/pdb1_u1@pdb1
Connected.
1) DML
SQL> insert into s1 values (1,1);
1 row created.
SQL> commit;
Commit complete.

2) DDL
SQL> create sequence ss1;
Sequence created.

3) Sequence
SQL> select ss1.nextval from dual;
NEXTVAL
----------
1
SQL> select ss1.nextval from dual;
NEXTVAL
----------
2

ggsci> send e1 report
from report file
....
From Table PDB1.PDB1_U1.S1:
# inserts: 1
# updates: 0
# deletes: 0
# discards: 0
From Sequence PDB1.PDB1_U1.SS1:
# updates: 1
# discards: 0

DDL replication statistics:

Operations: 1
Mapped operations: 1
Unmapped operations: 0
Other operations: 0
Excluded operations: 0

8. replicat中OGG用户可以连接到cdb root不?
不行,replicat中OGG投递用户只允许连接到一个PDB中。
如:userid pdb1_u1@pdb1, password pdb1_u1

9. 如何复制sequence到目标端?
需要在两端执行:sequence.sql,具体步骤,可参考ogg for oracle.pdf文档中<Installing Support for Oracle Sequences>

Oracle 12c与GoldenGate 12c的一些问答的更多相关文章

  1. Oracle GoldenGate 12c实时捕获SQL Server数据

    在Oracle GoldenGate 12c中,对一些最新的数据库提供了支持,比如SQL Server 2012/2014,当然12c也支持sql server 2008.主要新增特性有: 捕获进程可 ...

  2. GoldenGate 12c + Oracle 12c Multitenant Container databases

    下面为GoldenGate 12c + Oracle 12c Multitenant Container databases例子 1.安装OGG 源 端OGG: C:\Oracle\product\1 ...

  3. 异构GoldenGate 12c 双向复制配置

    1.配置window,添加checkpoint表(本文windows和linux互为source和target) GGSCI (WIN-GM5PVS1CILH) 1> view param ./ ...

  4. oracle官方文档12c对应关系

    ADDCI Oracle® Database Data Cartridge Developer's Guide 12c Release 1 (12.1) E15882-05 ADFNS Oracle® ...

  5. Oracle Service Bus (OSB) 12c 的配置安装

    Oracle Service Bus (OSB) 12c 的配置安装 1.OSB配置环境: Oracle Database Oracle Fusion Middleware Infrastructur ...

  6. GoldenGate 12c 新特性 Credential Store and USERIDALIAS

    GoldenGate 12C的Credential Store and USERIDALIAS新特性有点类似存储钱夹,提高了配置的易用性和安全性. --生成credentialstore文件 GGSC ...

  7. Linux 6.3下安装Oracle Enterprise Cloud Control 12c

    Oracle enterprise cloud control 12c的安装是一个比較复杂的过程,由于他须要依赖于Oracel database以及Oracle Weblogic. 如今Oracle已 ...

  8. 12c debug 转 12C 连接CDB和PDB

    来源:David Dai -- Focus on Oracle 连接到CDB 12c debug 和普通实例一样的连接. 指定ORACLE_SID 以后可以使用OS认证,也可以使用密码进行连接. [o ...

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

    由于oracle 12c已经是多租户架构,在使用OGG同步的时候,需要考虑下面一些情况 一个 CDB包含多个PDB,源端部署的一个extract可访问所有pdb redo,理论上不需要每个pdb单独配 ...

随机推荐

  1. opencl gauss filter优化(二)

    1.buffer使用image的方式:Horizontal 与 Vertical 算法一样, 共需30ms,wait time 19ms. const sampler_t sampler = CLK_ ...

  2. 最牛B的编码套路(转)

    转自:http://blog.csdn.net/happydeer/article/details/17023229 最近,我大量阅读了Steve Yegge的文章.其中有一篇叫"Pract ...

  3. 决策树原理、Scikit-learn实现及其在生物信息中的应用

    之前转过一篇文章:2016年GitHub排名前20的Python机器学习开源项目(转),说明现在已经有了很多很好的机器学习的包,我们不必从底层开始实现,只要懂点算法.会看文档,一般人也能玩好机器学习. ...

  4. toolbar

    toolbar= (Toolbar) findViewById(R.id.toolbar_mainactivity); // 设置主标题及其颜色 toolbar.setTitle("Andr ...

  5. 【bzoj1025】游戏

    [bzoj1025]游戏 题意 windy学会了一种游戏.对于1到N这N个数字,都有唯一且不同的1到N的数字与之对应.最开始windy把数字按顺序1,2,3,--,N写一排在纸上.然后再在这一排下面写 ...

  6. 微信JS SDK Demo 官方案例

    微信JS-SDK是微信公众平台面向网页开发者提供的基于微信内的网页开发工具包. 通过使用微信JS-SDK,网页开发者可借助微信高效地使用拍照.选图.语音.位置等手机系统的能力,同时可以直接使用微信分享 ...

  7. js鼠标拖拽

    html <div id="box"> </div> css ;;} #box{width:200px;height:200px;background:cy ...

  8. Mybatis 学习-4

    Category与Article双向一对多关联 (1)将CategoryDao进行实现 public class CategoryDaoImpl extends BaseDao<Category ...

  9. java二维数组简单初步理解

    二维数组 二维数组本质上是以数组作为数组元素的数组,即“数组的数组”. int[][] arr = {{1, 2, 3}, {4, 5, 6}}; System.out.println(arr[0][ ...

  10. poj1651

    Multiplication Puzzle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7252   Accepted:  ...