系统环境:
案例:
客户数据库服务器的归档日志空间被塞满,未发现;DBA在发现日志切换被hang后,强制关了库,导致实例启动失败。
错误现象:
在做日志归档时,数据库被hang......
16:56:02 SYS@ prod>alter system switch logfile;
告警日志:
ORACLE Instance prod - Can not allocate log, archival required
Thread 1 cannot allocate new log, sequence 5
All online logs needed archiving
Current log# 1 seq# 4 mem# 0: /dsk1/oradata/prod/redo01a.log
Current log# 1 seq# 4 mem# 1: /dsk2/oradata/prod/redo01b.log
用户强制关库,重新启动:
16:37:38 SYS@ prod>startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 775948320 bytes
Database Buffers 54525952 bytes
Redo Buffers 2412544 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 13219
Session ID: 1 Serial number: 5
Instance 启动失败,告警日志提示:
Errors in file /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_11803.trc:
ORA-19502: write error on file "/dsk4/arch_prod/arch_1_79_827494678.log", block number 4097 (block size=512)
ORA-27072: File I/O error
Linux-x86_64 Error: 25: Inappropriate ioctl for device
Additional information: 4
Additional information: 4097
Additional information: 765440
ORA-19502: write error on file "/dsk4/arch_prod/arch_1_79_827494678.log", block number 4097 (block size=512)
Sun May 18 15:32:58 2014
ARC3 started with pid=23, OS id=11818
Errors in file /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_11803.trc:
ORA-19502: write error on file "/dsk4/arch_prod/arch_1_79_827494678.log", block number 4097 (block size=512)
ORA-27072: File I/O error
Linux-x86_64 Error: 25: Inappropriate ioctl for device
Additional information: 4
Additional information: 4097
Additional information: 765440
ORA-19502: write error on file "/dsk4/arch_prod/arch_1_79_827494678.log", block number 4097 (block size=512)
ARCH: I/O error 19502 archiving log 1 to '/dsk4/arch_prod/arch_1_79_827494678.log'
ARC1: Becoming the heartbeat ARCH
Errors in file /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_11803.trc:
ORA-16038: log 1 sequence# 79 cannot be archived
ORA-19502: write error on file "", block number (block size=)
ORA-00312: online log 1 thread 1: '/dsk1/oradata/prod/redo01a.log'
ORA-00312: online log 1 thread 1: '/dsk2/oradata/prod/redo01b.log'
USER (ospid: 11803): terminating the instance due to error 16038
Instance terminated by USER, pid = 11803
解决方法:
[oracle@rh6 prod]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Sun May 18 16:39:26 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
16:39:27 SYS@ prod>startup mount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 775948320 bytes
Database Buffers 54525952 bytes
Redo Buffers 2412544 bytes
Database mounted.
16:39:39 SYS@ prod>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 1 INACTIVE
3 3 CURRENT
2 2 INACTIVE
Elapsed: 00:00:00.06
Clear 未归档的日志组:
16:40:25 SYS@ prod>alter database clear logfile group 1;
alter database clear logfile group 1
*
ERROR at line 1:
ORA-00350: log 1 of instance prod (thread 1) needs to be archived
ORA-00312: online log 1 thread 1: '/dsk1/oradata/prod/redo01a.log'
ORA-00312: online log 1 thread 1: '/dsk2/oradata/prod/redo01b.log'
Elapsed: 00:00:00.02
16:40:47 SYS@ prod>alter database clear unarchived logfile group 1;
Database altered.
Elapsed: 00:00:02.46
16:41:02 SYS@ prod>alter database ope