oracle 異機恢復

long_small發表於2023-01-16

一 環境

生產RAC  oracle 11.2.0.4



目標單機 oracle 11.2.0.4 



二 過程

rac引數比較複雜,可以從其他單機copy一個引數檔案到uat環境,建立對應目錄,修改引數sga_target就可以啟動資料庫到nomount,恢復控制檔案



2.1 檢視源端備份,scp到uat環境

[oracle@ERPDB04 erpdb2]$ crontab -l

30 4 * * 1,5 sh /data/script/rman_backup_level0.sh >> /data/backup/erpdb2_0.log

30 4 * * 0,2,3,4,6 sh /data/script/rman_backup_level1.sh >> /data/backup/erpdb2_1.log

30 5 * * * sh /data/script/rman_archivelog_back.sh 

30 4 28,29,30 * * sh /data/script/rman_archivelog_back_delete.sh 

#30 1 * * * /data/script/rm.sh >> /data/backup/rm.log


[oracle@ERPDB04 erpdb2]$ cat /data/script/rman_backup_level0.sh

#!/bin/bash

echo "kk" >> /data/backup/oracle.log

source  /home/oracle/.bash_profile

export ORACLE_SID=ERPDB22

rman target /  log=/data/backup/level0_`date +%F-%T`.log << EOF

run {

      sql 'alter system archive log current';

      allocate channel c1 type disk;

      allocate channel c2 type disk;

      allocate channel c3 type disk;

      backup as compressed backupset

      incremental level 0

      format '/data/backup/erpdb2/db0_%d_%T_%s' database

      plus archivelog format '/data/backup/erpdb2/arch_%d_%T_%s' delete input;

      backup spfile  format='/data/backup/erpdb2/spfile_%d_%T_%s';

      backup format '/data/backup/erpdb2/control_%d_%T_%s' current controlfile;

      release channel c1;

      release channel c2;

      release channel c3;

      crosscheck backup;

      delete noprompt obsolete;

      crosscheck archivelog all;

      delete noprompt backup of archivelog all completed before 'sysdate-3';

}

exit;

EOF


1級別備份

[oracle@ERPDB04 erpdb2]$ cat /data/script/rman_backup_level1.sh

#!/bin/bash

echo "kk" >> /data/backup/oracle.log

source  /home/oracle/.bash_profile

export ORACLE_SID=ERPDB22

rman target /  log=/data/backup/level1_`date +%F-%T`.log << EOF

run {

      sql 'alter system archive log current';

      allocate channel c1 type disk;

      allocate channel c2 type disk;

      allocate channel c3 type disk;

      backup as compressed backupset

      incremental level 1

      format '/data/backup/erpdb2/db1_%d_%T_%s' database

      plus archivelog format '/data/backup/erpdb2/arch_%d_%T_%s' delete input;

      backup spfile  format='/data/backup/erpdb2/spfile_%d_%T_%s';

      backup format '/data/backup/erpdb2/control_%d_%T_%s' current controlfile;

      release channel c1;

      release channel c2;

      release channel c3;

      crosscheck backup;

      delete noprompt obsolete;

      crosscheck archivelog all;

      delete noprompt backup of archivelog all completed before 'sysdate-1';

      delete noprompt backup of database  completed before 'sysdate-3';

}

exit;

EOF


歸檔備份

[oracle@ERPDB04 erpdb2]$ cat /data/script/rman_archivelog_back.sh

#!/bin/bash

echo "kk" >> /data/backup/oracle.log

source  /home/oracle/.bash_profile

export ORACLE_SID=ERPDB22

rman target /  log=/data/backup/archive_log_`date +%F-%T`.log << EOF

run {

      sql 'alter system archive log current';

      allocate channel c1 type disk;

      allocate channel c2 type disk;

      allocate channel c3 type disk;

      backup archivelog all format '/data/backup/erpdb2/arch_%d_%T_%s' delete input;

      release channel c1;

      release channel c2;

      release channel c3;

      crosscheck backup;

      crosscheck archivelog all;

      delete noprompt backup of archivelog all completed before 'sysdate-1';

}

exit;

EOF


scp 13號0級別備份,14號1級別,15號1級別備份,加歸檔備份


