Oracle 12c 新特性 --- RMAN Duplicate PLUGGABLE DATABASE

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/leo__1990/article/details/89919874

2017-09-06 01:108470原创Oracle 12cRMAN编辑删除

本文链接:https://www.cndba.cn/leo1990/article/2213

概念

Active DUPLICATE uses a network-enabled restore method that is run on the auxiliary database to clone the source database. This is in contrast to the image copy-based approach that was run on the source database in previous releases. Active DUPLICATE supports the SECTION SIZE option to divide data files into subsections that are restored in parallel across multiple channels on the auxiliary database. Active DUPLICATE supports compression during the restore phase.
Active DUPLICATE使用在辅助数据库上运行的支持网络的恢复方法来克隆源数据库。这与之前版本中在源数据库上运行的基于图像的基于映像的方法形成了对比。Active DUPLICATE支持SECTION SIZE选项,将数据文件划分为在辅助数据库的多个通道上并行恢复的子部分。在恢复阶段,主动复制支持压缩

The benefits of this new feature include:
新特性的优点:

•	Reduce active duplicate time for databases with large data files by more evenly spreading out the restore workload across multiple channels on the auxiliary database.
通过在auxiliary database.的多个通道上更均匀地分布恢复工作负载,减少数据库与大数据文件的重复时间

•	Reduce active duplicate time by more efficiently using network bandwidth using compression during data transfer operations.
利用网络带宽减少复制的时间

In active database duplication, RMAN connects as TARGET to the source database instance and as AUXILIARY to the auxiliary instance. RMAN then manages the copying of the database to the auxiliary instance over the network. No backups of the source database are required.

RMAN can transfer the files required for active database duplication as image copies or backup sets. 

在active database复制中,RMAN将目标连接到源数据库实例,并作为auxiliary instance的辅助对象。然后RMAN将数据库的复制管理到网络上的auxiliary instance。不需要对源数据库进行备份。
RMAN可以将active databas复制所需的文件作为映像副本或备份集传输。

When duplicating a whole CDB or one more PDBs:
•	You must create the auxiliary instance as a CDB. To do so, start the instance with the following declaration in the initialization parameter file:
•	•必须创建auxiliary instance作为CDB。为此,在初始化参数文件中使用以下声明启动实例:
•	enable_pluggable_database=TRUE
•	When instructed to connect to the necessary instances, connect to the root as a user with SYSDBA or SYSBACKUP privilege. On both instances, the password for the user performing the duplication must be the same.
•当指示连接到必要的实例时,以SYSDBA或SYSBACKUP特权连接到root用户。在这两个实例中,执行复制的用户的密码必须相同。

•	When instructed to create an initialization parameter file for the auxiliary instance, you must copy the file from the source database. This ensures that the auxiliary instance is also a CDB. After copying, you modify DB_NAME and the various destination/location parameters

•当指示为auxiliary instance创建初始化参数文件时,必须从源数据库复制文件。这确保了辅助实例也是CDB。在复制之后,您可以修改DB_NAME和各种目的地/位置参数

实验

