RMAN duplicate搭建辅助数据库

RMAN duplicate搭建辅助数据库

使用RMAN DUPLICATE命令可以在保留目标数据库的基础上依靠目标数据库(TargetDatabase)的备份创建一个副本数据库(DuplicateDatabase),目标数据库和辅助数据库可以在同一台机器上,辅助数据库是目标数据库的一个拷贝。

复制新库步骤
1)将辅助库上安装数据库软件,不建库,建立Oracle Home
2)为辅助库建立口令文件,Active方式下与源数据库口令相同
3)确保到辅助实例的网络连通性(辅助库建立静态监听)
4)为辅助实例创建参数文件
5)以nomount方式启动辅助实例(启动静态监听)
6)生产数据库处于mount或open模式下
7)创建备份或将备份和归档日志文件复制到辅助库实例可以访问的某个位置,或者使用活动(active)数据库复制
8)如果有必要分配辅助通道
9)运行rman duplicate命令
10)使用resetlogs打开辅助数据库
duplicate是个不完全恢复,因为current log没有办法通过RMAN备份

实战演示:
数据库ASM - > ASM

配置本地新数据库的环境:

export ORACLE_SID=newdkf
vi /tmp/initnewdkf.ora
*.db_name='newdkf'
*.enable_pluggable_database=true

配置本地新数据库的密码文件:

[oracle@dkf dbs]$ ls -al orapw*
-rw-r----- 1 oracle oinstall 2048 Apr  4  2022 orapwdkf006
-rw-r----- 1 oracle oinstall 2048 Mar 18 19:09 orapwnewdkf
[oracle@dkf dbs]$ 

启动新的目标数据库:

SQL> startup nomount pfile='/tmp/initnewdkf.ora'
ORACLE instance started.

Total System Global Area  297795128 bytes
Fixed Size                  9133624 bytes
Variable Size             234881024 bytes
Database Buffers           50331648 bytes
Redo Buffers                3448832 bytes
SQL> 

配置静态监听:

[oracle@dkf admin]$ cat listener.ora 
dkf=
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.19)(PORT = 1522))
)

SID_LIST_dkf=
    (SID_LIST =
        (SID_DESC =
            (GLOBAL_DBNAME = dkf006)
            (ORACLE_HOME =/u01/app/oracle/product/19.3.0/dbhome_1)
            (SID_NAME = dkf006)
        )
        (SID_DESC =
            (GLOBAL_DBNAME = newdkf)
            (ORACLE_HOME =/u01/app/oracle/product/19.3.0/dbhome_1)
            (SID_NAME = newdkf)
        )
    )

监听状态

[oracle@dkf admin]$ lsnrctl start dkf

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-MAR-2023 19:15:09

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

Starting /u01/app/oracle/product/19.3.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dkf/dkf/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.19)(PORT=1522)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.19)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     dkf
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                18-MAR-2023 19:15:09
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/dkf/dkf/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.19)(PORT=1522)))
Services Summary...
Service "dkf006" has 1 instance(s).
  Instance "dkf006", status UNKNOWN, has 1 handler(s) for this service...
Service "newdkf" has 1 instance(s).
  Instance "newdkf", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

连接现有数据库和目标数据库实例:

 rman target sys/oracle auxiliary sys/oracle@newdkf

通过duplicate target database 命令创建新的数据库;

RMAN通过网络(active方式)在本地复制用于新的数据库,
如果duplicate在复制时,位置不同的时候,我们会用參数db_file_name_convert 对文件位置进行转换, 本地复制样例中我们用的是同样的位置, 所以这里必须加上nofilenamecheck參数,该參数通知复制操作不必在运行还原操作前确认文件名称是不同的,如果没有指定nofilenamecheck參数,rman会给出例如以下错误:

RMAN-05001: auxiliary filename  /DBSoft/oracle/oradata/woo/users01.dbf conflicts with a file used by the target database

数据库duplicate日志输出:

[oracle@dkf admin]$ rman target sys/oracle auxiliary sys/oracle@newdkf

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Mar 18 19:20:59 2023
Version 19.3.0.0.0

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

connected to target database: DKF006 (DBID=2651711443)
connected to auxiliary database: NEWDKF (not mounted)
RMAN> 
RMAN> duplicate target database to newdkf from active database nofilenamecheck;

Starting Duplicate Db at 2023:03:1819:21:12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=40 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     297795128 bytes

Fixed Size                     9133624 bytes
Variable Size                234881024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3448832 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''DKF006'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''newdkf'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/app/oracle/product/19.3.0/dbhome_1/dbs/cntrlnewdkf.dbf';
   alter clone database mount;
}
executing Memory Script

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area     297795128 bytes

Fixed Size                     9133624 bytes
Variable Size                234881024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3448832 bytes

