模拟在线重做日志被删除的情况恢复

模拟在线重做日志被删除的情况恢复[@more@]

模拟在线重做日志被删除的情况恢复

添加一个在线重做日志组4

SQL> alter database add logfile group 4 ('e:redo4.log') size 10M;

数据库已更改。

SQL> select * from v$log

2 ;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

1 1 165 10240000 1 NO CURRENT

2 1 162 10240000 1 YES INACTIVE

3 1 164 10240000 1 YES INACTIVE

4 1 0 10485760 1 YES UNUSED

删除刚建立的日志文件组4

SQL> host

Microsoft Windows XP [版本 5.1.2600]

(C) 版权所有 1985-2001 Microsoft Corp.

E:>del redo4.log

切换日志组:

E:>exit

SQL> alter system switch logfile;

alter system switch logfile

*

1 行出现错误:

ORA-00313: 无法打开日志组 (用于线程 ) 的成员

SQL> conn /as sysdba

已连接到空闲例程。

数据库实例被关闭,这就是让日志切换的时候,系统发现下一个日志组不能用的时候,就会关闭数据库实例返回一个错误。

Wed May 09 10:33:21 2007

Errors in file e:oracleadminora10bdumpora10_lgwr_1608.trc:

ORA-00313: open failed for members of log group 4 of thread 1

ORA-00312: online log 4 thread 1: 'E:REDO4.LOG'

ORA-27041: unable to open file

OSD-04002: 无法打开文件

O/S-Error: (OS 2) 系统找不到指定的文件。

Wed May 09 10:33:21 2007

Errors in file e:oracleadminora10bdumpora10_lgwr_1608.trc:

ORA-00313: open failed for members of log group 4 of thread 1

ORA-00312: online log 4 thread 1: 'E:REDO4.LOG'

ORA-27041: unable to open file

OSD-04002: 无法打开文件

O/S-Error: (OS 2) 系统找不到指定的文件。

Wed May 09 10:33:21 2007

LGWR: terminating instance due to error 313

Wed May 09 10:33:21 2007

Errors in file e:oracleadminora10bdumpora10_q001_424.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:21 2007

Errors in file e:oracleadminora10bdumpora10_pmon_1104.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:22 2007

Errors in file e:oracleadminora10bdumpora10_dbw0_3036.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:23 2007

Errors in file e:oracleadminora10bdumpora10_reco_2184.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:23 2007

Errors in file e:oracleadminora10bdumpora10_ckpt_2980.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:23 2007

Errors in file e:oracleadminora10bdumpora10_smon_2576.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:23 2007

Errors in file e:oracleadminora10bdumpora10_psp0_2872.trc:

ORA-00313: open failed for members of log group of thread

Wed May 09 10:33:23 2007

Errors in file e:oracleadminora10bdumpora10_mman_1980.trc:

ORA-00313: open failed for members of log group of thread

Instance terminated by LGWR, pid = 1608

启动数据库:

SQL> startup

ORACLE 例程已经启动。

Total System Global Area 159383552 bytes

Fixed Size 1247876 bytes

Variable Size 79693180 bytes

Database Buffers 75497472 bytes

Redo Buffers 2945024 bytes

数据库装载完毕。

ORA-00313: 无法打开日志组 4 (用于线程 1) 的成员

ORA-00312: 联机日志 4 线程 1: 'E:REDO4.LOG'

恢复

SQL> alter database drop logfile group 4;

数据库已更改。

SQL> alter database open;

数据库已更改。

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

1 1 165 10240000 1 YES INACTIVE

2 1 166 10240000 1 NO CURRENT

3 1 164 10240000 1 YES INACTIVE

因为这时候,是在数据库的日志切换时候发生的实例崩溃,没有数据的丢失,所以可以这样恢复。

也可以使用,修改

SQL> alter database clear logfile group 4;

数据库已更改。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/222350/viewspace-914240/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/222350/viewspace-914240/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值