1 duplicate active database PLUGGABLE DATABASE 1.1 清理 auxiliary database 数据
mkdir -p /u01/app/oracle/admin/cndba/adump
mkdir -p /u01/app/oracle/admin/cndba/cdump
mkdir -p /u01/app/oracle/oradata/cndba/
rm -rf /u01/app/oracle/oradata/cndba/*
mkdir -p /u01/app/oracle/oradata/cndba/pdbseed/
mkdir -p /u01/app/oracle/oradata/cndba/pdbcndba/
mkdir -p /u01/app/oracle/oradata/cndba/pdbcndba2/

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup nomount pfile='/u01/app/oracle/product/12.1.0/db_1/dbs/initcndba.ora';
ORACLE instance started.

Total System Global Area 1560281088 bytes
Fixed Size		    2924784 bytes
Variable Size		  939527952 bytes
Database Buffers	  603979776 bytes
Redo Buffers		   13848576 bytes

1.2 开始 auxiliary

[www.cndba.cn@dg1 admin]$ rman target sys/oracle@pdbcndba_p auxiliary sys/oracle@pdbcndba_s;

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 11 16:22:01 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CNDBA (DBID=215559030)
connected to auxiliary database: CNDBA (not mounted)

RMAN> DUPLICATE DATABASE TO cndba PLUGGABLE DATABASE pdbcndba2
  FROM ACTIVE DATABASE
  SPFILE
  NOFILENAMECHECK;2> 3> 4> 

Starting Duplicate Db at 11-AUG-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=24 device type=DISK
current log archived

contents of Memory Script:
{
   restore clone from service  'pdbcndba_p' spfile to 
 '/u01/app/oracle/product/12.1.0/db_1/dbs/spfilecndba.ora';
   sql clone "alter system set spfile= ''/u01/app/oracle/product/12.1.0/db_1/dbs/spfilecndba.ora''";
}
executing Memory Script

Starting restore at 11-AUG-17
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/oracle/product/12.1.0/db_1/dbs/spfilecndba.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 11-AUG-17

sql statement: alter system set spfile= ''/u01/app/oracle/product/12.1.0/db_1/dbs/spfilecndba.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CNDBA'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''CNDBA'' comment=
 ''duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''CNDBA'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''CNDBA'' comment= ''duplicate'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size               1006636816 bytes
Database Buffers             536870912 bytes
Redo Buffers                  13848576 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CNDBA'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''CNDBA'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'pdbcndba_p' primary controlfile;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''CNDBA'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''CNDBA'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size               1006636816 bytes
Database Buffers             536870912 bytes
Redo Buffers                  13848576 bytes

Starting restore at 11-AUG-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=21 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/app/oracle/oradata/cndba/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/cndba/control02.ctl
Finished restore at 11-AUG-17

database mounted
Skipping pluggable database PDBCNDBA
Automatically adding tablespace SYSTEM
Automatically adding tablespace SYSAUX
Automatically adding tablespace PDB$SEED:SYSTEM
Automatically adding tablespace PDB$SEED:SYSAUX
Automatically adding tablespace UNDOTBS1
Skipping tablespace USERS
RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT

contents of Memory Script:
{
   set newname for datafile  1 to 
 "/u01/app/oracle/oradata/cndba/system01.dbf";
   set newname for datafile  3 to 
 "/u01/app/oracle/oradata/cndba/sysaux01.dbf";
   set newname for datafile  4 to 
 "/u01/app/oracle/oradata/cndba/undotbs01.dbf";
   set newname for datafile  5 to 
 "/u01/app/oracle/oradata/cndba/pdbseed/system01.dbf";
   set newname for datafile  7 to 
 "/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf";
   set newname for datafile  17 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/system01.dbf";
   set newname for datafile  18 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf";
   set newname for datafile  19 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf";
   set newname for datafile  20 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf";
   restore
   from service  'pdbcndba_p'   clone database
   skip forever tablespace  "USERS",
 "PDBCNDBA":"USERS",
 "PDBCNDBA":"TEST",
 "PDBCNDBA":"SYSTEM",
 "PDBCNDBA":"SYSAUX"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 11-AUG-17
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/cndba/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:46
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/cndba/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/cndba/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/cndba/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00017 to /u01/app/oracle/oradata/cndba/pdbcndba2/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00018 to /u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00019 to /u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00020 to /u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 11-AUG-17

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'pdbcndba_p' 
           archivelog from scn  3541202;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 11-AUG-17
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=125
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service pdbcndba_p
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=126
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 11-AUG-17

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbseed/system01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=8 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=9 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/system01.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=10 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=11 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=12 STAMP=951755205 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf

contents of Memory Script:
{
   set until scn  3541866;
   recover
   clone database
   skip forever tablespace  "USERS",
 "PDBCNDBA":"USERS",
 "PDBCNDBA":"TEST",
 "PDBCNDBA":"SYSTEM",
 "PDBCNDBA":"SYSAUX"    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 11-AUG-17
using channel ORA_AUX_DISK_1

Executing: alter database datafile 6 offline drop
Executing: alter database datafile 12 offline drop
Executing: alter database datafile 10 offline drop
Executing: alter database datafile 11 offline drop
Executing: alter database datafile 8 offline drop
Executing: alter database datafile 9 offline drop
starting media recovery

archived log for thread 1 with sequence 125 is already on disk as file /u01/app/oracle/product/12.1.0/db_1/dbs/arch1_125_951096249.dbf
archived log for thread 1 with sequence 126 is already on disk as file /u01/app/oracle/product/12.1.0/db_1/dbs/arch1_126_951096249.dbf
archived log file name=/u01/app/oracle/product/12.1.0/db_1/dbs/arch1_125_951096249.dbf thread=1 sequence=125
archived log file name=/u01/app/oracle/product/12.1.0/db_1/dbs/arch1_126_951096249.dbf thread=1 sequence=126
media recovery complete, elapsed time: 00:00:01
Finished recover at 11-AUG-17
Oracle instance started

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size               1006636816 bytes
Database Buffers             536870912 bytes
Redo Buffers                  13848576 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CNDBA'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''CNDBA'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size               1006636816 bytes
Database Buffers             536870912 bytes
Redo Buffers                  13848576 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CNDBA" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '/u01/app/oracle/oradata/cndba/redo01.log' ) SIZE 50 M  REUSE,
  GROUP   2 ( '/u01/app/oracle/oradata/cndba/redo02.log' ) SIZE 50 M  REUSE,
  GROUP   3 ( '/u01/app/oracle/oradata/cndba/redo03.log' ) SIZE 50 M  REUSE
 DATAFILE
  '/u01/app/oracle/oradata/cndba/system01.dbf',
  '/u01/app/oracle/oradata/cndba/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/cndba/pdbcndba2/system01.dbf'
 CHARACTER SET ZHS16GBK


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/u01/app/oracle/oradata/cndba/temp01.dbf";
   set newname for tempfile  2 to 
 "/u01/app/oracle/oradata/cndba/pdbseed/pdbseed_temp012017-08-04_01-25-27-AM.dbf";
   set newname for tempfile  4 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/temp012017-08-04_01-25-27-AM.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/cndba/sysaux01.dbf", 
 "/u01/app/oracle/oradata/cndba/undotbs01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/cndba/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/cndba/pdbseed/pdbseed_temp012017-08-04_01-25-27-AM.dbf in control file
renamed tempfile 4 to /u01/app/oracle/oradata/cndba/pdbcndba2/temp012017-08-04_01-25-27-AM.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/sysaux01.dbf RECID=1 STAMP=951755229
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf RECID=2 STAMP=951755229
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf RECID=3 STAMP=951755229
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf RECID=4 STAMP=951755229
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf RECID=5 STAMP=951755229
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf RECID=6 STAMP=951755229

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=3 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=4 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/sysaux01.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=5 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/pdbcndba_users01.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=6 STAMP=951755229 file name=/u01/app/oracle/oradata/cndba/pdbcndba2/test01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Executing: drop pluggable database "PDBCNDBA" including datafiles

contents of Memory Script:
{
   sql clone "alter pluggable database all open";
}
executing Memory Script

sql statement: alter pluggable database all open
Dropping offline and skipped tablespaces
Executing: alter database default tablespace system
Executing: drop tablespace "USERS" including contents cascade constraints
Finished Duplicate Db at 11-AUG-17

	 
1.3 验证数据
--target database	 
SQL> conn /as sysdba
Connected.
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  	  READ ONLY  NO
	 3 PDBCNDBA			      READ WRITE NO
	 4 PDBCNDBA2			  READ WRITE NO
 
SQL> test/test@pdbcndba2
Connected.
SQL> select * from test;

	ID
----------
	 1
	 2


--auxiliary database 	 
SQL> conn /as sysdba
Connected.
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			      READ ONLY  NO
	 4 PDBCNDBA2			  READ WRITE NO

	 
[www.cndba.cn@dg2 ~]$ sqlplus "test/test@pdbcndba2"

SQL*Plus: Release 12.1.0.2.0 Production on Fri Aug 11 16:43:14 2017

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

Last Successful login time: Fri Aug 11 2017 15:58:26 +08: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> select * from test;

	ID
----------
	 1
	 2

参考文档

http://docs.oracle.com/database/121/BRADV/rcmdupdb.htm#BRADV010

猜你喜欢

转载自blog.csdn.net/leo__1990/article/details/89919874