oracle非归档模式下面的日志文件被意外的破坏的恢复方法
2010-01-06 21:45
871 查看
1,在非current状态下
如果我们直接删除物理的日志文件,会导致下次启动数据库的时候不能启动数据库,我们就只有删除这个group后在启动数据库就可以了。
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /sof/oracle/oradata/orcl/redo03.log
2 /sof/oracle/oradata/orcl/redo02.log
1 /sof/oracle/oradata/orcl/redo01.log
4 /sof/oracle/oradata/orcl/redo04.log
SQL> ho rm /sof/oracle/oradata/orcl/redo04.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/sof/oracle/oradata/orcl/redo04.log'
SQL> alter database drop logfile group 4
2 ;
Database altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
2.下面是删除current状态的日志文件。
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 INACTIVE
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/sof/oracle/oradata/orcl/redo03.log
2
/sof/oracle/oradata/orcl/redo02.log
1
/sof/oracle/oradata/orcl/redo01.log
SQL> ho rm /sof/oracle/oradata/orcl/redo02.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/sof/oracle/oradata/orcl/redo02.log'
介质恢复
SQL> recover database using backup controlfile;
ORA-00279: change 1131887 generated at 01/06/2010 01:52:36 needed for thread 1
ORA-00289: suggestion :
/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc
ORA-00280: change 1131887 for thread 1 is in sequence #1
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
'/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
修改这个参数是为了让数据库启动时不检查日志文件的一致性
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> shutdowm immediate;
SP2-0734: unknown command beginning "shutdowm i..." - rest of line ignored.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
这个命令是reset log
SQL> alter database open resetlogs;
Database altered.
SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 CURRENT
2 UNUSED
3 UNUSED
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/sof/oracle/oradata/orcl/redo03.log
2
/sof/oracle/oradata/orcl/redo02.log
1
/sof/oracle/oradata/orcl/redo01.log
如果我们直接删除物理的日志文件,会导致下次启动数据库的时候不能启动数据库,我们就只有删除这个group后在启动数据库就可以了。
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /sof/oracle/oradata/orcl/redo03.log
2 /sof/oracle/oradata/orcl/redo02.log
1 /sof/oracle/oradata/orcl/redo01.log
4 /sof/oracle/oradata/orcl/redo04.log
SQL> ho rm /sof/oracle/oradata/orcl/redo04.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/sof/oracle/oradata/orcl/redo04.log'
SQL> alter database drop logfile group 4
2 ;
Database altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
2.下面是删除current状态的日志文件。
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 INACTIVE
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/sof/oracle/oradata/orcl/redo03.log
2
/sof/oracle/oradata/orcl/redo02.log
1
/sof/oracle/oradata/orcl/redo01.log
SQL> ho rm /sof/oracle/oradata/orcl/redo02.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/sof/oracle/oradata/orcl/redo02.log'
介质恢复
SQL> recover database using backup controlfile;
ORA-00279: change 1131887 generated at 01/06/2010 01:52:36 needed for thread 1
ORA-00289: suggestion :
/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc
ORA-00280: change 1131887 for thread 1 is in sequence #1
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
'/sof/oracle/flash_recovery_area/ORCL/archivelog/2010_01_06/o1_mf_1_1_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
修改这个参数是为了让数据库启动时不检查日志文件的一致性
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> shutdowm immediate;
SP2-0734: unknown command beginning "shutdowm i..." - rest of line ignored.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
这个命令是reset log
SQL> alter database open resetlogs;
Database altered.
SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 188743680 bytes
Fixed Size 1218460 bytes
Variable Size 67111012 bytes
Database Buffers 117440512 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 CURRENT
2 UNUSED
3 UNUSED
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/sof/oracle/oradata/orcl/redo03.log
2
/sof/oracle/oradata/orcl/redo02.log
1
/sof/oracle/oradata/orcl/redo01.log
相关文章推荐
- Oracle在Rman备份模式下误删归档日志文件解决方法
- Oracle丢失归档日志文件的数据库恢复方法
- ORACLE基础学习-RMAN应用之(归档模式无备份,丢失数据文件的恢复)
- oracle 删不掉归档日志文件的解决方法
- oracle归档日志超出了恢复闪回恢复区(flash_recovery_area)限制的解决方法
- oracle的数据文件全部丢失,但有归档和重做日志,如何恢复?
- oracle归档日志超出了恢复闪回恢复区(flash_recovery_area)限制的解决方法
- Oracle rman不完全恢复(数据文件,归档日志,控制文件全部丢失)
- oracle 归档模式下删除current日志不完全恢复
- Oracle意外删除数据文件恢复方法
- oracle initialization or shutdown in progress与ORA-16038: 日志 5 序列号 126 无法归档 ORA-19809: 超出了恢复文件数的限
- rman实验之归档模式无备份,正常关机丢失当前联机重做日志文件的恢复
- ORA-00257归档日志写满的解决方法 背景: 在前一篇博客中我们提到了如何启动或关闭oracle的归档(ARCHIVELOG)模式,在我成功设定数据库为归档模式以后, 第二天再次尝试连接数据库,
- oracle 日志切换归档模式查看归档文件的产生
- ORACLE基础学习-RMAN应用--归档模式有备份,丢失数据文件恢复
- Oracle日志文件组成员丢失的恢复方法
- oracle 联机日志文件损坏的几种场景和恢复方法
- 【Oracle笔记】在线日志文件的恢复方法
- Oracle恢复(三)------归档模式下恢复数据文件
- RMAN实战14:用RMAN恢复ORACLE归档日志、控制文件、spfile及logminer的使用