Oracle 12c 新特性 --- RMAN DUPLICATE Enhancements

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

概念

This feature disables automatic opening of a recovered clone database so that you can perform any database setting changes before using the NOOPEN option. For example, you may want to modify block change tracking or Flashback Database settings before opening the clone database. This feature is also useful for upgrade scenarios where the database must not be open with RESETLOGS prior to running upgrade scripts.
该特性禁用了已恢复的克隆数据库的自动打开,以便在使用NOOPEN选项之前可以执行任何数据库设置更改。例如,在打开克隆数据库之前,您可能需要修改块更改跟踪或闪回数据库设置。这个特性对于升级场景也很有用,因为在运行升级脚本之前,数据库不需要打开RESETLOGS。

These enhancements provide additional flexibility during DUPLICATE and expand its use for upgrade scenarios. For example, the NOOPEN option allows DUPLICATE to create a new database as part of an upgrade procedure and leaves the database in a state ready for opening in upgrade mode and subsequent execution of upgrade scripts.

这些增强在重复的过程中提供了额外的灵活性,并扩展了对升级场景的使用。例如,NOOPEN选项允许重复创建一个新数据库,作为升级过程的一部分,并使数据库处于准备就绪的状态,以便在升级模式下打开,并随后执行升级脚本。

When you use the RMAN DUPLICATE command, the duplicate database is created and then opened in RESETLOGS mode. You can specify that the duplicate database must not be opened by using the NOOPEN clause in the DUPLICATE command.
当您使用RMAN副本命令时,将创建重复的数据库,然后在RESETLOGS模式中打开。您可以指定复制数据库不能在重复命令中使用NOOPEN子句来打开。
You may not want to open the duplicate database immediately after creation in the following situations:
在下列情况下,您可能不希望在创建后立即打开重复数据库:
•	Opening the duplicate database may cause errors.
•	•打开重复的数据库可能会导致错误。
•	You need to modify the initialization parameters of the duplicate database.
For example, you need to modify flashback database settings, configure fast incremental backups, or modify block change tracking.
•您需要修改复制数据库的初始化参数。
例如,您需要修改flashback数据库设置,配置快速增量备份,或者修改块更改跟踪
•	You are creating a new database as part of an upgrade procedure.
您正在创建一个新的数据库,作为升级过程的一部分。
During an upgrade you cannot open the database with RESETLOGS option. The NOOPEN clause enables you to duplicate the database and then leave it in a state ready for opening in upgrade mode and subsequent execution of upgrade scripts.
在升级过程中,您不能使用RESETLOGS选项打开数据库。NOOPEN子句允许您复制数据库,然后将其置于一个状态,以便在升级模式下打开,并随后执行升级脚本。

实验

说明:本实验是在Oracle 12.1.0.2.0 环境下测试12c R1的新特性。 

1) 准备环境,active database 搭建好的数据库,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/
2)可参照12c DG 搭建手册,配置active database ,auxiliary database,主要完成以下操作:
2.1 启动归档模式  
2.2 分别在主备库配置监听并启动 
2.3 在备库创建必要的目录 
2.4 在主库创建pfile 文件并修改pfile 内容 
2.5 将主库的口令文件copy到备库 
2.6 将主库的参数文件copy到备库并修改 
2.7 关闭防火墙
参考文档:
http://www.cndba.cn/leo1990/article/1935

3) 将 auxiliary database 启动到 nomount 状态

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

4)开始进行Active duplicate
[oracle@dg1 ~]$ rman target sys/oracle@pdbcndba_p auxiliary sys/oracle@pdbcndba_s;

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 11 14:46:30 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 TARGET DATABASE 
TO cndba
FROM ACTIVE DATABASE
NOOPEN
nofilenamecheck;

如果active database ,auxiliary database 数据库文件目录相同 是要加这个参数 nofilenamecheck ,否则报如下错误:
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/cndba/redo01.log conflicts with a file used by the target database

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=23 device type=DISK
current log archived

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

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                956305168 bytes
Database Buffers             587202560 bytes
Redo Buffers                  13848576 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_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

