oracle归档空间不足的问题(rman删除归档日志)

案例一:归档日志满,数据库用户无法登陆,业务异常
 
解决方案一(可以登录rman):
rman target /
 
RMAN> crosscheck archivelog all;
 
RMAN> delete archivelog until time 'sysdate-7';
 
RMAN> crosscheck archivelog all;
 
解决方案二(无法登陆rman)
1、登录数据库服务器,删除归档目录里面的数据库7天之前归档文件
2、删除归档文件之后,再次尝试登陆rman,
如果可以登录rman则:
rman target /
 
crosscheck archivelog all;
 
delete archivelog until time 'sysdate-7';
 
crosscheck archivelog all;
 
如果删除归档文件之后还是无法登陆rman,此时就要重启数据库。
 
 
最好的解决方法:
写定时任务,定时删除数据库7天前的归档日志文件。
 
[oracle@edgzrip1-PROD1 ~]$ cat delete_archivelog.sh
#!/bin/bash
source ~/profile_prod1
$ORACLE_HOME/bin/rman target / log=delete_archivelog.log<<eof
crosscheck archivelog all;
delete archivelog until time 'sysdate-7';
crosscheck archivelog all;
exit;
eof

posted @ 2019-11-22 18:18  orcl  阅读(1657)  评论(0编辑  收藏  举报