从Oracle 18c开始,可以Duplicating一个新的CDB数据库

举报
小麦苗DB宝 发表于 2022/04/01 16:12:55 2022/04/01
【摘要】 1、新建一个容器(可以当做一个新主机) 2、创建CDB2的spfile和密码文件,启动到nomount阶段 3、执行复制 4、查看目标数据库 5、注意事项之前的3篇:【DB宝24】在Oracle 19c中创建容器数据库(1)–DBCA静默创建CDB【DB宝25】在Oracle 19c中创建容器数据库(2)–DBCA图形化创建CDB【DB宝26】在Oracle 19c中创建容器数据库(3)–...

之前的3篇:

【DB宝24】在Oracle 19c中创建容器数据库(1)–DBCA静默创建CDB

【DB宝25】在Oracle 19c中创建容器数据库(2)–DBCA图形化创建CDB

【DB宝26】在Oracle 19c中创建容器数据库(3)–手动创建CDB

这是Oracle OCP给出的一个duplicating a CDB的一般步骤:

从Oracle 18c开始,我们可以在rman中直接使用duplicate来复制一个cdb,下边给出一个示例:

环境介绍

源库 目标库
IP地址 172.17.0.3 172.17.0.2
主机名 ocp19c lhr2019ocp
存储方式 FS FS
ORACLE_SID、DB_NAME ORCLCDB CDB2
归档模式 Yes Yes

1、新建一个容器(可以当做一个新主机)

-- 新建一个容器
docker rm -f ocp19c
docker run -itd -h ocp19c --name ocp19c \
-p 222:22 -p 1521:1521 -p 5500:5500 -p 5501:5501 \
--privileged=true \
lhrbest/oracle19clhr_rpm_db  /usr/sbin/init

-- 进入容器
docker exec -it ocp19c bash

2、创建CDB2的spfile和密码文件,启动到nomount阶段

-- 1、创建密码文件
orapwd file=$ORACLE_HOME/dbs/orapwCDB2 force=y format=12 password=lhr

-- 2、创建CDB2的数据文件存储路径
mkdir -p /opt/oracle/oradata/CDB2/

-- 3、创建pfile文件
cat > /home/oracle/a.txt <<"EOF"

db_name='CDB2'
compatible='19.0.0'
control_files='/opt/oracle/oradata/CDB2/control01.ctl','/opt/oracle/oradata/CDB2/control02.ctl'
enable_pluggable_database=true
sga_target=1024m
log_archive_dest_1='location=/opt/oracle/oradata/CDB2/'
DB_FILE_NAME_CONVERT=(/opt/oracle/oradata/ORCLCDB/,/opt/oracle/oradata/CDB2/)
LOG_FILE_NAME_CONVERT=(/opt/oracle/oradata/ORCLCDB/,/opt/oracle/oradata/CDB2/)

EOF

-- 4、创建spfile文件并且启动到nomount阶段
export ORACLE_SID=CDB2
sqlplus / as sysdba
create spfile from pfile='/home/oracle/a.txt';
startup nomount;

启动过程:

[oracle@ocp19c ~]$ sas

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 20 20:27:42 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SYS@CDB2> create spfile from pfile='/home/oracle/a.txt';

File created.

SYS@CDB2> startup nomount;
ORACLE instance started.

Total System Global Area 1073739248 bytes
Fixed Size                  9143792 bytes
Variable Size             293601280 bytes
Database Buffers          763363328 bytes
Redo Buffers                7630848 bytes
SYS@CDB2> 

3、执行复制

推荐写法:

-- 连接到源库和目标库
rman target sys/lhr@tns_ORCLCDB auxiliary sys/lhr@tns_CDB2
或
rman target sys/lhr@172.17.0.3:1521/ORCLCDB  auxiliary sys/lhr

-- 执行复制
DUPLICATE TARGET DATABASE TO CDB2 FROM ACTIVE DATABASE DB_FILE_NAME_CONVERT ('ORCLCDB', 'CDB2');

注意:需要保证使用sqlplus可以正常连接到源库和目标库。

执行过程日志:

[oracle@lhr2019ocp ~]$ rman target sys/lhr@172.17.0.3:1521/ORCLCDB  auxiliary sys/lhr

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Aug 20 20:52:45 2020
Version 19.3.0.0.0

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

connected to target database: ORCLCDB (DBID=2814923791)
connected to auxiliary database: CDB2 (not mounted)

RMAN> DUPLICATE TARGET DATABASE TO CDB2 FROM ACTIVE DATABASE DB_FILE_NAME_CONVERT ('ORCLCDB', 'CDB2');

Starting Duplicate Db at 2020-08-20 20:53:07
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=661 device type=DISK
current log archived

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

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area    1073739248 bytes

Fixed Size                     9143792 bytes
Variable Size                293601280 bytes
Database Buffers             763363328 bytes
Redo Buffers                   7630848 bytes

