oracle 归档日志删除策略
如果设置了归档删除策略,delete archivelog all;如果加上 force 关键字可以删除。未设置归档删除策略时,
未设置归档删除策略时,
rman target /
delete archivelog all;
可以直接删除归档。
如果设置了归档删除策略,delete archivelog all; 不能删除。如果加上 force 关键字可以删除。
RMAN> configure archivelog deletion policy to backed up 1 times to disk;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
new RMAN configuration parameters are successfully stored
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name CDB1
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
237 1 366 A 28-APR-24
Name: /home/oracle/arch/1_366_1163583990.dbf
238 1 367 A 28-APR-24
Name: /home/oracle/arch/1_367_1163583990.dbf
RMAN> delete archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=278 device type=DISK
RMAN-08138: warning: archived log not deleted - must create more backups
archived log file name=/home/oracle/arch/1_366_1163583990.dbf thread=1 sequence=366
RMAN-08138: warning: archived log not deleted - must create more backups
archived log file name=/home/oracle/arch/1_367_1163583990.dbf thread=1 sequence=367
RMAN> delete noprompt archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=278 device type=DISK
RMAN-08138: warning: archived log not deleted - must create more backups
archived log file name=/home/oracle/arch/1_366_1163583990.dbf thread=1 sequence=366
RMAN-08138: warning: archived log not deleted - must create more backups
archived log file name=/home/oracle/arch/1_367_1163583990.dbf thread=1 sequence=367
RMAN> delete force noprompt archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=278 device type=DISK
List of Archived Log Copies for database with db_unique_name CDB1
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
237 1 366 A 28-APR-24
Name: /home/oracle/arch/1_366_1163583990.dbf
238 1 367 A 28-APR-24
Name: /home/oracle/arch/1_367_1163583990.dbf
deleted archived log
archived log file name=/home/oracle/arch/1_366_1163583990.dbf RECID=237 STAMP=1167479060
deleted archived log
archived log file name=/home/oracle/arch/1_367_1163583990.dbf RECID=238 STAMP=1167479061
Deleted 2 objects
RMAN> list archivelog all;
specification does not match any archived log in the repository
RMAN>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)