From Wiki:RMAN (Recovery Manager) is a backup and recovery manager supplied for Oracle databases (from version 8) created by the Oracle Corporation. It provides database backup, restore, and recovery capabilities addressing high availability and disaster recovery concerns. Oracle Corporation recommends RMAN as its preferred method for backup and recovery and has written command-line and graphical (via Oracle Enterprise Manager) interfaces for the product. |
C:\Users\TianPan>RMAN TARGET / Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jul 3 11:40:13 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: PTIAN (DBID=1075230356) RMAN> |
C:\Users\TianPan>rman
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jul 3 11:45:30 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. RMAN> connect target / connected to target database: PTIAN (DBID=1075230356) RMAN> |
RMAN> backup database; Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=E:\APP\TIANPAN\ORADATA\PTIAN\SYSTEM01.DBF input datafile file number=00002 name=E:\APP\TIANPAN\ORADATA\PTIAN\SYSAUX01.DBF input datafile file number=00003 name=E:\APP\TIANPAN\ORADATA\PTIAN\UNDOTBS01.DBF input datafile file number=00005 name=E:\APP\TIANPAN\ORADATA\PTIAN\EXAMPLE01.DBF input datafile file number=00004 name=E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T153438_BSKQJJHS_.BKP tag=TAG20150705T153438 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56 channel ORA_DISK_1: starting 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 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NCSNF_TAG20150705T153438_BSKQL8JB_.BKP tag=TAG20150705T153438 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |
RMAN> BACKUP DATABASE FORMAT 'E:\db_bk\bak_%U'; Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=E:\APP\TIANPAN\ORADATA\PTIAN\SYSTEM01.DBF input datafile file number=00002 name=E:\APP\TIANPAN\ORADATA\PTIAN\SYSAUX01.DBF input datafile file number=00003 name=E:\APP\TIANPAN\ORADATA\PTIAN\UNDOTBS01.DBF input datafile file number=00005 name=E:\APP\TIANPAN\ORADATA\PTIAN\EXAMPLE01.DBF input datafile file number=00004 name=E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\DB_BK\BAK_03QB9U0V_1_1 tag=TAG20150705T160031 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55 channel ORA_DISK_1: starting 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 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\DB_BK\BAK_04QB9U2N_1_1 tag=TAG20150705T160031 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |
RMAN> LIST BACKUP OF DATABASE; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 1.15G DISK 00:00:50 05-JUL-15 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150705T153438 Piece Name: E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T153438_BSKQJJHS_.BKP List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\SYSTEM01.DBF 2 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\SYSAUX01.DBF 3 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\UNDOTBS01.DBF 4 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF 5 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\EXAMPLE01.DBF BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 3 Full 1.15G DISK 00:00:46 05-JUL-15 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150705T160031 Piece Name: E:\DB_BK\BAK_03QB9U0V_1_1 List of Datafiles in backup set 3 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\SYSTEM01.DBF 2 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\SYSAUX01.DBF 3 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\UNDOTBS01.DBF 4 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF 5 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\EXAMPLE01.DBF RMAN> |
RMAN> BACKUP TABLESPACE USERS; Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T160551_BSKSC02G_.BKP tag=TAG20150705T160551 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |
RMAN> LIST BACKUP OF TABLESPACE USERS; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 1.15G DISK 00:00:50 05-JUL-15 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150705T153438 Piece Name: E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T153438_BSKQJJHS_.BKP List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 4 Full 3406018 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 3 Full 1.15G DISK 00:00:46 05-JUL-15 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150705T160031 Piece Name: E:\DB_BK\BAK_03QB9U0V_1_1 List of Datafiles in backup set 3 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 4 Full 3407567 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 5 Full 4.02M DISK 00:00:01 05-JUL-15 BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20150705T160551 Piece Name: E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T160551_BSKSC02G_.BKP List of Datafiles in backup set 5 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 4 Full 3408110 05-JUL-15 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF RMAN> |
RMAN> DELETE BACKUPSET 5; using channel ORA_DISK_1 List of Backup Pieces BP Key BS Key Pc# Cp# Status Device Type Piece Name ------- ------- --- --- ----------- ----------- ---------- 5 5 1 1 AVAILABLE DISK E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T160551_BSKSC02G_.BKP Do you really want to delete the above objects (enter YES or NO)? YES deleted backup piece backup piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T160551_BSKSC02G_.BKP RECID=5 STAMP=884275552 Deleted 1 objects RMAN> |
SQL> select file#,name from v$datafile; FILE# NAME ---------- -------------------------------------------------------------------------------- 1 E:\APP\TIANPAN\ORADATA\PTIAN\SYSTEM01.DBF 2 E:\APP\TIANPAN\ORADATA\PTIAN\SYSAUX01.DBF 3 E:\APP\TIANPAN\ORADATA\PTIAN\UNDOTBS01.DBF 4 E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF 5 E:\APP\TIANPAN\ORADATA\PTIAN\EXAMPLE01.DBF |
RMAN> BACKUP DATAFILE 'E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF'; Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=E:\APP\TIANPAN\ORADATA\PTIAN\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNNDF_TAG20150705T163203_BSKTW49M_.BKP tag=TAG20150705T163203 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |
RMAN> BACKUP CURRENT CONTROLFILE; Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NCNNF_TAG20150705T163456_BSKV1L70_.BKP tag=TAG20150705T163456 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |
RMAN> LIST BACKUP OF CONTROLFILE; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2 Full 9.36M DISK 00:00:02 05-JUL-15 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20150705T153438 Piece Name: E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NCSNF_TAG20150705T153438_BSKQL8JB_.BKP Control File Included: Ckp SCN: 3406084 Ckp time: 05-JUL-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 4 Full 9.36M DISK 00:00:01 05-JUL-15 BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20150705T160031 Piece Name: E:\DB_BK\BAK_04QB9U2N_1_1 Control File Included: Ckp SCN: 3407825 Ckp time: 05-JUL-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 7 Full 9.33M DISK 00:00:02 05-JUL-15 BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20150705T163456 Piece Name: E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NCNNF_TAG20150705T163456_BSKV1L70_.BKP Control File Included: Ckp SCN: 3409951 Ckp time: 05-JUL-15 RMAN> |
RMAN> BACKUP ARCHIVELOG ALL; Starting backup at 05-JUL-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=86 RECID=1 STAMP=872864663 input archived log thread=1 sequence=87 RECID=2 STAMP=882545743 input archived log thread=1 sequence=88 RECID=3 STAMP=882551016 input archived log thread=1 sequence=89 RECID=4 STAMP=882725211 input archived log thread=1 sequence=90 RECID=5 STAMP=882810557 input archived log thread=1 sequence=91 RECID=6 STAMP=883318762 input archived log thread=1 sequence=92 RECID=7 STAMP=883346472 input archived log thread=1 sequence=93 RECID=8 STAMP=884017140 input archived log thread=1 sequence=94 RECID=9 STAMP=884086400 input archived log thread=1 sequence=95 RECID=10 STAMP=884180851 input archived log thread=1 sequence=96 RECID=11 STAMP=884264845 input archived log thread=1 sequence=97 RECID=12 STAMP=884277664 channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_ANNNN_TAG20150705T164104_BSKVF1MB_.BKP tag=TAG20150705T164104 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 Finished backup at 05-JUL-15 RMAN> |
RMAN> BACKUP CURRENT CONTROLFILE PLUS ARCHIVELOG; Starting backup at 05-JUL-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=86 RECID=1 STAMP=872864663 input archived log thread=1 sequence=87 RECID=2 STAMP=882545743 input archived log thread=1 sequence=88 RECID=3 STAMP=882551016 input archived log thread=1 sequence=89 RECID=4 STAMP=882725211 input archived log thread=1 sequence=90 RECID=5 STAMP=882810557 input archived log thread=1 sequence=91 RECID=6 STAMP=883318762 input archived log thread=1 sequence=92 RECID=7 STAMP=883346472 input archived log thread=1 sequence=93 RECID=8 STAMP=884017140 input archived log thread=1 sequence=94 RECID=9 STAMP=884086400 input archived log thread=1 sequence=95 RECID=10 STAMP=884180851 input archived log thread=1 sequence=96 RECID=11 STAMP=884264845 input archived log thread=1 sequence=97 RECID=12 STAMP=884277664 input archived log thread=1 sequence=98 RECID=13 STAMP=884277911 channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_ANNNN_TAG20150705T164511_BSKVNRLQ_.BKP tag=TAG20150705T164511 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 Finished backup at 05-JUL-15 Starting backup at 05-JUL-15 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NCNNF_TAG20150705T164527_BSKVO90S_.BKP tag=TAG20150705T164527 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 Starting backup at 05-JUL-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=99 RECID=14 STAMP=884277931 channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_ANNNN_TAG20150705T164531_BSKVOD0M_.BKP tag=TAG20150705T164531 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 05-JUL-15 RMAN> |
RMAN> BACKUP SPFILE; Starting backup at 05-JUL-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=138 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 05-JUL-15 channel ORA_DISK_1: finished piece 1 at 05-JUL-15 piece handle=E:\APP\TIANPAN\FLASH_RECOVERY_AREA\PTIAN\BACKUPSET\2015_07_05\O1_MF_NNSNF_TAG20150705T164858_BSKVVTPK_.BKP tag=TAG20150705T164858 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JUL-15 RMAN> |