redo日志损坏恢复总结(八)

2014-11-24 12:23:11 · 作者: · 浏览: 8
SQL> set verify off
SQL> @getsp.sql
Enter value for par: allow_resetlogs_
KSPPINM KSPPSTVL KSPPDESC
-------------------------------------------------- -------------------- ------------------------------------------------------------
_allow_resetlogs_corruption FALSE allow resetlogs even if it will cause corruption
SQL>
该参数是在数据库 不一致的情况下,重置日志文件。
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 492707840 bytes
Fixed Size 2254544 bytes
Variable Size 322963760 bytes
Database Buffers 163577856 bytes
Redo Buffers 3911680 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/opt/app/oracle/oradata/RHYS/redo01.log'
ORA-27037: unable to obtain file status
Linux
-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> set linesize 200
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 460 52428800 512 1 NO CURRENT 5397348 27-OCT-13 2.8147E+14
4 1 457 52428800 512 1 YES INACTIVE 5397240 27-OCT-13 5397246 27-OCT-13
3 1 456 52428800 512 1 YES INACTIVE 5397237 27-OCT-13 5397240 27-OCT-13
2 1 0 52428800 512 1 YES UNUSED 5397347 27-OCT-13 5397348 27-OCT-13
SQL> alter database open resetlogs;
Database altered.
SQL>
重建实例然后使用expdp和impdp,将数据导出在导入数据库
SQL> create directory expdp as '/opt/app/oracle/oradata';
Directory created.
然后导出数据重建数据库,在导入数据。
总结:对于当前正在使用的日志的损坏,一般通过备份来修复,如果不行只能采用第二种设置隐含参数_allow_resetlogs_corruption来恢复。