Tuesday, June 16, 2015

Recover lost of redo log scenarios with database clean shutdown

oracle@solaris112:/u01/app/oracle/oradata/orcl2$ rm redo0*
oracle@solaris112:/u01/app/oracle/oradata/orcl2$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jun 17 07:21:29 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1258291200 bytes
Fixed Size                  3003176 bytes
Variable Size             838864088 bytes
Database Buffers          402653184 bytes
Redo Buffers               13770752 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 2365
Session ID: 1 Serial number: 24573

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
oracle@solaris112:/u01/app/oracle/oradata/orcl2$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jun 17 07:22:14 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1258291200 bytes
Fixed Size                  3003176 bytes
Variable Size             838864088 bytes
Database Buffers          402653184 bytes
Redo Buffers               13770752 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;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required


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> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
oracle@solaris112:/u01/app/oracle/oradata/orcl2$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Jun 17 07:23:13 2015

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL2 (DBID=846932035, not open)

RMAN> recover database;

Starting recover at 17-JUN-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 17-JUN-15

RMAN> alter database open resetlogs;

Statement processed

No comments:

Post a Comment