Cause :-
1. Unfortunately I have delete all data from a table. Table row movement was not enable. But I need to retrieve this data.
2. For this reason I want to flashback database but I have also delete
some archive log files from my system. This the reason flashback are not
completed.
3. When I want to open database from mounted mode i got this error.
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> alter database open;
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-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\APP\ORADATA\ORCL\SYSTEM01.DBF'
Solution :-
1. First take full database backup using RMAN from mount mode.
2. RESTORE DATABASE From RMAN.
3. Now RECOVER DATABASE From RMAN. It can get error. If you get an error open database using resetlogs from isqlplus.
If you can not take backup and restore you can try after
create control file.
RMAN> SHOW ALL;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\app\oradata\ORCL_RMAN_BACKUP\bkp_cf_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\app\oradata\ORCL_RMAN_BACKUP\bkp.%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFORCL.ORA'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'K:\ORCL_RMAN_BACKUP\bkp_cf_%F';
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\app\oradata\ORCL_RMAN_BACKUP\bkp_cf_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'K:\ORCL_RMAN_BACKUP\bkp_cf_%F';
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'K:\ORCL_RMAN_BACKUP\bkp.%U';
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\app\oradata\ORCL_RMAN_BACKUP\bkp.%U';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'K:\ORCL_RMAN_BACKUP\bkp.%U';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
RMAN> backup incremental level 0 database;
Starting backup at 17-JUL-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=D:\APP\ORADATA\SPFTL\TBFES.DBF
input datafile file number=00023 name=D:\APP\ORADATA\STLBAS\ORBIMG01.DBF
input datafile file number=00022 name=D:\APP\ORADATA\STLBAS\ORBIND01.DBF
input datafile file number=00003 name=D:\APP\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00010 name=D:\APP\ORADATA\SPFTL\DATA.DBF
input datafile file number=00001 name=D:\APP\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00004 name=D:\APP\ORADATA\ORCL\USERS01.DBF
input datafile file number=00019 name=D:\APP\ORADATA\STLBAS\ORBDT301.DBF
input datafile file number=00026 name=D:\APP\ORADATA\STLBAS\MYBANK01.DBF
input datafile file number=00014 name=D:\APP\ORADATA\STLBAS\ORBITS01.DBF
input datafile file number=00025 name=D:\APP\ORADATA\ORCL\APEX_DATA01.DBF
input datafile file number=00002 name=D:\APP\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00018 name=D:\APP\ORADATA\STLBAS\ORBDT201.DBF
input datafile file number=00017 name=D:\APP\ORADATA\STLBAS\ORBDT101.DBF
input datafile file number=00005 name=D:\APP\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00015 name=D:\APP\ORADATA\STLBAS\ORBMAS01.DBF
input datafile file number=00020 name=D:\APP\ORADATA\STLBAS\ORBLOG01.DBF
input datafile file number=00007 name=D:\APP\ORADATA\SPFTL\TRBFES.DBF
input datafile file number=00009 name=D:\APP\ORADATA\SPFTL\TBAML.DBF
input datafile file number=00011 name=D:\APP\ORADATA\SPFTL\TBSTRAN .DBF
input datafile file number=00028 name=D:\APP\ORADATA\ORCL\RECLAIM01.DBF
input datafile file number=00006 name=D:\APP\ORADATA\SPFTL\TBACNTS.DBF
input datafile file number=00013 name=D:\APP\ORADATA\SPFTL\STLBAS01.DBF
input datafile file number=00024 name=D:\APP\ORADATA\STLBAS\ORBBBR01.DBF
input datafile file number=00027 name=D:\APP\ORADATA\SPFTL\SHRINK_TEST.DBF
input datafile file number=00029 name=D:\APP\ORADATA\ORCL\RND_TBS.DBF
input datafile file number=00021 name=D:\APP\ORADATA\STLBAS\ORBMAV01.DBF
input datafile file number=00016 name=D:\APP\ORADATA\STLBAS\ORBSYS01.DBF
input datafile file number=00012 name=D:\APP\ORADATA\SPFTL\MIG_BCBL01.DBF
channel ORA_DISK_1: starting piece 1 at 17-JUL-14
channel ORA_DISK_1: finished piece 1 at 17-JUL-14
piece handle=K:\ORCL_RMAN_BACKUP\BKP.04PDLFP7_1_1 tag=TAG20140717T230301 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:25:55
Finished backup at 17-JUL-14
RMAN-06497: WARNING: control file is not current, control file AUTOBACKUP skipped
RMAN> SHUTDOWN ABORT;
Oracle instance shut down
RMAN> STARTUP FORCE MOUNT;
Oracle instance started
database mounted
Total System Global Area 753278976 bytes
Fixed Size 1374724 bytes
Variable Size 520095228 bytes
Database Buffers 226492416 bytes
Redo Buffers 5316608 bytes
RMAN> RESTORE DATABASE;
Starting restore at 17-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to D:\APP\ORADATA\ORCL\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to D:\APP\ORADATA\ORCL\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00003 to D:\APP\ORADATA\ORCL\UNDOTBS01.DBF
channel ORA_DISK_1: restoring datafile 00004 to D:\APP\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to D:\APP\ORADATA\ORCL\EXAMPLE01.DBF
channel ORA_DISK_1: restoring datafile 00006 to D:\APP\ORADATA\SPFTL\TBACNTS.DBF
channel ORA_DISK_1: restoring datafile 00007 to D:\APP\ORADATA\SPFTL\TRBFES.DBF
channel ORA_DISK_1: restoring datafile 00008 to D:\APP\ORADATA\SPFTL\TBFES.DBF
channel ORA_DISK_1: restoring datafile 00009 to D:\APP\ORADATA\SPFTL\TBAML.DBF
channel ORA_DISK_1: restoring datafile 00010 to D:\APP\ORADATA\SPFTL\DATA.DBF
channel ORA_DISK_1: restoring datafile 00011 to D:\APP\ORADATA\SPFTL\TBSTRAN .DBF
channel ORA_DISK_1: restoring datafile 00012 to D:\APP\ORADATA\SPFTL\MIG_BCBL01.DBF
channel ORA_DISK_1: restoring datafile 00013 to D:\APP\ORADATA\SPFTL\STLBAS01.DBF
channel ORA_DISK_1: restoring datafile 00014 to D:\APP\ORADATA\STLBAS\ORBITS01.DBF
channel ORA_DISK_1: restoring datafile 00015 to D:\APP\ORADATA\STLBAS\ORBMAS01.DBF
channel ORA_DISK_1: restoring datafile 00016 to D:\APP\ORADATA\STLBAS\ORBSYS01.DBF
channel ORA_DISK_1: restoring datafile 00017 to D:\APP\ORADATA\STLBAS\ORBDT101.DBF
channel ORA_DISK_1: restoring datafile 00018 to D:\APP\ORADATA\STLBAS\ORBDT201.DBF
channel ORA_DISK_1: restoring datafile 00019 to D:\APP\ORADATA\STLBAS\ORBDT301.DBF
channel ORA_DISK_1: restoring datafile 00020 to D:\APP\ORADATA\STLBAS\ORBLOG01.DBF
channel ORA_DISK_1: restoring datafile 00021 to D:\APP\ORADATA\STLBAS\ORBMAV01.DBF
channel ORA_DISK_1: restoring datafile 00022 to D:\APP\ORADATA\STLBAS\ORBIND01.DBF
channel ORA_DISK_1: restoring datafile 00023 to D:\APP\ORADATA\STLBAS\ORBIMG01.DBF
channel ORA_DISK_1: restoring datafile 00024 to D:\APP\ORADATA\STLBAS\ORBBBR01.DBF
channel ORA_DISK_1: restoring datafile 00025 to D:\APP\ORADATA\ORCL\APEX_DATA01.DBF
channel ORA_DISK_1: restoring datafile 00026 to D:\APP\ORADATA\STLBAS\MYBANK01.DBF
channel ORA_DISK_1: restoring datafile 00027 to D:\APP\ORADATA\SPFTL\SHRINK_TEST.DBF
channel ORA_DISK_1: restoring datafile 00028 to D:\APP\ORADATA\ORCL\RECLAIM01.DBF
channel ORA_DISK_1: restoring datafile 00029 to D:\APP\ORADATA\ORCL\RND_TBS.DBF
channel ORA_DISK_1: reading from backup piece K:\ORCL_RMAN_BACKUP\BKP.04PDLFP7_1_1
channel ORA_DISK_1: piece handle=K:\ORCL_RMAN_BACKUP\BKP.04PDLFP7_1_1 tag=TAG20140717T230301
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:16:05
Finished restore at 17-JUL-14
RMAN> RECOVER DATABASE;
Starting recover at 17-JUL-14
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=1556
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/17/2014 23:56:09
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1556 and starting SCN of 390117984
RMAN>
SQL> alter database open resetlogs;
Database altered.
SQL> select status from v$instance;
STATUS
------------
OPEN