Starting backup at 2023:03:1819:22:26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/awrdump/snapcf_%f tag=TAG20230318T192226
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2023:03:1819:22:27

database mounted
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DATAFILE/system.257.1101088487 conflicts with a file used by the target database
RMAN-05529: warning: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DATAFILE/sysaux.258.1101088521 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DATAFILE/undotbs1.259.1101088537 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.266.1101088791 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.267.1101088791 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DATAFILE/users.260.1101088537 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.268.1101088791 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/system.272.1101089437 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.273.1101089437 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.271.1101089437 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.275.1101089451 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DATAFILE/test.280.1107398373 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.281.1131796673 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name +DATA/DKF006/TEMPFILE/temp.265.1101088603 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name +DATA/DKF006/DBCED86261CB7148E0550A002762E1A4/TEMPFILE/temp.269.1101088829 conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name +DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/TEMPFILE/temp.274.1101089439 conflicts with a file used by the target database

contents of Memory Script:
{
   set newname for datafile  1 to 
 "+DATA";
   set newname for datafile  3 to 
 "+DATA";
   set newname for datafile  4 to 
 "+DATA";
   set newname for datafile  5 to 
 "+DATA";
   set newname for datafile  6 to 
 "+DATA";
   set newname for datafile  7 to 
 "+DATA";
   set newname for datafile  8 to 
 "+DATA";
   set newname for datafile  9 to 
 "+DATA";
   set newname for datafile  10 to 
 "+DATA";
   set newname for datafile  11 to 
 "+DATA";
   set newname for datafile  12 to 
 "+DATA";
   set newname for datafile  13 to 
 "+DATA";
   set newname for datafile  14 to 
 "+DATA";
   backup as copy reuse
   datafile  1 auxiliary format 
 "+DATA"   datafile 
 3 auxiliary format 
 "+DATA"   datafile 
 4 auxiliary format 
 "+DATA"   datafile 
 5 auxiliary format 
 "+DATA"   datafile 
 6 auxiliary format 
 "+DATA"   datafile 
 7 auxiliary format 
 "+DATA"   datafile 
 8 auxiliary format 
 "+DATA"   datafile 
 9 auxiliary format 
 "+DATA"   datafile 
 10 auxiliary format 
 "+DATA"   datafile 
 11 auxiliary format 
 "+DATA"   datafile 
 12 auxiliary format 
 "+DATA"   datafile 
 13 auxiliary format 
 "+DATA"   datafile 
 14 auxiliary format 
 "+DATA"   ;
   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

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 2023:03:1819:22:37
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00013 name=+DATA/DKF006/DATAFILE/test.280.1107398373
output file name=+DATA/NEWDKF/DATAFILE/test.286.1131823357 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00010 name=+DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.273.1101089437
output file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.285.1131823373 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/DKF006/DATAFILE/sysaux.258.1101088521
output file name=+DATA/NEWDKF/DATAFILE/sysaux.284.1131823381 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/DKF006/DATAFILE/system.257.1101088487
output file name=+DATA/NEWDKF/DATAFILE/system.283.1131823383 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=+DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.271.1101089437
output file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.282.1131823387 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/DKF006/DATAFILE/undotbs1.259.1101088537
output file name=+DATA/NEWDKF/DATAFILE/undotbs1.289.1131823391 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.267.1101088791
output file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/sysaux.288.1131823393 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00009 name=+DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/system.272.1101089437
output file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/system.287.1131823397 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.266.1101088791
output file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/system.294.1131823397 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=+DATA/DKF006/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.268.1101088791
output file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/undotbs1.293.1131823401 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00014 name=+DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.281.1131796673
output file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.292.1131823403 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=+DATA/DKF006/DATAFILE/users.260.1101088537
output file name=+DATA/NEWDKF/DATAFILE/users.291.1131823403 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00012 name=+DATA/DKF006/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.275.1101089451
output file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.290.1131823405 tag=TAG20230318T192237
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2023:03:1819:23:25

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/app/oracle/arch/1_167_1101088597.arch" auxiliary format 
 "/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf"   archivelog like 
 "/u01/app/oracle/arch/1_168_1101088597.arch" auxiliary format 
 "/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf"   ;
   catalog clone archivelog  "/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf";
   catalog clone archivelog  "/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 2023:03:1819:23:26
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=167 RECID=228 STAMP=1131823405
output file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=168 RECID=229 STAMP=1131823405
output file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 2023:03:1819:23:29

cataloged archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf RECID=1 STAMP=1131823409

cataloged archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf RECID=2 STAMP=1131823409

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=1131823409 file name=+DATA/NEWDKF/DATAFILE/system.283.1131823383
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=1131823409 file name=+DATA/NEWDKF/DATAFILE/sysaux.284.1131823381
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=1131823409 file name=+DATA/NEWDKF/DATAFILE/undotbs1.289.1131823391
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=1131823409 file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/system.294.1131823397
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1131823409 file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/sysaux.288.1131823393
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=1131823409 file name=+DATA/NEWDKF/DATAFILE/users.291.1131823403
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=1131823409 file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/undotbs1.293.1131823401
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=1131823409 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/system.287.1131823397
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=1131823409 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.285.1131823373
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=1131823409 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.282.1131823387
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=1131823409 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.290.1131823405
datafile 13 switched to datafile copy
input datafile copy RECID=15 STAMP=1131823409 file name=+DATA/NEWDKF/DATAFILE/test.286.1131823357
datafile 14 switched to datafile copy
input datafile copy RECID=16 STAMP=1131823409 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.292.1131823403

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

executing command: SET until clause

Starting recover at 2023:03:1819:23:30
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=45 device type=DISK

starting media recovery

archived log for thread 1 with sequence 167 is already on disk as file /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf
archived log for thread 1 with sequence 168 is already on disk as file /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf thread=1 sequence=167
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf thread=1 sequence=168
media recovery complete, elapsed time: 00:00:00
Finished recover at 2023:03:1819:23:32

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

released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
deleted archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1101088597.dbf RECID=1 STAMP=1131823409
deleted archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1101088597.dbf RECID=2 STAMP=1131823409
Deleted 2 objects

Oracle instance started

Total System Global Area     297795128 bytes

Fixed Size                     9133624 bytes
Variable Size                234881024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3448832 bytes

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

Fixed Size                     9133624 bytes
Variable Size                234881024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3448832 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "NEWDKF" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '+DATA' ) SIZE 200 M  REUSE,
  GROUP     2 ( '+DATA' ) SIZE 200 M  REUSE,
  GROUP     3 ( '+DATA' ) SIZE 200 M  REUSE
 DATAFILE
  '+DATA/NEWDKF/DATAFILE/system.283.1131823383',
  '+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/system.294.1131823397',
  '+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/system.287.1131823397'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "+DATA";
   set newname for tempfile  2 to 
 "+DATA";
   set newname for tempfile  3 to 
 "+DATA";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/NEWDKF/DATAFILE/sysaux.284.1131823381", 
 "+DATA/NEWDKF/DATAFILE/undotbs1.289.1131823391", 
 "+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/sysaux.288.1131823393", 
 "+DATA/NEWDKF/DATAFILE/users.291.1131823403", 
 "+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/undotbs1.293.1131823401", 
 "+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.285.1131823373", 
 "+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.282.1131823387", 
 "+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.290.1131823405", 
 "+DATA/NEWDKF/DATAFILE/test.286.1131823357", 
 "+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.292.1131823403";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file
