不完全恢復,操作過程,我的備份資料庫出現此類問題。

jinqibingl發表於2012-10-04

不完全恢復,操作過程,我的備份資料庫出現此類問題。  



 SQL>host oerr ora 314
00314, 00000, "log %s of thread %s, expected sequence# %s doesn't match %s"
// *Cause:  The online log is corrupted or is an old version.
// *Action: Find and install correct version of log or reset logs.


SQL> startup
instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1266392 bytes
Variable Size             138415400 bytes
Database Buffers           25165824 bytes
Redo Buffers                2924544 bytes
Database mounted.
ORA-00314: log 2 of thread 1, expected sequence# 53 doesn't match 2
ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/xxxdb/redo02.log'


select open_mode from v$database;

SQL> select open_mode from v$database;

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

 select group#,sequence#,archived,status from v$log;
 
 SQL> host oerr ora 314
00314, 00000, "log %s of thread %s, expected sequence# %s doesn't match %s"
// *Cause:  The online log is corrupted or is an old version.
// *Action: Find and install correct version of log or reset logs.


>alter database clear unarchived logfile group 1                             
ORA-01624: log 1 needed for crash recovery of thread 1                     
ORA-00312: online log 1 thread 1: '/dbase/oracle7/dbs/log1orac.dbf'


alter database clear unarchived logfile group 1

SQL>  select group#,sequence#,archived,status from v$log;

    GROUP#  SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
         1         52 YES INACTIVE
         3         51 YES INACTIVE
         2         53 NO  CURRENT
alter database clear unarchived logfile group 2        


SQL> alter database clear unarchived logfile group 2 
  2  ;
alter database clear unarchived logfile group 2
*
ERROR at line 1:
ORA-01624: log 2 needed for crash recovery of instance xxxdb (thread 1)
ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/xxxdb/redo02.log'


ORA-00314:
    log string of thread string, expected sequence# string doesn't match string
Cause:     The online log is corrupted or is an old version.
Action:     Find and install correct version of log or reset logs.


SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open


SQL>  select group#,sequence#,archived,status from v$log;

    GROUP#  SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
         1         52 YES INACTIVE
         3         51 YES INACTIVE
         2         53 NO  CURRENT

SQL>recover database until cancel
ORA-00279: change 1692814 generated at 07/18/2010 21:10:36 needed for thread 1
ORA-00289: suggestion : /opt/oracle/oradata/archive/1_53_724438720.dbf
ORA-00280: change 1692814 for thread 1 is in sequence #53


Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/opt/oracle/oradata/archive/1_53_724438720.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log
'/opt/oracle/oradata/archive/1_53_724438720.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3


ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: file 1: '/opt/oracle/oradata/xxxdb/system01.dbf'


SQL>alter database open resetlogs
  2  ;





Sun Jul 18 23:55:36 2010
SMON: enabling cache recovery
Sun Jul 18 23:55:37 2010
Errors in file /opt/oracle/admin/xxxdb/udump/xxxdb_ora_4682.trc:
ORA-00600: internal error code, arguments: [2662], [0], [1692821], [0], [1693668], [8388617], [], []




Sun Jul 18 23:55:41 2010
Errors in file /opt/oracle/admin/xxxdb/udump/xxxdb_ora_4682.trc:
ORA-00600: internal error code, arguments: [2662], [0], [1692821], [0], [1693668], [8388617], [], []
Sun Jul 18 23:55:41 2010
Error 600 happened during db open, shutting down database
USER: terminating instance due to error 600

Instance terminated by USER, pid = 4682
ORA-1092 signalled during: alter database open resetlogs



SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1266392 bytes
Variable Size             138415400 bytes
Database Buffers           25165824 bytes
Redo Buffers                2924544 bytes
Database mounted.
SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string     UNDOTBS2

alter system set undo_tablespace='UNDOTBS1' scope=spfile;
show parameter undo
shutdown immediate
startup mount
show parameter undo
alter database open;


SQL> alter system set undo_tablespace='UNDOTBS1' scope=spfile;
show parameter undo

System altered.

SQL> shutdown immediate

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2
SQL> startup mount
show parameter undo
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1266392 bytes
Variable Size             138415400 bytes
Database Buffers           25165824 bytes
Redo Buffers                2924544 bytes
Database mounted.
SQL>
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1

SQL> alter database open;

Database altered.

參看:


4、複製有效的的全,並不完全恢復資料庫
可以採用獲取最近的SCN的辦法用until scn恢復或用until cnacel恢復
recover database until cancel
先選擇auto,儘量恢復可以利用的歸檔日誌,然後重新
recover database until cancel
這次輸入cancel,完成不完全恢復,也就是說恢復兩次。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9606200/viewspace-745630/,如需轉載,請註明出處,否則將追究法律責任。

相關文章