归档模式下redo丢失或损坏(current状态)



归档模式下current logfile丢失或损坏恢复


+++++Session 1

SQL> set linesize 200 pagesize 2000
SQL> col member format a50
SQL> select * from v$log;

GROUP#   THREAD#  SEQUENCE#  BYTES  BLOCKSIZE MEMBERS ARC  STATUS    FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- -------------- -------------------------------
  1    1       4   52428800    512  1     NO   CURRENT  1670955       29-DEC-15  2.8147E+14
  2    1       2   20971520    512  1    YES  INACTIVE  1670943       29-DEC-15  1670949     29-DEC-15
  3    1       3   52428800    512  1    YES  INACTIVE  1670949       29-DEC-15  1670955     29-DEC-15

  
SQL>  select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER           IS_
---------- ------- ------- ------------------------------------------
  1    ONLINE  /u01/app/oracle/oradata/orcl/redo01.log       NO
  2    ONLINE  /u01/app/oracle/oradata/orcl/redo02.log       NO
  3    ONLINE  /u01/app/oracle/oradata/orcl/redo03.log       NO
 
SQL&get; alter system switch logfile;

System altered.


++++Session 2

[root@zw_test_26_75 ~]#  dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo01.log bs=512 count=10
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000121435 s, 0.0 kB/s
 


++++Session 1

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area  952020992 bytes
Fixed Size      2258960 bytes
Variable Size    314574832 bytes
Database Buffers   629145600 bytes
Redo Buffers      6041600 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
ORA-27048: skgfifi: file header information is invalid
Additional information: 13


SQL> recover database until cancel;
Media recovery complete.

alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00327: log 2 of thread 1, physical size  less than needed
ORA-00312: online log 2 thread 1: '/home/ora10g/oradata/roger/redo02.log'

创建pfile添加隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true


SQL> startup mount pfile='/tmp/pfile.ora';
ORACLE instance started.

Total System Global Area  952020992 bytes
Fixed Size      2258960 bytes
Variable Size    314574832 bytes
Database Buffers   629145600 bytes
Redo Buffers      6041600 bytes
Database mounted.


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.

或者下面那个错

SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [2130], [0], [8], [2], [], [], [], []


SQL> show parameter resetlog

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
_allow_resetlogs_corruption      boolean  TRUE
SQL> show parameter allow

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
_allow_error_simulation       boolean  TRUE
_allow_resetlogs_corruption      boolean  TRUE
SQL> alter database open;

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@zw_test_26_75 tmp]$ vi pfile.ora
去掉隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true


SQL> startup
ORACLE instance started.

Total System Global Area  952020992 bytes
Fixed Size      2258960 bytes
Variable Size    314574832 bytes
Database Buffers   629145600 bytes
Redo Buffers      6041600 bytes
Database mounted.
Database opened.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值