版本:Oracle 11.2.0.4.0
操作系统:linux redhat 6.4
问题描述:
开发人员通过PLSQL Developer 连接数据库报错,截图如下:
问题原因:
登录SYS用户查看V$FLASH_RECOVERY_AREA_USAGE 视图,发现归档日志满了。
select * from V$FLASH_RECOVERY_AREA_USAGE;
问题解决:
清除oracle归档日志
参考脚本:
按照各自的需要去实施。
export ORACLE_SID=pydb0
rman target /
host;
cd /oradata/pydb3/arch/
exit
crosscheck archivelog all; --->校验日志的可用性
list expired archivelog all; --->列出所有失效的归档日志
delete archivelog until sequence 16; --->删除log sequence为16及16之前的所有归档日志
delete archivelog all completed before 'sysdate-7'; --->删除系统时间7天以前的归档日志,不会删除闪回区有效的归档日志
delete archivelog all completed before 'sysdate - 1'; --->同上,1天以前的
delete archivelog from time 'sysdate-1'; --->注意这个命令,删除系统时间1天以内到现在的归档日志
delete noprompt archivelog all completed before 'sysdate'; --->该命令清除所有的归档日志
delete noprompt archivelog all;
实施脚本:
[root@dwtest ~]# su - oracle
[oracle@dwtest ~]$ export ORACLE_SID=hsdb1
[oracle@dwtest ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jun 1 16:09:22 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: HSDB1 (DBID=593078949)
RMAN> delete noprompt archivelog all completed before 'sysdate';
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=765 device type=DISK
List of Archived Log Copies for database with db_unique_name HSDB1
================忽略===============
补充:视图:V$FLASH_RECOVERY_AREA_USAGE