删除online日志测试及ORA(2)

提示无法打开日志组1的日志文件,因为之前在OS层面已经将其删除了
 
--观察alert日志
[oracle@ora10g ora10g]$ cd /u01/app/oracle/admin/ora10g/bdump/
[oracle@ora10g bdump]$ tail -50f alert_ora10g.log
MMON started with pid=11, OS id=2970
Wed Jun 24 10:45:54 2015
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
CJQ0 started with pid=10, OS id=2968
MMNL started with pid=12, OS id=2972
Wed Jun 24 10:45:55 2015
ALTER DATABASE  MOUNT
Wed Jun 24 10:45:58 2015
Setting recovery target incarnation to 8
Wed Jun 24 10:45:58 2015
Successful mount of redo thread 1, with mount id 4202063779
Wed Jun 24 10:45:58 2015
Database mounted in Exclusive Mode
Completed: ALTER DATABASE  MOUNT
Wed Jun 24 10:45:59 2015
ALTER DATABASE OPEN
Wed Jun 24 10:45:59 2015
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid=16, OS id=2980
Wed Jun 24 10:45:59 2015
ARC0: Archival started
ARC1: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
Wed Jun 24 10:45:59 2015
Errors in file /u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product=RDBMS, facility=ORA; arguments: [1] [1]
ORA-00312: Message 312 not found; No message file for product=RDBMS, facility=ORA; arguments: [1] [1] [/u01/app/oracle/oradata/ora10g/redo01.log]
ORA-27037: Message 27037 not found; No message file for product=RDBMS, facility=ORA
Linux Error: 2: No such file or directory
Additional information: 3
Wed Jun 24 10:45:59 2015
Errors in file /u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product=RDBMS, facility=ORA; arguments: [1] [1]
ORA-00312: Message 312 not found; No message file for product=RDBMS, facility=ORA; arguments: [1] [1] [/u01/app/oracle/oradata/ora10g/redo01.log]
ORA-27037: Message 27037 not found; No message file for product=RDBMS, facility=ORA
Linux Error: 2: No such file or directory
Additional information: 3
Wed Jun 24 10:45:59 2015
ARC0: STARTING ARCH PROCESSES
ARC2: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC1 started with pid=17, OS id=2982
Wed Jun 24 10:46:00 2015
ARC1: Becoming the heartbeat ARCH
ARC2 started with pid=18, OS id=2984
Wed Jun 24 10:46:00 2015
ORA-313 signalled during: ALTER DATABASE OPEN...
 
发现确实是读取redo01.log文件错误,无法OPEN数据库,只停留在MOUNT状态

--清空刚才被删除的2个在线日志文件(相当于重建)
SYS@ora10g> select open_mode from v$database;

OPEN_MODE
----------
MOUNTED

SYS@ora10g> alter database clear logfile group 1;

Database altered.

SYS@ora10g> alter database open;
alter database open
*
ERROR at line 1:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/ora10g/redo03.log'

SYS@ora10g> alter database clear logfile group 3;

Database altered.

SYS@ora10g> alter database open;

Database altered.

SYS@ora10g> conn zlm/zlm
Connected.
ZLM@ora10g> select count(*) from t1;

COUNT(*)
----------
10

ZLM@ora10g>

尽管删除了2个非在线日志文件,那么就可以很方便的将数据库打开,只要重建被删除的日志文件就行(通过CLEAR操作),且数据并不会丢失(因为是shutdown immediate方式关闭库的)
 
 
--继续查看alert日志内容
Wed Jun 24 10:48:55 2015
alter database clear logfile group 1
Wed Jun 24 10:48:56 2015
Clearing online log 1 of thread 1 sequence number 20
Wed Jun 24 10:48:56 2015
Errors in file /u01/app/oracle/admin/ora10g/udump/ora10g_ora_2978.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/ora10g/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Completed: alter database clear logfile group 1
Wed Jun 24 10:49:03 2015
alter database open
Wed Jun 24 10:49:03 2015
Errors in file /u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product=RDBMS, facility=ORA; arguments: [3] [1]
ORA-00312: Message 312 not found; No message file for product=RDBMS, facility=ORA; arguments: [3] [1] [/u01/app/oracle/oradata/ora10g/redo03.log]
ORA-27037: Message 27037 not found; No message file for product=RDBMS, facility=ORA
Linux Error: 2: No such file or directory
Additional information: 3
Wed Jun 24 10:49:03 2015
Errors in file /u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product=RDBMS, facility=ORA; arguments: [3] [1]
ORA-00312: Message 312 not found; No message file for product=RDBMS, facility=ORA; arguments: [3] [1] [/u01/app/oracle/oradata/ora10g/redo03.log]
ORA-27037: Message 27037 not found; No message file for product=RDBMS, facility=ORA
Linux Error: 2: No such file or directory
Additional information: 3
ORA-313 signalled during: alter database open...
Wed Jun 24 10:49:14 2015
alter database clear logfile group 3
Wed Jun 24 10:49:14 2015
Clearing online log 3 of thread 1 sequence number 19
Wed Jun 24 10:49:14 2015
Errors in file /u01/app/oracle/admin/ora10g/udump/ora10g_ora_2978.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/ora10g/redo03.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Completed: alter database clear logfile group 3
Wed Jun 24 10:49:22 2015
alter database open
Wed Jun 24 10:49:22 2015
Thread 1 advanced to log sequence 22
Thread 1 opened at log sequence 22
  Current log# 1 seq# 22 mem# 0: /u01/app/oracle/oradata/ora10g/redo01.log
Successful open of redo thread 1
Wed Jun 24 10:49:23 2015
db_recovery_file_dest_size of 2048 MB is 0.04% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Wed Jun 24 10:49:23 2015
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Jun 24 10:49:23 2015
SMON: enabling cache recovery
Wed Jun 24 10:49:23 2015
Successfully onlined Undo Tablespace 1.
Wed Jun 24 10:49:23 2015
SMON: enabling tx recovery
Wed Jun 24 10:49:24 2015
Database Characterset is ZHS16GBK
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=19, OS id=2993
Wed Jun 24 10:49:31 2015
Completed: alter database open

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6d9cdedd800e70452f82f714bd7e9586.html