scp db1_ERPDB2_20230114_31703 10.17.11.14:/data1/backup

scp db1_ERPDB2_20230114_31702 10.17.11.14:/data1/backup

scp control_ERPDB2_20230114_31712  10.17.11.14:/data1/bac

scp db1_ERPDB2_20230115_31718  10.17.11.14:/data1/backup

scp db1_ERPDB2_20230115_31719  10.17.11.14:/data1/backup

scp db1_ERPDB2_20230115_31720  10.17.11.14:/data1/backup

scp db1_ERPDB2_20230115_31721  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230115_31727  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230115_31728  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230115_31729  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31733  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31734  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31735  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31736  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31737  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31740  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31741  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31742  10.17.11.14:/data1/backup

scp arch_ERPDB2_20230116_31743  10.17.11.14:/data1/backup



源端引數檔案,目標端需要修改,否則報錯

SYS@ERPDB22> show parameter db_files;


NAME

------------------------------------

TYPE      VALUE

-------------------------------------------- ------------------------------

db_files

integer      800


2.2  引數檔案

 cat pfilerpdb.ora

erpdb.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment

erpdb.__sga_target=734M

*._gc_policy_time=0

*._in_memory_undo=FALSE

*._optimizer_adaptive_cursor_sharing=FALSE

*._optimizer_extended_cursor_sharing_rel='NONE'

*._optimizer_extended_cursor_sharing='NONE'

*.aq_tm_processes=10

*.audit_file_dest='/data1/backup/admin/erpdb/adump'

*.audit_trail='db'

*.compatible='11.2.0.4.0'

*.control_files='/data1/backup/controlfile/control01.ctl','/data1/backup/controlfile/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='erpdb2'

*.deferred_segment_creation=FALSE

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=erpdbXDB)'

*.fast_start_mttr_target=1800

*.log_archive_dest_1='location=/data1/backup/arch/'

*.log_archive_format='%t_%s_%r.log'

*.open_cursors=1000

*.open_links=250

*.open_links_per_instance=230

*.processes=1000

*.remote_login_passwordfile='EXCLUSIVE'

*.session_cached_cursors=300

*.sessions=1105

*.sga_max_size=800M

*.sga_target=800M

*.undo_retention=10800

*.undo_tablespace='UNDOTBS1'

*.db_files=800



修改地方: *.db_name='erpdb2',

                  erpdb.__sga_target=734M

                   *.db_files=800 (參照了源端)


2.3 啟動資料庫到nomount狀態

sqlplus / as sysdba


SQL> startup pfile='/data1/backup/pfilerpdb.ora'        

ORA-27102: out of memory                                

Linux-x86_64 Error: 28: No space left on device         

Additional information: 738197504                       

--修改sga_target,去掉其他記憶體引數


解決問題


2.2. 恢復控制檔案



RMAN> restore controlfile to '/data1/backup/controlfile/control01.ctl' from '/data1/backup/control_ERPDB2_20230113_31694';


Starting restore at 16-JAN-23

using channel ORA_DISK_1


channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:03

Finished restore at 16-JAN-23


RMAN> restore controlfile to '/data1/backup/controlfile/control02.ctl' from '/data1/backup/control_ERPDB2_20230113_31694';


Starting restore at 16-JAN-23

using channel ORA_DISK_1


channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:03

Finished restore at 16-JAN-23


RMAN> alter database mount;


RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 01/16/2023 15:47:30

ORA-00201: control file version 11.2.0.4.0 incompatible with ORACLE version 11.2.0.0.0

ORA-00202: control file: '/data1/backup/controlfile/control01.ctl'


引數檔案版本是11.2.0.0,修改重新啟動到nomount狀態既可以


啟動資料庫到mount狀態


2.3

註冊備份片

catalog backuppiece '/data1/backup/db0_ERPDB2_20230113_31681'           

catalog backuppiece '/data1/backup/db0_ERPDB2_20230113_31682';          

catalog backuppiece '/data1/backup/db0_ERPDB2_20230113_31683';          

catalog backuppiece '/data1/backup/db0_ERPDB2_20230113_31689';          

catalog backuppiece '/data1/backup/control_ERPDB2_20230113_31694';      

