1進入rman
rman target /?
2:列出所有歸檔日志的路徑
LIST ARCHIVELOG ALL;?
3.然后在執行 crosscheck archivelog all;(檢查 RMAN 存儲庫中記錄的歸檔日志是否在磁盤或備份存儲中實際存在。
4.然后在執行 delete noprompt expired archivelog all;(刪除所有在 crosscheck 中被標記為 EXPIRED 的歸檔日志。noprompt:不提示用戶確認,直接執行刪除。)
5然后在執行 delete noprompt archivelog all completed before 'sysdate-7';(刪除完成時間在 7 天前的歸檔日志。注意:這僅刪除歸檔日志,并不會影響數據庫運行,但請確保這些日志已經被備份。)
命令記錄:
cat >>del_ora_log.rman <<EOF
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt force archivelog until time 'sysdate -3';?
exit;
EOF
? select sequence#, name from v$archived_log;
select name,open_mode,database_role from v$database;
強制刪除
delete noprompt force archivelog until time 'SYSDATE-3';
select * from V$FLASH_RECOVERY_AREA_USAGE;
show parameter db_recovery_file_dest
select * from v$recovery_file_dest;
select * from v$recovery_file_dest;