Starting restore at 2020-08-20 20:53:39
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=399 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/opt/oracle/oradata/CDB2/control01.ctl
output file name=/opt/oracle/oradata/CDB2/control02.ctl
Finished restore at 2020-08-20 20:53:43

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to 
 "/opt/oracle/oradata/CDB2/system01.dbf";
   set newname for datafile  3 to 
 "/opt/oracle/oradata/CDB2/sysaux01.dbf";
   set newname for datafile  4 to 
 "/opt/oracle/oradata/CDB2/undotbs01.dbf";
   set newname for datafile  5 to 
 "/opt/oracle/oradata/CDB2/pdbseed/system01.dbf";
   set newname for datafile  6 to 
 "/opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf";
   set newname for datafile  7 to 
 "/opt/oracle/oradata/CDB2/users01.dbf";
   set newname for datafile  8 to 
 "/opt/oracle/oradata/CDB2/pdbseed/undotbs01.dbf";
   set newname for datafile  9 to 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/system01.dbf";
   set newname for datafile  10 to 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.dbf";
   set newname for datafile  11 to 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf";
   set newname for datafile  12 to 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf";
   restore
   from  nonsparse   from service 
 '172.17.0.3:1521/ORCLCDB'   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 2020-08-20 20:53:48
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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /opt/oracle/oradata/CDB2/system01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/oracle/oradata/CDB2/sysaux01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /opt/oracle/oradata/CDB2/undotbs01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /opt/oracle/oradata/CDB2/pdbseed/system01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /opt/oracle/oradata/CDB2/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /opt/oracle/oradata/CDB2/pdbseed/undotbs01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /opt/oracle/oradata/CDB2/ORCLPDB1/system01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2020-08-20 20:54:12

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  '172.17.0.3:1521/ORCLCDB' 
           archivelog from scn  2547761;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 2020-08-20 20:54:12
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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=11
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 172.17.0.3:1521/ORCLCDB
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2020-08-20 20:54:15

datafile 1 switched to datafile copy
input datafile copy RECID=15 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=18 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=19 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=21 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=22 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=23 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=24 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=25 STAMP=1048971255 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf

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

executing command: SET until clause

Starting recover at 2020-08-20 20:54:15
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 11 is already on disk as file /opt/oracle/oradata/CDB2/1_11_1043862417.dbf
archived log for thread 1 with sequence 12 is already on disk as file /opt/oracle/oradata/CDB2/1_12_1043862417.dbf
archived log file name=/opt/oracle/oradata/CDB2/1_11_1043862417.dbf thread=1 sequence=11
archived log file name=/opt/oracle/oradata/CDB2/1_12_1043862417.dbf thread=1 sequence=12
media recovery complete, elapsed time: 00:00:01
Finished recover at 2020-08-20 20:54:17

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=628 device type=DISK
deleted archived log
archived log file name=/opt/oracle/oradata/CDB2/1_11_1043862417.dbf RECID=1 STAMP=1048971253
deleted archived log
archived log file name=/opt/oracle/oradata/CDB2/1_12_1043862417.dbf RECID=2 STAMP=1048971254
Deleted 2 objects

Oracle instance started

Total System Global Area    1073739248 bytes

Fixed Size                     9143792 bytes
Variable Size                293601280 bytes
Database Buffers             763363328 bytes
Redo Buffers                   7630848 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CDB2'' 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 =  ''CDB2'' 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    1073739248 bytes

Fixed Size                     9143792 bytes
Variable Size                293601280 bytes
Database Buffers             763363328 bytes
Redo Buffers                   7630848 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CDB2" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/opt/oracle/oradata/CDB2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/opt/oracle/oradata/CDB2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/opt/oracle/oradata/CDB2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/opt/oracle/oradata/CDB2/system01.dbf',
  '/opt/oracle/oradata/CDB2/pdbseed/system01.dbf',
  '/opt/oracle/oradata/CDB2/ORCLPDB1/system01.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/opt/oracle/oradata/CDB2/temp01.dbf";
   set newname for tempfile  2 to 
 "/opt/oracle/oradata/CDB2/pdbseed/temp012020-06-23_09-54-06-505-AM.dbf";
   set newname for tempfile  3 to 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/opt/oracle/oradata/CDB2/sysaux01.dbf", 
 "/opt/oracle/oradata/CDB2/undotbs01.dbf", 
 "/opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf", 
 "/opt/oracle/oradata/CDB2/users01.dbf", 
 "/opt/oracle/oradata/CDB2/pdbseed/undotbs01.dbf", 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.dbf", 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf", 
 "/opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /opt/oracle/oradata/CDB2/temp01.dbf in control file
renamed tempfile 2 to /opt/oracle/oradata/CDB2/pdbseed/temp012020-06-23_09-54-06-505-AM.dbf in control file
renamed tempfile 3 to /opt/oracle/oradata/CDB2/ORCLPDB1/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/sysaux01.dbf RECID=1 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/undotbs01.dbf RECID=2 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf RECID=3 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/users01.dbf RECID=4 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/pdbseed/undotbs01.dbf RECID=5 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.dbf RECID=6 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf RECID=7 STAMP=1048971282
cataloged datafile copy
datafile copy file name=/opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf RECID=8 STAMP=1048971282

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/undotbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/pdbseed/undotbs01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=1048971282 file name=/opt/oracle/oradata/CDB2/ORCLPDB1/users01.dbf

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

database opened

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

sql statement: alter pluggable database all open
Finished Duplicate Db at 2020-08-20 20:54:58

RMAN> exit


Recovery Manager complete.
[oracle@lhr2019ocp ~]$ 

4、查看目标数据库

[oracle@lhr2019ocp ~]$ sas

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 20 20:55:05 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS@CDB2> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB1                       READ WRITE NO
SYS@CDB2>

5、注意事项

1、源库必须是归档模式
2、源库执行备份(backup database)不能报错

本文结束。

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。