Starting backup at07-DEC-19 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/BOOBOO/system01.dbf channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_16_1_20191207.bkp tag=TAG20191207T231829 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting compressed full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_17_1_20191207.bkp tag=TAG20191207T231829 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at07-DEC-19
RMAN> list backup;
List of Backup Sets ===================
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 11Full48.14M DISK 00:00:0507-DEC-19 BP Key: 11 Status: AVAILABLE Compressed: YES Tag: TAG20191207T231829 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_16_1_20191207.bkp List of Datafiles in backup set11 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1Full44962507-DEC-19/u01/app/oracle/oradata/BOOBOO/system01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 12Full1.03M DISK 00:00:0207-DEC-19 BP Key: 12 Status: AVAILABLE Compressed: YES Tag: TAG20191207T231829 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_17_1_20191207.bkp SPFILE Included: Modification time: 23-NOV-19 SPFILE db_unique_name: BOOBOO Control File Included: Ckp SCN: 449627 Ckp time: 07-DEC-19
实践2-使用备份集备份表空间
使用备份集备份表空间 RMAN> backup tablespace users;
查看归档日志 RMAN> list archivelog all;
使用备份集备份归档日志:目的是清理存档终点 RMAN> backup as compressed backupset archivelog alldelete input;
实践3-使用备份集备份全库
使用备份集备份全库 RMAN> backup as compressed backupset database plus archivelog;
操作记录
RMAN> backup as compressed backupset database plus archivelog;
Starting backup at07-DEC-19 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=18 RECID=10 STAMP=1026430222 channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_20_1_20191207.bkp tag=TAG20191207T233022 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at07-DEC-19
Starting backup at07-DEC-19 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=/u01/app/oracle/oradata/BOOBOO/users01.dbf input datafile file number=00001 name=/u01/app/oracle/oradata/BOOBOO/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/BOOBOO/sysaux01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/BOOBOO/undotbs01.dbf channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_21_1_20191207.bkp tag=TAG20191207T233023 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting compressed full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_22_1_20191207.bkp tag=TAG20191207T233023 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at07-DEC-19
Starting backup at07-DEC-19 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=19 RECID=11 STAMP=1026430232 channel ORA_DISK_1: starting piece 1at07-DEC-19 channel ORA_DISK_1: finished piece 1at07-DEC-19 piece handle=/home/oracle/rmanbk/BOOBOO_3420951115_23_1_20191207.bkp tag=TAG20191207T233032 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at07-DEC-19
RMAN> list backup;
List of Backup Sets ===================
BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 151.10M DISK 00:00:0007-DEC-19 BP Key: 15 Status: AVAILABLE Compressed: YES Tag: TAG20191207T233022 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_20_1_20191207.bkp
List of Archived Logs in backup set15 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 11844829607-DEC-1945003607-DEC-19
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 16Full53.91M DISK 00:00:0607-DEC-19 BP Key: 16 Status: AVAILABLE Compressed: YES Tag: TAG20191207T233023 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_21_1_20191207.bkp List of Datafiles in backup set16 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1Full45004207-DEC-19/u01/app/oracle/oradata/BOOBOO/system01.dbf 2Full45004207-DEC-19/u01/app/oracle/oradata/BOOBOO/sysaux01.dbf 3Full45004207-DEC-19/u01/app/oracle/oradata/BOOBOO/undotbs01.dbf 4Full45004207-DEC-19/u01/app/oracle/oradata/BOOBOO/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 17Full1.03M DISK 00:00:0107-DEC-19 BP Key: 17 Status: AVAILABLE Compressed: YES Tag: TAG20191207T233023 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_22_1_20191207.bkp SPFILE Included: Modification time: 23-NOV-19 SPFILE db_unique_name: BOOBOO Control File Included: Ckp SCN: 450044 Ckp time: 07-DEC-19
BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 183.00K DISK 00:00:0007-DEC-19 BP Key: 18 Status: AVAILABLE Compressed: YES Tag: TAG20191207T233032 Piece Name: /home/oracle/rmanbk/BOOBOO_3420951115_23_1_20191207.bkp
List of Archived Logs in backup set18 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 11945003607-DEC-1945004907-DEC-19
Disconnected from Oracle Database 11g Enterprise Edition Release11.2.0.4.0-64bit Production With the Partitioning, OLAP, Data Mining andReal Application Testing options
通过rman全备份恢复操作记录
[oracle@oratest rmanbk]$ pwd /home/oracle/rmanbk [oracle@oratest rmanbk]$ ll total 57648 -rw-r----- 1 oracle oinstall 18432 Dec 15 09:35 BOOBOO_3420951115_28_1_20191215.bkp -rw-r----- 1 oracle oinstall 57892864 Dec 15 09:35 BOOBOO_3420951115_29_1_20191215.bkp -rw-r----- 1 oracle oinstall 1114112 Dec 15 09:35 BOOBOO_3420951115_30_1_20191215.bkp -rw-r----- 1 oracle oinstall 3072 Dec 15 09:35 BOOBOO_3420951115_31_1_20191215.bkp [oracle@oratest rmanbk]$ for i in `ls`;do db_name=`strings $i | grep db_name`; if [[ $db_name !='' ]];then echo $i;echo $db_name;fi;done BOOBOO_3420951115_30_1_20191215.bkp *.db_name='BOOBOO'
[oracle@oratest rmanbk]$ rman target /
Recovery Manager: Release11.2.0.4.0- Production on Sun Dec1510:18:032019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
run{ startup nomount; restore spfile from "/home/oracle/rmanbk/BOOBOO_3420951115_30_1_20191215.bkp"; startup force nomount; restore controlfile from "/home/oracle/rmanbk/BOOBOO_3420951115_30_1_20191215.bkp"; alter database mount; catalog startwith'/home/oracle/rmanbk/'; restore database; recover database; alter database open resetlogs; 11> };
startup failed: ORA-01078: failure in processing system parameters LRM-00109: could notopenparameter file '/u01/app/oracle/product/11.2.0.4/dbs/initBOOBOO.ora'
starting Oracle instance withoutparameter file for retrieval of spfile Oracle instance started
searching forall files that match the pattern/home/oracle/rmanbk/
List of Files Unknownto the Database ===================================== File Name: /home/oracle/rmanbk/BOOBOO_3420951115_30_1_20191215.bkp File Name: /home/oracle/rmanbk/BOOBOO_3420951115_31_1_20191215.bkp
Do you really want to catalog the above files (enter YES orNO)? yes cataloging files... cataloging done
List of Cataloged Files ======================= File Name: /home/oracle/rmanbk/BOOBOO_3420951115_30_1_20191215.bkp File Name: /home/oracle/rmanbk/BOOBOO_3420951115_31_1_20191215.bkp