renamed tempfile 2 to +DATA in control file
renamed tempfile 3 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DATAFILE/sysaux.284.1131823381 RECID=1 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DATAFILE/undotbs1.289.1131823391 RECID=2 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/sysaux.288.1131823393 RECID=3 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DATAFILE/users.291.1131823403 RECID=4 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/undotbs1.293.1131823401 RECID=5 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.285.1131823373 RECID=6 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.282.1131823387 RECID=7 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.290.1131823405 RECID=8 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DATAFILE/test.286.1131823357 RECID=9 STAMP=1131823444
cataloged datafile copy
datafile copy file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.292.1131823403 RECID=10 STAMP=1131823444

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1131823444 file name=+DATA/NEWDKF/DATAFILE/sysaux.284.1131823381
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1131823444 file name=+DATA/NEWDKF/DATAFILE/undotbs1.289.1131823391
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1131823444 file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/sysaux.288.1131823393
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1131823444 file name=+DATA/NEWDKF/DATAFILE/users.291.1131823403
datafile 8 switched to datafile copy
input datafile copy RECID=5 STAMP=1131823444 file name=+DATA/NEWDKF/DBCED86261CB7148E0550A002762E1A4/DATAFILE/undotbs1.293.1131823401
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1131823444 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/sysaux.285.1131823373
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1131823444 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/undotbs1.282.1131823387
datafile 12 switched to datafile copy
input datafile copy RECID=8 STAMP=1131823444 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/users.290.1131823405
datafile 13 switched to datafile copy
input datafile copy RECID=9 STAMP=1131823444 file name=+DATA/NEWDKF/DATAFILE/test.286.1131823357
datafile 14 switched to datafile copy
input datafile copy RECID=10 STAMP=1131823444 file name=+DATA/NEWDKF/DBCEFC8A3ACE81CBE0550A002762E1A4/DATAFILE/dkftest.292.1131823403
Reenabling controlfile options for auxiliary database
Executing: alter database force logging

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
Cannot remove created server parameter file
Finished Duplicate Db at 2023:03:1819:24:25

RMAN> 

本文完!

====================================================

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kuifeng.dong

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值