RMAN Duplicate RAC to Single Instance
背景:
oracle rac11g一套
下面我們來進行完整的RAC to Single Instance的Active Database Duplicate操作。
以rac節點1來舉例,已配置靜態監聽。
[oracle@rac1:/home/oracle]$cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 #public ip ent1 10.8.98.103 rac1 10.8.98.104 rac2 #priv ip ent2 192.168.1.103 rac1-priv 192.168.1.104 rac2-priv #vip ip 10.8.98.105 rac1-vip 10.8.98.106 rac2-vip #scan ip 10.8.98.107 cluster-scan #dg 10.8.98.102 racdg [oracle@rac1:/home/oracle]$ 單機測試duplicate是 10.8.98.150
[grid@rac1:/home/grid]$lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-JAN-2022 15:07:07 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2022 14:21:23 Uptime 0 days 0 hr. 45 min. 43 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/rac1/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.98.103)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.98.105)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service... Service "prod" has 2 instance(s). Instance "prod1", status UNKNOWN, has 1 handler(s) for this service... Instance "prod1", status READY, has 1 handler(s) for this service... Service "prodXDB" has 1 instance(s). Instance "prod1", status READY, has 1 handler(s) for this service... The command completed successfully [grid@rac1:/home/grid]$cat /u01/app/11.2.0/grid/network/admin/listener.ora SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = prod) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1) (SID_NAME = prod1)) ) LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent [grid@rac1:/home/grid]$
[oracle@rac1:/u01/app/oracle/product/11.2.0/db_1/network/admin]$cat tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. PROD = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cluster-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_primary = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.105)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_150 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.150)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) )
現在需要duplicate 到一個單節點
單節點配置如下
單節點伺服器只安裝了資料庫,起了監聽, 沒有dbca建庫
1、 備庫修改為靜態監聽,並配置tnsnames.ora
[oracle@dbserver admin]$ cat listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = prod) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1) (SID_NAME = prod)) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle [oracle@dbserver admin]$ cat tnsnames.ora tns_103 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_150 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.150)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_primary = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.105)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) [oracle@dbserver admin]$
2、備庫建立 引數檔案和密碼檔案
[oracle@dbserver dbs]$ cat initprod.ora prod.__db_cache_size=2868903936 prod.__java_pool_size=16777216 prod.__large_pool_size=33554432 prod.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment prod.__pga_aggregate_target=2415919104 prod.__sga_target=3623878656 prod.__shared_io_pool_size=0 prod.__shared_pool_size=654311424 prod.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/prod/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/u01/app/oracle/oradata/prod/control01.ctl','/u01/app/oracle/oradata/prod/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='prod' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=prodXDB)' *.memory_target=3030360576 *.open_cursors=300 *.processes=500 *.remote_login_passwordfile='EXCLUSIVE' *.sessions=555 *.undo_tablespace='UNDOTBS1' *.db_file_name_convert='+DATADG01/','/u01/app/oracle/oradata/','+DATADG02/','/u01/app/oracle/oradata/' *.log_file_name_convert='+DATADG01/','/u01/app/oracle/oradata/','+DATADG02/','/u01/app/oracle/oradata/' [oracle@dbserver dbs]$ [oracle@dbserver dbs]$ orapwd file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwprod password=oracle entries=10 [oracle@dbserver dbs]$ ls hc_prod.dat initprod.ora lkPROD orapwprod
並在備庫上建立相應的目錄
[oracle@dbserver dbs]$ mkdir -p /u01/app/oracle/admin/prod/adump [oracle@dbserver dbs]$ mkdir -p /u01/app/oracle/oradata/prod/
*.db_file_name_convert='+DATADG01/','/u01/app/oracle/oradata/','+DATADG02/','/u01/app/oracle/oradata/'
*.log_file_name_convert='+DATADG01/','/u01/app/oracle/oradata/','+DATADG02/','/u01/app/oracle/oradata/'
rac和單機路徑不一樣,我配置了自動轉化。
3、備庫啟動到nomount狀態建立spfile,再關閉例項,重新透過spfile啟動到nomount狀態
[oracle@dbserver dbs]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 26 15:47:44 2022 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount; ORACLE instance started. Total System Global Area 3023110144 bytes Fixed Size 2257072 bytes Variable Size 1845497680 bytes Database Buffers 1157627904 bytes Redo Buffers 17727488 bytes SQL> create spfile from pfile; File created. SQL> shutdown abort; ORACLE instance shut down. SQL> startup nomount; ORACLE instance started. Total System Global Area 3023110144 bytes Fixed Size 2257072 bytes Variable Size 1845497680 bytes Database Buffers 1157627904 bytes Redo Buffers 17727488 bytes SQL>
4、重啟監聽,並在rac1 和 單例項節點tnsping測試都要ok
接下來就是在單節點上恢復資料庫了
中間出現了兩次報錯
input datafile file number=00001 name=+DATADG01/prod/datafile/system.256.1083328327
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/26/2022 15:53:20
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
原因是單節點上不存在對應的目錄
/u01/app/oracle/oradata/prod/datafile/
建立相應的目錄
[oracle@dbserver dbs]$ mkdir -p /u01/app/oracle/oradata/prod/datafile/ [oracle@dbserver dbs]$ mkdir -p /u01/app/oracle/oradata/prod/onlinelog/
重新開始
[oracle@dbserver dbs]$ rman target sys/oracle@tns_primary auxiliary sys/oracle@tns_150 Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 26 15:58:01 2022 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=495166741) connected to auxiliary database: PROD (not mounted) RMAN> duplicate target database to prod from active database nofilenamecheck; Starting Duplicate Db at 2022-01-26 15:58:20 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=197 device type=DISK contents of Memory Script: { sql clone "alter system set db_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile"; sql clone "alter system set db_unique_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile"; shutdown clone immediate; startup clone force nomount backup as copy current controlfile auxiliary format '/u01/app/oracle/oradata/prod/control01.ctl'; restore clone controlfile to '/u01/app/oracle/oradata/prod/control02.ctl' from '/u01/app/oracle/oradata/prod/control01.ctl'; alter clone database mount; } executing Memory Script sql statement: alter system set db_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile sql statement: alter system set db_unique_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile Oracle instance shut down Oracle instance started Total System Global Area 3023110144 bytes Fixed Size 2257072 bytes Variable Size 1845497680 bytes Database Buffers 1157627904 bytes Redo Buffers 17727488 bytes Starting backup at 2022-01-26 15:58:29 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=14 instance=prod1 device type=DISK channel ORA_DISK_1: starting datafile copy copying current control file output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_prod1.f tag=TAG20220126T155332 RECID=9 STAMP=1095004413 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 2022-01-26 15:58:32 Starting restore at 2022-01-26 15:58:32 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=197 device type=DISK channel ORA_AUX_DISK_1: copied control file copy Finished restore at 2022-01-26 15:58:33 database mounted contents of Memory Script: { set newname for datafile 1 to "/u01/app/oracle/oradata/prod/datafile/system.256.1083328327"; set newname for datafile 2 to "/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327"; set newname for datafile 3 to "/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327"; set newname for datafile 4 to "/u01/app/oracle/oradata/prod/datafile/users.259.1083328327"; set newname for datafile 5 to "/u01/app/oracle/oradata/prod/datafile/example.264.1083328433"; set newname for datafile 6 to "/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627"; set newname for datafile 7 to "/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029"; set newname for datafile 8 to "/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067"; set newname for datafile 9 to "/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817"; set newname for datafile 10 to "/u01/app/oracle/oradata/prod/datafile/test.278.1084036129"; backup as copy reuse datafile 1 auxiliary format "/u01/app/oracle/oradata/prod/datafile/system.256.1083328327" datafile 2 auxiliary format "/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327" datafile 3 auxiliary format "/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327" datafile 4 auxiliary format "/u01/app/oracle/oradata/prod/datafile/users.259.1083328327" datafile 5 auxiliary format "/u01/app/oracle/oradata/prod/datafile/example.264.1083328433" datafile 6 auxiliary format "/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627" datafile 7 auxiliary format "/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029" datafile 8 auxiliary format "/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067" datafile 9 auxiliary format "/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817" datafile 10 auxiliary format "/u01/app/oracle/oradata/prod/datafile/test.278.1084036129" ; 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 Starting backup at 2022-01-26 15:58:38 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=+DATADG01/prod/datafile/system.256.1083328327 output file name=/u01/app/oracle/oradata/prod/datafile/system.256.1083328327 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=+DATADG01/prod/datafile/sysaux.257.1083328327 output file name=/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=+DATADG01/prod/datafile/example.264.1083328433 output file name=/u01/app/oracle/oradata/prod/datafile/example.264.1083328433 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00007 name=+DATADG01/prod/datafile/gac.277.1084032029 output file name=/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00008 name=+DATADG02/prod/datafile/haifeng.269.1084032067 output file name=/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00009 name=+DATADG02/prod/datafile/shaot.270.1084035817 output file name=/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00010 name=+DATADG01/prod/datafile/test.278.1084036129 output file name=/u01/app/oracle/oradata/prod/datafile/test.278.1084036129 tag=TAG20220126T155341 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=+DATADG01/prod/datafile/undotbs1.258.1083328327 output file name=/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00006 name=+DATADG01/prod/datafile/undotbs2.265.1083328627 output file name=/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627 tag=TAG20220126T155341 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=+DATADG01/prod/datafile/users.259.1083328327 output file name=/u01/app/oracle/oradata/prod/datafile/users.259.1083328327 tag=TAG20220126T155341 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 2022-01-26 16:00:04 sql statement: alter system archive log current contents of Memory Script: { backup as copy reuse archivelog like "+ARCHDG01/prod/archivelog/2022_01_26/thread_1_seq_65.361.1095004507" auxiliary format "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.dbf" archivelog like "+ARCHDG01/prod/archivelog/2022_01_26/thread_2_seq_47.360.1095000677" auxiliary format "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_47_1083328407.dbf" archivelog like "+ARCHDG01/prod/archivelog/2022_01_26/thread_2_seq_48.362.1095004509" auxiliary format "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf" ; catalog clone archivelog "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.dbf"; catalog clone archivelog "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_47_1083328407.dbf"; catalog clone archivelog "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf"; switch clone datafile all; } executing Memory Script Starting backup at 2022-01-26 16:00:08 using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=65 RECID=184 STAMP=1095004507 output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.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=2 sequence=47 RECID=183 STAMP=1095000677 output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_47_1083328407.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=2 sequence=48 RECID=185 STAMP=1095004508 output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 Finished backup at 2022-01-26 16:00:11 cataloged archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.dbf RECID=184 STAMP=1095004811 cataloged archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_47_1083328407.dbf RECID=185 STAMP=1095004812 cataloged archived log archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf RECID=186 STAMP=1095004812 datafile 1 switched to datafile copy input datafile copy RECID=9 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/system.256.1083328327 datafile 2 switched to datafile copy input datafile copy RECID=10 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327 datafile 3 switched to datafile copy input datafile copy RECID=11 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327 datafile 4 switched to datafile copy input datafile copy RECID=12 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/users.259.1083328327 datafile 5 switched to datafile copy input datafile copy RECID=13 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/example.264.1083328433 datafile 6 switched to datafile copy input datafile copy RECID=14 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627 datafile 7 switched to datafile copy input datafile copy RECID=15 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029 datafile 8 switched to datafile copy input datafile copy RECID=16 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067 datafile 9 switched to datafile copy input datafile copy RECID=17 STAMP=1095004812 file name=/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817 datafile 10 switched to datafile copy input datafile copy RECID=18 STAMP=1095004813 file name=/u01/app/oracle/oradata/prod/datafile/test.278.1084036129 contents of Memory Script: { set until scn 1426311; recover clone database delete archivelog ; } executing Memory Script executing command: SET until clause Starting recover at 2022-01-26 16:00:14 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 65 is already on disk as file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.dbf archived log for thread 2 with sequence 48 is already on disk as file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_65_1083328407.dbf thread=1 sequence=65 archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_48_1083328407.dbf thread=2 sequence=48 media recovery complete, elapsed time: 00:00:01 Finished recover at 2022-01-26 16:00:16 Oracle instance started Total System Global Area 3023110144 bytes Fixed Size 2257072 bytes Variable Size 1845497680 bytes Database Buffers 1157627904 bytes Redo Buffers 17727488 bytes contents of Memory Script: { sql clone "alter system set db_name = ''PROD'' comment= ''Reset to original value by RMAN'' scope=spfile"; sql clone "alter system reset db_unique_name scope=spfile"; shutdown clone immediate; startup clone nomount; } executing Memory Script sql statement: alter system set db_name = ''PROD'' comment= ''Reset to original value by RMAN'' scope=spfile sql statement: alter system reset db_unique_name scope=spfile Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 3023110144 bytes Fixed Size 2257072 bytes Variable Size 1845497680 bytes Database Buffers 1157627904 bytes Redo Buffers 17727488 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "PROD" RESETLOGS ARCHIVELOG MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 MAXINSTANCES 32 MAXLOGHISTORY 292 LOGFILE GROUP 1 ( '/u01/app/oracle/oradata/prod/onlinelog/group_1.261.1083328407', '/u01/app/oracle/oradata/prod/onlinelog/group_1.257.1083328407' ) SIZE 50 M REUSE, GROUP 2 ( '/u01/app/oracle/oradata/prod/onlinelog/group_2.258.1083328409', '/u01/app/oracle/oradata/prod/onlinelog/group_2.262.1083328407' ) SIZE 50 M REUSE, GROUP 5 ( '/u01/app/oracle/oradata/prod/onlinelog/group_5.269.1084028089', '/u01/app/oracle/oradata/prod/onlinelog/group_5.261.1084028089' ) SIZE 50 M REUSE DATAFILE '/u01/app/oracle/oradata/prod/datafile/system.256.1083328327' CHARACTER SET ZHS16GBK sql statement: ALTER DATABASE ADD LOGFILE INSTANCE 'i2' GROUP 3 ( '/u01/app/oracle/oradata/prod/onlinelog/group_3.266.1083328693', '/u01/app/oracle/oradata/prod/onlinelog/group_3.259.1083328693' ) SIZE 50 M REUSE, GROUP 4 ( '/u01/app/oracle/oradata/prod/onlinelog/group_4.267.1083328693', '/u01/app/oracle/oradata/prod/onlinelog/group_4.260.1083328693' ) SIZE 50 M REUSE, GROUP 6 ( '/u01/app/oracle/oradata/prod/onlinelog/group_6.262.1084028105', '/u01/app/oracle/oradata/prod/onlinelog/group_6.270.1084028105' ) SIZE 50 M REUSE contents of Memory Script: { set newname for tempfile 1 to "/u01/app/oracle/oradata/prod/tempfile/temp.263.1083328429"; switch clone tempfile all; catalog clone datafilecopy "/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327", "/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327", "/u01/app/oracle/oradata/prod/datafile/users.259.1083328327", "/u01/app/oracle/oradata/prod/datafile/example.264.1083328433", "/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627", "/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029", "/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067", "/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817", "/u01/app/oracle/oradata/prod/datafile/test.278.1084036129"; switch clone datafile all; } executing Memory Script executing command: SET NEWNAME renamed tempfile 1 to /u01/app/oracle/oradata/prod/tempfile/temp.263.1083328429 in control file cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327 RECID=1 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327 RECID=2 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/users.259.1083328327 RECID=3 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/example.264.1083328433 RECID=4 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627 RECID=5 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029 RECID=6 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067 RECID=7 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817 RECID=8 STAMP=1095004835 cataloged datafile copy datafile copy file name=/u01/app/oracle/oradata/prod/datafile/test.278.1084036129 RECID=9 STAMP=1095004836 datafile 2 switched to datafile copy input datafile copy RECID=1 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327 datafile 3 switched to datafile copy input datafile copy RECID=2 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327 datafile 4 switched to datafile copy input datafile copy RECID=3 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/users.259.1083328327 datafile 5 switched to datafile copy input datafile copy RECID=4 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/example.264.1083328433 datafile 6 switched to datafile copy input datafile copy RECID=5 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627 datafile 7 switched to datafile copy input datafile copy RECID=6 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/gac.277.1084032029 datafile 8 switched to datafile copy input datafile copy RECID=7 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067 datafile 9 switched to datafile copy input datafile copy RECID=8 STAMP=1095004835 file name=/u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817 datafile 10 switched to datafile copy input datafile copy RECID=9 STAMP=1095004836 file name=/u01/app/oracle/oradata/prod/datafile/test.278.1084036129 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 Finished Duplicate Db at 2022-01-26 16:00:47 RMAN>
恢復完成,且資料庫檔案目錄已經自動轉換
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/prod/datafile/system.256.1083328327 /u01/app/oracle/oradata/prod/datafile/sysaux.257.1083328327 /u01/app/oracle/oradata/prod/datafile/undotbs1.258.1083328327 /u01/app/oracle/oradata/prod/datafile/users.259.1083328327 /u01/app/oracle/oradata/prod/datafile/example.264.1083328433 /u01/app/oracle/oradata/prod/datafile/undotbs2.265.1083328627 /u01/app/oracle/oradata/prod/datafile/haifeng.269.1084032067 /u01/app/oracle/oradata/prod/datafile/shaot.270.1084035817 /u01/app/oracle/oradata/prod/datafile/test.278.1084036129 10 rows selected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2854089/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another NoRESTDatabase
- rman duplicate操作手冊
- Oracle rman duplicate遷移測試Oracle
- How to Increase CSS Misscount in single instance ASM installations [ID 729878.1]CSSASM
- DG:11.2.0.4 RAC線上duplicate恢復DG
- Oracle 11G RAC複製備庫RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038Oracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- duplicate遇到RMAN-05535: warning: All redo log files were not defined
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- 【ASM】Oracle RAC css啟動報錯"Duplicate voting file found"ASMOracleCSS
- WPF implemented Single Instance via mutex and activated the existed window via FindWindow from Microsoft.Win32; namespaceMutexROSWin32namespace
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid相同UXDatabaseOracle
- Oracle 19C RAC open_links_per_instance引數問題Oracle
- ORACLE 11.2.0.4 RAC RMAN異機恢復之ORA-15001Oracle
- Oracle 11G RAC One Node's Instance Arise ORA-01105 ORA-01606Oracle
- vertx instance
- GPU InstanceGPU
- 3.2.1 Mounting a Database to an InstanceDatabase
- 3.1.5.6 Forcing an Instance to Start
- 【RMAN】RMAN備份至ASMASM
- 136. Single Number
- 【RMAN】RMAN的備份保留策略
- C++ instance的使用C++
- [LeetCode] Find the Duplicate NumberLeetCode
- yum error - package is a duplicate withErrorPackage
- ORACLE rman與RMAN-00054&ORA-09945Oracle
- FSMO(Flexible Single Master Operation)FlexAST
- 137-Single Number II
- 260-Single Number III
- RMAN(轉)
- 3.1.5.2 Starting an Instance, and Mounting and Opening a DatabaseDatabase
- Property [title] does not exist on this collection instance
- RMAN恢復之RMAN-06555處理
- 【RMAN】Oracle rman 常用命令參考Oracle
- DATAGUARD手記(DUPLICATE)(四)
- [LintCode/LeetCode] Contains Duplicate IIILeetCodeAI
- [LintCode/LeetCode] Remove Duplicate LettersLeetCodeREM