Oracle instance shut down

Oracle instance started

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size                956305168 bytes
Database Buffers             587202560 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:03
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

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  6 to 
 "/u01/app/oracle/oradata/cndba/users01.dbf";
   set newname for datafile  7 to 
 "/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf";
   set newname for datafile  8 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba/system01.dbf";
   set newname for datafile  9 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf";
   set newname for datafile  10 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba/pdbcndba_users01.dbf";
   set newname for datafile  11 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf";
   set newname for datafile  12 to 
 "/u01/app/oracle/oradata/cndba/users02.dbf";
   restore
   from service  'pdbcndba_p'   clone database
   ;
   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

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: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 00003 to /u01/app/oracle/oradata/cndba/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 00004 to /u01/app/oracle/oradata/cndba/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
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 00006 to /u01/app/oracle/oradata/cndba/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
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:55
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 00008 to /u01/app/oracle/oradata/cndba/pdbcndba/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 00009 to /u01/app/oracle/oradata/cndba/pdbcndba/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 00010 to /u01/app/oracle/oradata/cndba/pdbcndba/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 00011 to /u01/app/oracle/oradata/cndba/pdbcndba/test01.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 00012 to /u01/app/oracle/oradata/cndba/users02.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
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  3527302;
   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=121
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=122
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 11-AUG-17

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbcndba/system01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbcndba/pdbcndba_users01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=951749507 file name=/u01/app/oracle/oradata/cndba/users02.dbf

contents of Memory Script:
{
   set until scn  3527888;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 11-AUG-17
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 121 is already on disk as file /u01/archive1_121_951096249.dbf
archived log for thread 1 with sequence 122 is already on disk as file /u01/archive1_122_951096249.dbf
archived log file name=/u01/archive1_121_951096249.dbf thread=1 sequence=121
archived log file name=/u01/archive1_122_951096249.dbf thread=1 sequence=122
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                956305168 bytes
Database Buffers             587202560 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";
}
executing Memory Script

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

Total System Global Area    1560281088 bytes

Fixed Size                     2924784 bytes
Variable Size                956305168 bytes
Database Buffers             587202560 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/pdbcndba/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  3 to 
 "/u01/app/oracle/oradata/cndba/pdbcndba/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/users01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba/pdbcndba_users01.dbf", 
 "/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf", 
 "/u01/app/oracle/oradata/cndba/users02.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 3 to /u01/app/oracle/oradata/cndba/pdbcndba/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=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf RECID=2 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/users01.dbf RECID=3 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf RECID=4 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf RECID=5 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba/pdbcndba_users01.dbf RECID=6 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf RECID=7 STAMP=951749530
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/cndba/users02.dbf RECID=8 STAMP=951749530

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/undotbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=5 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/pdbcndba/pdbcndba_users01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=951749530 file name=/u01/app/oracle/oradata/cndba/users02.dbf
Leaving database unopened, as requested
Cannot remove created server parameter file
Finished Duplicate Db at 11-AUG-17

5)实验证明,参数NOOPEN 使得在DUPLICATE database 时 auxiliary database 启动到 mount ,需要执行升级脚步或者其他操作后手动启动。
SQL> conn /as sysdba
Connected.
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  MOUNTED
	 3 _###_UNKNOWN_PDB_#_3 	  MOUNTED
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1560281088 bytes
Fixed Size		    2924784 bytes
Variable Size		  956305168 bytes
Database Buffers	  587202560 bytes
Redo Buffers		   13848576 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open RESETLOGS;

Database altered.

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDBCNDBA			  MOUNTED

SQL> alter session set container=pdbcndba;

Session altered.

SQL> startup 
Pluggable Database opened.
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 3 PDBCNDBA			  READ WRITE NO
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

参考文档

http://docs.oracle.com/database/121/NEWFT/chapter12101.htm#NEWFT348

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

猜你喜欢

转载自blog.csdn.net/leo__1990/article/details/90032740
今日推荐