rman中關於archivelog的操作

舊夢依稀發表於2013-07-09

RMAN> list backup of archivelog all;
列出所有archive log 備份

RMAN> list backup of archivelog from logseq 100 until logseq 120;
列出archive log 從100到120

RMAN> list backup of archivelog sequence between 100 and 110;
列出archive log 從100到120
–說明:between……and只能使用sequence,而不能使用logseq

RMAN> list backup of archivelog from logseq 100;
列出seq大於等於100的archive log

RMAN> list backup of archivelog low logseq 120;
列出seq大於等於120的archive log

RMAN> list backup of archivelog sequence 100;
列出seq為100的archive log
–說明:在對於rman中關於archivelog的操作中logseq與sequence作用相同,但是建議儘量使用sequence

RMAN> list backup of archivelog logseq 85;
列出seq為85的archive log

RMAN> list backup of archivelog until logseq 85;
列出seq小於等於85的archive log

RMAN> list backup of archivelog high logseq 40;
列出seq小於等於40的archive log

RMAN> list backup of archivelog from time ‘sysdate-7′;
列出7天以前的archive log

RMAN> run {
2> set archivelog destination to ‘/opt/oracle/oradata/test/newlog’;
3> restore archivelog low logseq 40;
4> }
從seq為40開始,恢復到/opt/oracle/oradata/test/newlog中
–說明:list backup of archivelog中限定日誌的位置也適合restore archivelog

RMAN> backup archivelog sequence between 100 and 110 format ‘/tmp/text_test.rman’ delete input;
備份seq為100至110的archive log
–說明:list backup of archivelog中限定日誌的位置也適合backup archivelog

RMAN>DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘SYSDATE-7′;
刪除7天前archive log

RMAN>DELETE ARCHIVELOG low logseq 40;
刪除seq大於等於40的archive log

RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;
刪除無效archive log
–說明:DELETE ARCHIVELOG中限定日誌的位置也適合restore archivelog

 

轉自:http://www.xifenfei.com/1609.html

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

相關文章