catalog backuppiece '/data1/backup/db1_ERPDB2_20230114_31700';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230114_31701';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230114_31703';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230114_31702';          

catalog backuppiece '/data1/backup/control_ERPDB2_20230114_31712';      

catalog backuppiece '/data1/backup/db1_ERPDB2_20230115_31718';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230115_31719';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230115_31720';          

catalog backuppiece '/data1/backup/db1_ERPDB2_20230115_31721';          

catalog backuppiece '/data1/backup/arch_ERPDB2_20230115_31727';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230115_31728';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230115_31729';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31733';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31734';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31735';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31736';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31740';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31741';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31742';         

catalog backuppiece '/data1/backup/arch_ERPDB2_20230116_31743';         



2.4 

建立任務   screen -S restore0116V2

檢視任務     screen -ls 

There are screens on:

        8194.pts-3.host-10-17-11-14     (Attached)

        6621.restore0116V2      (Attached)

        5926.restore0116        (Attached)

          3 Sockets in /var/run/screen/S-oracle.


把任務放入後臺

screen -d restore0116V2




2.5 恢復資料檔案

rman target /

run {

allocate channel d1 type disk; 

 allocate channel d2 type disk;

 allocate channel d3 type disk; 

 allocate channel d4 type disk;

 set newname for datafile 1 to '/data1/backup/erpdb/system.260.dbf';

 set newname for datafile 2 to '/data1/backup/erpdb/sysaux.261.dbf';

 set newname for datafile 3 to '/data1/backup/erpdb/aaapp.22750.dbf';

 set newname for datafile 4 to '/data1/backup/erpdb/undo11.647.dbf';

 set newname for datafile 5 to '/data1/backup/erpdb/users.265.dbf';

 set newname for datafile 6 to '/data1/backup/erpdb/psdefault.270.dbf';

 set newname for datafile 7 to '/data1/backup/erpdb/aaapp.271.dbf';

 set newname for datafile 8 to '/data1/backup/erpdb/aalarge.272.dbf';

 set newname for datafile 9 to '/data1/backup/erpdb/adapp.273.dbf';

 set newname for datafile 10 to '/data1/backup/erpdb/amapp.274.dbf';

 set newname for datafile 11 to '/data1/backup/erpdb/avapp.275.dbf';

 set newname for datafile 12 to '/data1/backup/erpdb/bdapp.276.dbf';

 set newname for datafile 13 to '/data1/backup/erpdb/bnapp.277.dbf';

 set newname for datafile 14 to '/data1/backup/erpdb/bnlarge.278.dbf';

 set newname for datafile 15 to '/data1/backup/erpdb/ccapp.279.dbf';

 set newname for datafile 16 to '/data1/backup/erpdb/coapp.280.dbf';

 set newname for datafile 17 to '/data1/backup/erpdb/cuaudit.281.dbf';

 set newname for datafile 18 to '/data1/backup/erpdb/cularg1.282.dbf';

 set newname for datafile 19 to '/data1/backup/erpdb/cularg2.283.dbf';     

 set newname for datafile 20 to '/data1/backup/erpdb/cularg3.284.dbf';

 set newname for datafile 21 to '/data1/backup/erpdb/cularge.285.dbf';

 set newname for datafile 22 to '/data1/backup/erpdb/diapp.286.dbf';

 set newname for datafile 23 to '/data1/backup/erpdb/dtapp.287.dbf';

 set newname for datafile 24 to '/data1/backup/erpdb/eoapp.288.dbf';

 set newname for datafile 25 to '/data1/backup/erpdb/eobfapp.289.dbf';

 set newname for datafile 26 to '/data1/backup/erpdb/eocfapp.290.dbf';

 set newname for datafile 27 to '/data1/backup/erpdb/eocmapp.291.dbf';

 set newname for datafile 28 to '/data1/backup/erpdb/eocmlrg.292.dbf';

 set newname for datafile 29 to '/data1/backup/erpdb/eocmwrk.293.dbf';

 set newname for datafile 30 to '/data1/backup/erpdb/eocuapp.294.dbf';

 set newname for datafile 31 to '/data1/backup/erpdb/eoculrg.295.dbf';

 set newname for datafile 32 to '/data1/backup/erpdb/eodsapp.296.dbf';

 set newname for datafile 33 to '/data1/backup/erpdb/eodslrg.297.dbf';

 set newname for datafile 34 to '/data1/backup/erpdb/eoecapp.298.dbf';

 set newname for datafile 35 to '/data1/backup/erpdb/eoeclrg.299.dbf';

 set newname for datafile 36 to '/data1/backup/erpdb/eoecwrk.300.dbf';

 set newname for datafile 37 to '/data1/backup/erpdb/eoeiapp.301.dbf';

 set newname for datafile 38 to '/data1/backup/erpdb/eoeilrg.302.dbf';

 set newname for datafile 39 to '/data1/backup/erpdb/eoewapp.303.dbf';

 set newname for datafile 40 to '/data1/backup/erpdb/eoewlrg.304.dbf';

 set newname for datafile 41 to '/data1/backup/erpdb/eoewwrk.305.dbf';

 set newname for datafile 42 to '/data1/backup/erpdb/eoiuapp.306.dbf';

 set newname for datafile 43 to '/data1/backup/erpdb/eoiulrg.307.dbf';

 set newname for datafile 44 to '/data1/backup/erpdb/eoiuwrk.308.dbf';

 set newname for datafile 45 to '/data1/backup/erpdb/eolarge.309.dbf';

 set newname for datafile 46 to '/data1/backup/erpdb/eoltapp.310.dbf';

 set newname for datafile 47 to '/data1/backup/erpdb/eoppapp.311.dbf';

 set newname for datafile 48 to '/data1/backup/erpdb/eopplrg.312.dbf';

 set newname for datafile 49 to '/data1/backup/erpdb/eotpapp.313.dbf';

 set newname for datafile 50 to '/data1/backup/erpdb/eotplrg.314.dbf';

 set newname for datafile 51 to '/data1/backup/erpdb/epapp.315.dbf';

 set newname for datafile 52 to '/data1/backup/erpdb/eplarge.316.dbf';

 set newname for datafile 53 to '/data1/backup/erpdb/erapp.317.dbf';

 set newname for datafile 54 to '/data1/backup/erpdb/erlarge.318.dbf';

 set newname for datafile 55 to '/data1/backup/erpdb/erwork.319.dbf';

 set newname for datafile 56 to '/data1/backup/erpdb/faapp.320.dbf';

 set newname for datafile 57 to '/data1/backup/erpdb/falarge.321.dbf';

 set newname for datafile 58 to '/data1/backup/erpdb/fgapp.322.dbf';

 set newname for datafile 59 to '/data1/backup/erpdb/fglarge.323.dbf';

 set newname for datafile 60 to '/data1/backup/erpdb/fsapp.324.dbf';

 set newname for datafile 61 to '/data1/backup/erpdb/giapp.325.dbf';

 set newname for datafile 62 to '/data1/backup/erpdb/gpapp.326.dbf';

 set newname for datafile 63 to '/data1/backup/erpdb/gpdeapp.327.dbf';

 set newname for datafile 64 to '/data1/backup/erpdb/hpapp.328.dbf';

 set newname for datafile 65 to '/data1/backup/erpdb/hrapp.329.dbf';

 set newname for datafile 66 to '/data1/backup/erpdb/hrapp1.330.dbf';

 set newname for datafile 67 to '/data1/backup/erpdb/hrapp2.331.dbf';

 set newname for datafile 68 to '/data1/backup/erpdb/hrapp3.332.dbf';

 set newname for datafile 69 to '/data1/backup/erpdb/hrapp4.333.dbf';

 set newname for datafile 70 to '/data1/backup/erpdb/hrapp5.334.dbf';

 set newname for datafile 71 to '/data1/backup/erpdb/hrapp6.335.dbf';

 set newname for datafile 72 to '/data1/backup/erpdb/hrapp7.336.dbf';

 set newname for datafile 73 to '/data1/backup/erpdb/hrimage.337.dbf';

 set newname for datafile 74 to '/data1/backup/erpdb/hrlarg1.338.dbf';

 set newname for datafile 75 to '/data1/backup/erpdb/hrlarge.339.dbf';

 set newname for datafile 76 to '/data1/backup/erpdb/hrsapp.340.dbf';

 set newname for datafile 77 to '/data1/backup/erpdb/hrsarch.341.dbf';

 set newname for datafile 78 to '/data1/backup/erpdb/hrslarge.342.dbf';

 set newname for datafile 79 to '/data1/backup/erpdb/hrswork.343.dbf';

 set newname for datafile 80 to '/data1/backup/erpdb/hrwork.344.dbf';

 set newname for datafile 81 to '/data1/backup/erpdb/htapp.345.dbf';

 set newname for datafile 82 to '/data1/backup/erpdb/inapp.346.dbf';

 set newname for datafile 83 to '/data1/backup/erpdb/paapp.347.dbf';

 set newname for datafile 84 to '/data1/backup/erpdb/palarge.348.dbf';

 set newname for datafile 85 to '/data1/backup/erpdb/pcapp.349.dbf';

 set newname for datafile 86 to '/data1/backup/erpdb/pclarge.350.dbf';

 set newname for datafile 87 to '/data1/backup/erpdb/piapp.351.dbf';

 set newname for datafile 88 to '/data1/backup/erpdb/pilarge.352.dbf';

 set newname for datafile 89 to '/data1/backup/erpdb/piwork.353.dbf';

 set newname for datafile 90 to '/data1/backup/erpdb/poapp.354.dbf';

 set newname for datafile 91 to '/data1/backup/erpdb/psimage.355.dbf';

 set newname for datafile 92 to '/data1/backup/erpdb/psimage2.356.dbf';

 set newname for datafile 93 to '/data1/backup/erpdb/psimgr.357.dbf';

 set newname for datafile 94 to '/data1/backup/erpdb/psindex.358.dbf';

 set newname for datafile 95 to '/data1/backup/erpdb/ptamsg.359.dbf';

 set newname for datafile 96 to '/data1/backup/erpdb/ptapp.360.dbf';

 set newname for datafile 97 to '/data1/backup/erpdb/ptappe.361.dbf';

 set newname for datafile 98 to '/data1/backup/erpdb/ptaudit.362.dbf';

 set newname for datafile 99 to '/data1/backup/erpdb/ptcmstar.363.dbf';

 set newname for datafile 100 to '/data1/backup/erpdb/ptlock.364.dbf';

 set newname for datafile 101 to '/data1/backup/erpdb/psuatdata/ptprc.dbf';

 set newname for datafile 102 to '/data1/backup/erpdb/psuatdata/ptprjwk.dbf';

 set newname for datafile 103 to '/data1/backup/erpdb/psuatdata/ptrpts.dbf';

 set newname for datafile 104 to '/data1/backup/erpdb/psuatdata/psmatvw.dbf';

 set newname for datafile 105 to '/data1/backup/erpdb/psuatdata/pttbl.dbf';

 set newname for datafile 106 to '/data1/backup/erpdb/psuatdata/pttlrg.dbf';

 set newname for datafile 107 to '/data1/backup/erpdb/psuatdata/pttree.dbf';

 set newname for datafile 108 to '/data1/backup/erpdb/psuatdata/ptwork.dbf';

 set newname for datafile 109 to '/data1/backup/erpdb/psuatdata/pvapp.dbf';

 set newname for datafile 110 to '/data1/backup/erpdb/psuatdata/py0lrg.dbf';

 set newname for datafile 111 to '/data1/backup/erpdb/psuatdata/pyapp.dbf';

 set newname for datafile 112 to '/data1/backup/erpdb/psuatdata/pylarge.dbf';

 set newname for datafile 113 to '/data1/backup/erpdb/psuatdata/pywork.dbf';

 set newname for datafile 114 to '/data1/backup/erpdb/psuatdata/saapp.dbf';

 set newname for datafile 115 to '/data1/backup/erpdb/psuatdata/sacapp.dbf';

 set newname for datafile 116 to '/data1/backup/erpdb/psuatdata/salarge.dbf';

 set newname for datafile 117 to '/data1/backup/erpdb/psuatdata/srapp.dbf';

 set newname for datafile 118 to '/data1/backup/erpdb/psuatdata/stapp.dbf';

 set newname for datafile 119 to '/data1/backup/erpdb/stlarge.dbf';

 set newname for datafile 120 to '/data1/backup/erpdb/stwork.dbf';

 set newname for datafile 121 to '/data1/backup/erpdb/lapp.dbf';

 set newname for datafile 122 to '/data1/backup/erpdb/tllarge.386.dbf';

 set newname for datafile 123 to '/data1/backup/erpdb/tlwork.387.dbf';

 set newname for datafile 124 to '/data1/backup/erpdb/waapp.388.dbf';

  set newname for datafile 125 to '/data1/backup/erpdb/pttbl01.dbf';

 set newname for datafile 126 to '/data1/backup/erpdb/psindex01.dbf';

 set newname for datafile 127 to '/data1/backup/erpdb/psindex02.dbf';

 set newname for datafile 128 to '/data1/backup/erpdb/hrapp01.dbf';

 set newname for datafile 129 to '/data1/backup/erpdb/eoeclrg01.dbf';

 set newname for datafile 130 to '/data1/backup/erpdb/ptrpts01.dbf';

 set newname for datafile 131 to '/data1/backup/erpdb/agapp01.dbf';

 set newname for datafile 132 to '/data1/backup/erpdb/hrlarge01.dbf';

 set newname for datafile 133 to '/data1/backup/erpdb/sysaux01.dbf';

 set newname for datafile 134 to '/data1/backup/erpdb/psimage01.dbf';

 set newname for datafile 135 to '/data1/backup/erpdb/psimage201.dbf';

 set newname for datafile 136 to '/data1/backup/erpdb/psdefault01.dbf';

 set newname for datafile 137 to '/data1/backup/erpdb/psindex03.dbf';

 set newname for datafile 138 to '/data1/backup/erpdb/onboarding01.dbf';

 set newname for datafile 139 to '/data1/backup/erpdb/gpapp.7824.dbf';

 set newname for datafile 140 to '/data1/backup/erpdb/hrapp.9101.dbf';

 set newname for datafile 141 to '/data1/backup/erpdb/psindex.dbf';

 set newname for datafile 142 to '/data1/backup/erpdb/ptrpts.22651.dbf';

 set newname for datafile 143 to '/data1/backup/erpdb/psimage2.26694.dbf';

 set newname for datafile 144 to '/data1/backup/erpdb/hrlarge.25597.dbf';

 set newname for datafile 145 to '/data1/backup/erpdb/pttree.25435.dbf';

 set newname for datafile 146 to '/data1/backup/erpdb/users.26708.dbf';

 set newname for datafile 147 to '/data1/backup/erpdb/undo22.643.dbf';

 set newname for datafile 148 to '/data1/backup/erpdb/aaapp.21893.dbf';

 set newname for datafile 149 to '/data1/backup/erpdb/aaapp.21384.dbf';

 set newname for datafile 150 to '/data1/backup/erpdb/aaapp.25862.dbf';

 set newname for datafile 151 to '/data1/backup/erpdb/aaapp.22319.dbf';

 set newname for datafile 152 to '/data1/backup/erpdb/undo33.622.dbf';

 set newname for datafile 153 to '/data1/backup/erpdb/aaapp.22035.dbf';

 set newname for datafile 154 to '/data1/backup/erpdb/aaapp.22126.dbf';

 set newname for datafile 155 to '/data1/backup/erpdb/aaapp.21409.dbf';

 set newname for datafile 156 to '/data1/backup/erpdb/aaapp.21641.dbf';

 set newname for datafile 157 to '/data1/backup/erpdb/aaapp.21303.dbf';

 set newname for datafile 158 to '/data1/backup/erpdb/aaapp.22514.dbf';

 set newname for datafile 159 to '/data1/backup/erpdb/aaapp.19126.dbf';

 set newname for datafile 160 to '/data1/backup/erpdb/hrlarge.21597.dbf';

 set newname for datafile 161 to '/data1/backup/erpdb/aaapp.21447.dbf';

 set newname for datafile 162 to '/data1/backup/erpdb/hrlarge.25991.dbf';

 set newname for datafile 163 to '/data1/backup/erpdb/hrlarge.21829.dbf';

 set newname for datafile 164 to '/data1/backup/erpdb/hrlarge.21891.dbf';

 set newname for datafile 165 to '/data1/backup/erpdb/hrlarge.24132.dbf';

 set newname for datafile 166 to '/data1/backup/erpdb/aaapp.21274.dbf';

 set newname for datafile 167 to '/data1/backup/erpdb/sysaux.22187.dbf';

 set newname for datafile 168 to '/data1/backup/erpdb/psimage.24930.dbf';

 set newname for datafile 169 to '/data1/backup/erpdb/system.21314.dbf';

 set newname for datafile 170 to '/data1/backup/erpdb/hrlarge.21581.dbf';

 set newname for datafile 171 to '/data1/backup/erpdb/aaapp.21589.dbf';

 set newname for datafile 172 to '/data1/backup/erpdb/ptamsg.26515.dbf';

 set newname for datafile 173 to '/data1/backup/erpdb/hpapp.21325.dbf';

 set newname for datafile 174 to '/data1/backup/erpdb/hrapp.21401.dbf';

 set newname for datafile 175 to '/data1/backup/erpdb/psindex2.26218.dbf';

 set newname for datafile 176 to '/data1/backup/erpdb/hrlarge20200330.dbf';

 set newname for datafile 177 to '/data1/backup/erpdb/hrlarge20200331.dbf';

 set newname for datafile 178 to '/data1/backup/erpdb/hrlarge20200401.dbf';

 set newname for datafile 179 to '/data1/backup/erpdb/hrlarge20200402.dbf';

 set newname for datafile 180 to '/data1/backup/erpdb/psindex20200430.dbf';

 set newname for datafile 181 to '/data1/backup/erpdb/aaapp20200430.dbf';

 set newname for datafile 182 to '/data1/backup/erpdb/gpapp20200430.dbf';

 set newname for datafile 183 to '/data1/backup/erpdb/psindex.24682.dbf';

 set newname for datafile 184 to '/data1/backup/erpdb/psdefault.21355.dbf';

 set newname for datafile 185 to '/data1/backup/erpdb/psimage2_20200831.dbf';

 set newname for datafile 186 to '/data1/backup/erpdb/psdefault_20200831.dbf';

 set newname for datafile 187 to '/data1/backup/erpdb/hrapp_20200831.dbf';

 set newname for datafile 188 to '/data1/backup/erpdb/pttbl02.dbf';

 set newname for datafile 189 to '/data1/backup/erpdb/psindex201.dbf';

 set newname for datafile 190 to '/data1/backup/erpdb/eoeclrg02.dbf';

 set newname for datafile 191 to '/data1/backup/erpdb/hrapp01.dbf';

 set newname for datafile 192 to '/data1/backup/erpdb/pttree02.dbf';

 set newname for datafile 193 to '/data1/backup/erpdb/ptamsg02.dbf';

 set newname for datafile 194 to '/data1/backup/erpdb/ptapp02.dbf';

 set newname for datafile 195 to '/data1/backup/erpdb/aaapp01.dbf';

 set newname for datafile 196 to '/data1/backup/erpdb/ptrpts03.dbf';

 set newname for datafile 197 to '/data1/backup/erpdb/psdefault.24244.dbf';

 set newname for datafile 198 to '/data1/backup/erpdb/hrapp02.dbf';

 set newname for datafile 199 to '/data1/backup/erpdb/psindex04.dbf';

 set newname for datafile 200 to '/data1/backup/erpdb/hrapp03.dbf';

 set newname for datafile 201 to '/data1/backup/erpdb/undo11.640.dbf';

 set newname for datafile 202 to '/data1/backup/erpdb/undo22.605.dbf';

 set newname for datafile 203 to '/data1/backup/erpdb/undo33.592.dbf';

 release channel d1;

 release channel d2;

 release channel d3;

 release channel d4;

 sql 'alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss"';

 set until time "to_date('2023-01-15 05:33:00','yyyy-mm-dd hh24:mi:ss')";

 restore database;

 switch datafile all;

 switch tempfile all;

 recover database;

 }


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25846553/viewspace-2932344/,如需轉載,請註明出處,否則將追究法律責任。

相關文章