使用RMAN常用命令的演示
[@more@]RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
RMAN> report schema;
Report of database schema
File K-bytes Tablespace RB segs Datafile Name
---- ---------- -------------------- ------- -------------------
1 256000 SYSTEM YES /opt/oracle/localdata/system01.dbf
2 204800 UNDOTBS1 YES /opt/oracle/localdata/undotbs01.dbf
3 25600 INDX NO /opt/oracle/localdata/indx01.dbf
4 10240 TOOLS NO /opt/oracle/localdata/tools01.dbf
5 25600 USERS NO /opt/oracle/localdata/users01.dbf
6 512000 *** NO /opt/oracle/localdata/***.dbf
8 2097152 SD NO /opt/oracle/localdata/sd.dbf
9 3145728 WANG NO /opt/oracle/localdata/wang.dbf
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 270621 21-MAR-08
Backup Piece 270622 21-MAR-08 bk_ora_340_1_649942781
Backup Set 270638 21-MAR-08
Backup Piece 270639 21-MAR-08 al_ora_649943196_341_1
Backup Set 270644 21-MAR-08
Backup Piece 270645 21-MAR-08 c-3933374767-20080321-00
RMAN> report unrecoverable;
Report of files that need backup due to unrecoverable operations
File Type of Backup Required Name
---- ----------------------- -----------------------------------
############# show backup summary #############
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
270621 B 0 A SBT_TAPE 21-MAR-08 1 1 DB_LEVEL0
270638 B A A SBT_TAPE 21-MAR-08 1 1 TAG20080321T114636
270644 B F A SBT_TAPE 21-MAR-08 1 1
270690 B F A DISK 21-MAR-08 1 1
270698 B A A SBT_TAPE 21-MAR-08 1 1 TAG20080321T115856
270702 B F A SBT_TAPE 21-MAR-08 1 1
270939 B 0 A SBT_TAPE 21-MAR-08 1 1 DB_LEVEL0
############## show all backup ###############
RMAN>list backup;
S Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
277716 18M SBT_TAPE 00:02:32 08-APR-08
BP Key: 277717 Status: AVAILABLE Tag: TAG20080408T115101
Piece Name: al_ora_651498661_443_1
List of Archived Logs in backup set 277716
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 49 86502872 07-APR-08 86531859 07-APR-08
1 50 86531859 07-APR-08 86572453 08-APR-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
277721 Full 1M SBT_TAPE 00:00:30 08-APR-08
BP Key: 277722 Status: AVAILABLE Tag:
Piece Name: c-3933374767-20080408-00
SPFILE Included: Modification time: 21-MAR-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
278048 Incr 0 468M SBT_TAPE 00:01:56 08-APR-08
BP Key: 278049 Status: AVAILABLE Tag: DB_LEVEL0
Piece Name: bk_ora_445_1_651534652
List of Datafiles in backup set 278048
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 86601338 08-APR-08 /opt/oracle/***/system01.dbf
2 0 Incr 86601338 08-APR-08 /opt/oracle/***/undotbs01.dbf
3 0 Incr 86601338 08-APR-08 /opt/oracle/***/indx01.dbf
4 0 Incr 86601338 08-APR-08 /opt/oracle/***/tools01.dbf
5 0 Incr 86601338 08-APR-08 /opt/oracle/***/users01.dbf
6 0 Incr 86601338 08-APR-08 /opt/oracle/***/sXdgov.dbf
8 0 Incr 86601338 08-APR-08 /opt/oracle/***/sd.dbf
9 0 Incr 86601338 08-APR-08 /opt/oracle/***/wang.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
278059 Full 1M SBT_TAPE 00:00:29 08-APR-08
BP Key: 278060 Status: AVAILABLE Tag:
Piece Name: c-3933374767-20080408-01
SPFILE Included: Modification time: 21-MAR-08
############# show database backup ################
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
270621 Incr 0 487M SBT_TAPE 00:05:05 21-MAR-08
BP Key: 270622 Status: AVAILABLE Tag: DB_LEVEL0
Piece Name: bk_ora_340_1_649942781
List of Datafiles in backup set 270621
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/system01.dbf
2 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/undotbs01.dbf
3 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/indx01.dbf
4 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/tools01.dbf
5 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/users01.dbf
6 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/***.dbf
8 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/sd.dbf
9 0 Incr 85213366 21-MAR-08 /opt/oracle/localdata/wang.dbf
############## show controlfile ############
RMAN>list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
274807 Full 1M DISK 00:00:00 31-MAR-08
BP Key: 274809 Status: AVAILABLE Tag:
Piece Name: /opt/oracle/product/9.2.0.4/dbs/c-3933374767-20080331-02
Controlfile Included: Ckp SCN: 86006674 Ckp time: 31-MAR-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
274835 Full 1M SBT_TAPE 00:00:29 31-MAR-08
BP Key: 274836 Status: AVAILABLE Tag:
Piece Name: c-3933374767-20080331-03
Controlfile Included: Ckp SCN: 86035866 Ckp time: 31-MAR-08
############## show spfile ###################
RMAN> list backup of spfile;
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
277721 Full 0 SBT_TAPE 00:00:30 08-APR-08
BP Key: 277722 Status: AVAILABLE Tag:
Piece Name: c-3933374767-20080408-00
SPFILE Included: Modification time: 21-MAR-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
278059 Full 0 SBT_TAPE 00:00:29 08-APR-08
BP Key: 278060 Status: AVAILABLE Tag:
Piece Name: c-3933374767-20080408-01
SPFILE Included: Modification time: 21-MAR-08
############ show archivelog all ################
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
270638 242K SBT_TAPE 00:01:36 21-MAR-08
BP Key: 270639 Status: AVAILABLE Tag: TAG20080321T114636
Piece Name: al_ora_649943196_341_1
List of Archived Logs in backup set 270638
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 1 85212794 21-MAR-08 85212998 21-MAR-08
1 2 85212998 21-MAR-08 85213363 21-MAR-08
1 3 85213363 21-MAR-08 85213707 21-MAR-08
############ show copy all ######################
RMAN> list copy;
List of Controlfile Copies
Key S Completion Time Ckp SCN Ckp Time Name
------- - --------------- ---------- --------------- ----
278172 A 09-APR-08 86601440 08-APR-08 /opt/oracle/backup_test.ctl
278170 A 09-APR-08 86601440 08-APR-08 /opt/oracle/
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
270615 1 463 A 11-MAR-08 /opt/oracle/***/archive/1_463.dbf
278046 1 51 A 08-APR-08 /opt/oracle/***/archive/1_51.dbf
########### crosscheck all ###################
MAN> crosscheck backup;
using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/opt/oracle/product/9.2.0.4/dbs/c-3933374767-20080321-01 recid=329 stamp=649943581
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/opt/oracle/rman/20080324b7jc2k62 recid=342 stamp=650203331
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/opt/oracle/rman/bdjc2kgr_1_120080324 recid=343 stamp=650203675
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/opt/oracle/rman/bcjc2kgr_1_120080324 recid=344 stamp=650203675
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/opt/oracle/rman/bejc2kgr_1_120080324 recid=345 stamp=65020367
############## list expired archivelog ############
RMAN> list expired archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
278191 1 52 X 08-APR-08 /opt/oracle/oradata/***/archive/1_52.dbf
########### list expired backup ##############
RMAN> list expired backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
271884 Full 42M DISK 00:00:12 24-MAR-08
BP Key: 271891 Status: EXPIRED Tag: TAG20080324T120210
Piece Name: /opt/oracle/rman/20080324b7jc2k62
List of Datafiles in backup set 271884
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 Full 85427718 24-MAR-08 /opt/oracle/localdata/indx01.dbf
5 Full 85427718 24-MAR-08 /opt/oracle/localdata/users01.dbf
8 Full 85427718 24-MAR-08 /opt/oracle/localdata/sd.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
271885 Full 42M DISK 00:00:09 24-MAR-08
BP Key: 271892 Status: EXPIRED Tag: TAG20080324T120755
Piece Name: /opt/oracle/rman/bdjc2kgr_1_120080324
List of Datafiles in backup set 271885
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 Full 85428002 24-MAR-08 /opt/oracle/localdata/indx01.dbf
5 Full 85428002 24-MAR-08 /opt/oracle/localdata/users01.dbf
8 Full 85428002 24-MAR-08 /opt/oracle/localdata/sd.dbf
############ report obsolete ###############
MAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 270621 21-MAR-08
Backup Piece 270622 21-MAR-08 bk_ora_340_1_649942781
Backup Set 270638 21-MAR-08
Backup Piece 270639 21-MAR-08 al_ora_649943196_341_1
Backup Set 270644 21-MAR-08
Backup Piece 270645 21-MAR-08 c-3933374767-20080321-00
########## delete expired backup ################
RMAN> crosscheck backup;
RMAN> list expired backup;
RMAN> delete expired backup;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
271891 271884 1 1 EXPIRED DISK /opt/oracle/rman/20080324b7jc2k62
271892 271885 1 1 EXPIRED DISK /opt/oracle/rman/bdjc2kgr_1_120080324
271893 271886 1 1 EXPIRED DISK /opt/oracle/rman/bcjc2kgr_1_120080324
271894 271887 1 1 EXPIRED DISK /opt/oracle/rman/bejc2kgr_1_120080324
275732 275730 1 1 EXPIRED DISK /opt/oracle/rman/rmanbakup***
Do you really want to delete the above objects (enter YES or NO)? y
deleted backup piece
backup piece handle=/opt/oracle/rman/20080324b7jc2k62 recid=342 stamp=650203331
deleted backup piece
backup piece handle=/opt/oracle/rman/bdjc2kgr_1_120080324 recid=343 stamp=650203675
deleted backup piece
backup piece handle=/opt/oracle/rman/bcjc2kgr_1_120080324 recid=344 stamp=650203675
deleted backup piece
backup piece handle=/opt/oracle/rman/bejc2kgr_1_120080324 recid=345 stamp=650203675
deleted backup piece
backup piece handle=/opt/oracle/rman/rmanbakup*** recid=395 stamp=650980801
Deleted 5 EXPIRED objects
########### delete expired archivelog ##############
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=19 devtype=DISK
validation succeeded for archived log
archive log filename=/opt/oracle/oradata/***/archive/1_463.dbf recid=469 stamp=649941833
validation succeeded for archived log
archive log filename=/opt/oracle/oradata/***/archive/1_51.dbf recid=520 stamp=651534651
validation failed for archived log
archive log filename=/opt/oracle/oradata/***/archive/1_52.dbf recid=521 stamp=651581447
Crosschecked 3 objects
RMAN> list expired archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
278191 1 52 X 08-APR-08 /opt/oracle/oradata/***/archive/1_52.dbf
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=19 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
278191 1 52 X 08-APR-08 /opt/oracle/oradata/***/archive/1_52.dbf
Do you really want to delete the above objects (enter YES or NO)? y
deleted archive log
archive log filename=/opt/oracle/oradata/***/archive/1_52.dbf recid=521 stamp=651581447
Deleted 1 EXPIRED objects
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/216109/viewspace-1002140/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/216109/viewspace-1002140/