Selasa, 15 Januari 2008

Recover REDOLOG

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-00322: log 5 of thread 1 is not current copy

ORA-00312: online log 5 thread 1: 'blablabla/blablabla/db01/redo/redo05.log'

Bueno. No importa. Acabo de hacer un backup en frío, así que:

SQL> alter database drop logfile group 5;

alter database drop logfile group 5

*

ERROR at line 1:

ORA-00350: log 5 of instance db01 (thread 1) needs to be archived

ORA-00312: online log 5 thread 1: 'blablabla/blablabla/db01/redo/redo05.log'

¡Coño! Pues quito el archive y ya está:

SQL> alter system archive log stop;
System altered.

SQL> alter database drop logfile group 5;

alter database drop logfile group 5

*

ERROR at line 1:

ORA-00350: log 5 of instance db01 (thread 1) needs to be archived

ORA-00312: online log 5 thread 1: 'blablabla/blablabla/db01/redo/redo05.log'

A ver si archivando a mano…

SQL> archive log all

ORA-16038: log 5 sequence# 1875 cannot be archived

ORA-00312: online log 5 thread 1: 'blablabla/blablabla/db01/redo/redo05.log'SQL> ALTER DATABASE OPEN;

ALTER DATABASE OPEN

*

ERROR at line 1:

ORA-00322: log 5 of thread 1 is not current copy

ORA-00312: online log 5 thread 1: 'blablabla/blablabla/db01/redo/redo05.log'

¡Joder! Esto se pone feo… ¿Cómo me cepillo el redolog file pocho sin necesidad de recuperar desde RMAN?

A ver si así…

SQL> SHUTDOWN IMMEDIATE;

ORA-01109: database not open
Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORA-32004: obsolete and/or deprecated parameter(s) specified

ORACLE instance started.

Total System Global Area 1610612736 bytes

Fixed Size 1262068 bytes

Variable Size 201330188 bytes

Database Buffers 1392508928 bytes

Redo Buffers 15511552 bytes

Database mounted.

SQL> recover database until cancel;

Media recovery complete.

SQL> alter database open resetlogs;

Database altered.

SQL> alter system archive log start;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select sysdate from dual;

SYSDATE

--------

08/10/07