ORA-01547: RECOVER Succeeded but OPEN RESETLOGS Error - Complete Recovery
ORA-01547: Warning: RECOVER Succeeded but OPEN RESETLOGS Would Get Error
Section titled “ORA-01547: Warning: RECOVER Succeeded but OPEN RESETLOGS Would Get Error”Error Overview
Section titled “Error Overview”Error Text: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
The ORA-01547 error is a warning rather than a terminal failure. Oracle is reporting that the recovery commands it executed appeared to complete without error, but attempting to open the database with OPEN RESETLOGS would fail because one or more datafiles are not at a consistent state compatible with the recovery point. It is nearly always followed by a secondary error (such as ORA-01194 or ORA-01152) that names the specific datafile that is out of sync.
This situation most commonly arises during incomplete (point-in-time) recovery, when a subset of datafiles has not been recovered to the same SCN as the rest of the database. Attempting to open before resolving the inconsistency would corrupt the database.
Common Causes
Section titled “Common Causes”1. Incomplete Recovery with Missing Archive Logs
Section titled “1. Incomplete Recovery with Missing Archive Logs”- A point-in-time recovery was performed but one or more archive logs required to bring all datafiles to the target SCN are missing
- Some datafiles were backed up at different points in time and the available archivelogs cannot bridge all of them to the target SCN
2. Datafile Not Included in Recovery
Section titled “2. Datafile Not Included in Recovery”- A datafile was not restored from backup before the RECOVER command was run
- A newly added datafile was not included in the restore set, leaving it at a different SCN than the rest of the database
- A tablespace was taken offline before the backup and not included in the restore
3. Archive Log Gap in a Data Guard Environment
Section titled “3. Archive Log Gap in a Data Guard Environment”- A Data Guard standby was being recovered and an archive log gap exists on the standby that cannot be resolved from the primary or archive log destination
- Redo was applied up to a certain SCN but a sequence gap prevents full synchronization
4. Inconsistent Backup Set
Section titled “4. Inconsistent Backup Set”- Different datafiles were restored from backups taken at different points in time (e.g., incremental restore path mixed different backup levels)
- A control file backup is from a different point in time than the datafile backups being used, creating an SCN mismatch
5. RESETLOGS SCN Boundary Issues
Section titled “5. RESETLOGS SCN Boundary Issues”- Attempting to recover across a previous
OPEN RESETLOGSevent without having backups from after that resetlogs operation - The target SCN requested falls before the RESETLOGS SCN embedded in some datafile headers
Diagnostic Queries
Section titled “Diagnostic Queries”Identify the Inconsistent Datafiles
Section titled “Identify the Inconsistent Datafiles”-- The secondary error (ORA-01194 or ORA-01152) names the file; also check:SELECT df.file#, df.name, df.status, df.checkpoint_change# AS file_scn, db.checkpoint_change# AS database_scn, df.checkpoint_change# - db.checkpoint_change# AS scn_delta, df.recover, df.fuzzyFROM v$datafile dfCROSS JOIN v$database dbORDER BY ABS(df.checkpoint_change# - db.checkpoint_change#) DESC;Check the Database’s Current SCN and Incarnation
Section titled “Check the Database’s Current SCN and Incarnation”-- Current database incarnation and SCN informationSELECT dbid, name, db_unique_name, resetlogs_change#, resetlogs_time, prior_resetlogs_change#, checkpoint_change#, status, open_mode, log_modeFROM v$database;
-- Check all database incarnationsSELECT incarnation#, resetlogs_change#, resetlogs_time, prior_incarnation#, prior_resetlogs_change#, statusFROM v$database_incarnationORDER BY incarnation#;Check Available Archive Logs
Section titled “Check Available Archive Logs”-- Review what archive log sequences are available and their SCN rangesSELECT sequence#, first_change#, next_change#, first_time, next_time, archived, applied, deleted, status, nameFROM v$archived_logWHERE standby_dest = 'NO' AND deleted = 'NO'ORDER BY sequence#;
-- Identify gaps in the archive log sequenceSELECT a.sequence# + 1 AS missing_from, b.sequence# - 1 AS missing_to, b.sequence# - a.sequence# - 1 AS gap_countFROM v$archived_log aJOIN v$archived_log b ON b.sequence# = ( SELECT MIN(c.sequence#) FROM v$archived_log c WHERE c.sequence# > a.sequence#)WHERE b.sequence# - a.sequence# > 1 AND a.standby_dest = 'NO' AND b.standby_dest = 'NO'ORDER BY a.sequence#;Check RMAN Recovery Catalog for Backup Coverage
Section titled “Check RMAN Recovery Catalog for Backup Coverage”-- From RMAN: list all backups and their SCN coverage-- Run in RMAN, not SQL*PlusLIST BACKUP SUMMARY;
-- Check which SCN range each backup set coversLIST BACKUP OF DATABASE;
-- Check for datafile copiesLIST COPY OF DATABASE;
-- Report what archivelogs RMAN knows aboutLIST ARCHIVELOG ALL;Examine the Alert Log for Recovery Details
Section titled “Examine the Alert Log for Recovery Details”-- Review alert log entries during the recovery windowSELECT originating_timestamp, message_textFROM v$diag_alert_extWHERE message_text LIKE '%ORA-01547%' OR message_text LIKE '%ORA-01194%' OR message_text LIKE '%ORA-01152%' OR message_text LIKE '%RECOVER%' OR message_text LIKE '%RESETLOGS%'ORDER BY originating_timestamp DESCFETCH FIRST 100 ROWS ONLY;Step-by-Step Resolution
Section titled “Step-by-Step Resolution”1. Identify Which File Is Preventing RESETLOGS
Section titled “1. Identify Which File Is Preventing RESETLOGS”The secondary error accompanying ORA-01547 names the file. Before doing anything else, run the diagnostic query above to understand which files have SCN discrepancies and by how much.
-- Identify all files needing recoverySELECT file#, name, recover, fuzzy, checkpoint_change#FROM v$datafileWHERE recover = 'YES' OR fuzzy = 'YES';2. Recover the Identified Problem Datafile
Section titled “2. Recover the Identified Problem Datafile”If the file simply needs additional archivelog application:
-- From SQL*Plus (RECOVER will prompt for archivelogs)RECOVER DATAFILE &file_number;
-- Or recover using automatic archivelog applicationRECOVER AUTOMATIC DATAFILE &file_number;
-- After recovery, attempt to openALTER DATABASE OPEN RESETLOGS;Using RMAN for the same operation:
-- From RMAN: recover the specific datafileRECOVER DATAFILE &file_number;
-- Then open from SQL*PlusALTER DATABASE OPEN RESETLOGS;3. Perform a Full Database Incomplete Recovery to a Consistent Point
Section titled “3. Perform a Full Database Incomplete Recovery to a Consistent Point”If some archivelogs are missing and a consistent point-in-time must be chosen that all datafiles can reach:
-- From RMAN: determine the latest consistent SCN all files can reach-- First, identify the minimum SCN across all datafiles requiring recoverySELECT MIN(checkpoint_change#) AS minimum_consistent_scn FROM v$datafile;
-- Run incomplete recovery to that SCN (or a time/log sequence)-- Option A: Recover to a specific SCNRUN { SET UNTIL SCN &minimum_consistent_scn; RESTORE DATABASE; RECOVER DATABASE;}
-- Option B: Recover to a specific timeRUN { SET UNTIL TIME "TO_DATE('2026-03-20 14:00:00','YYYY-MM-DD HH24:MI:SS')"; RESTORE DATABASE; RECOVER DATABASE;}
-- Option C: Recover to a specific archive log sequenceRUN { SET UNTIL SEQUENCE &sequence_number THREAD 1; RESTORE DATABASE; RECOVER DATABASE;}4. Handle a Missing Datafile That Cannot Be Recovered
Section titled “4. Handle a Missing Datafile That Cannot Be Recovered”If a non-critical tablespace’s datafile cannot be recovered to the required SCN, it can be dropped before opening:
-- Offline the problem datafile permanently (data in it will be lost)ALTER DATABASE DATAFILE &file_number OFFLINE DROP;
-- Now attempt OPEN RESETLOGSALTER DATABASE OPEN RESETLOGS;
-- After opening, drop the tablespace to clean up (data in it is gone)DROP TABLESPACE &tablespace_name INCLUDING CONTENTS AND DATAFILES;This approach is only appropriate for non-critical or expendable tablespaces. Never use it for the SYSTEM, SYSAUX, UNDO, or any tablespace containing essential application data.
5. Resolve a Data Guard Archive Log Gap
Section titled “5. Resolve a Data Guard Archive Log Gap”If this error occurs on a Data Guard standby during managed recovery:
-- On the standby: check for gapsSELECT thread#, low_sequence#, high_sequence# FROM v$archive_gap;
-- On the primary: manually copy the missing archivelogs to the standby-- Then register them in the standby's control fileALTER DATABASE REGISTER PHYSICAL LOGFILE '/path/to/archivelog';
-- Resume managed recoveryALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;6. Recovering Across a RESETLOGS Boundary
Section titled “6. Recovering Across a RESETLOGS Boundary”If recovery requires crossing a previous RESETLOGS event, ensure the catalog or control file knows about all incarnations and that post-RESETLOGS backups are available:
-- In RMAN: reset the database to the target incarnation before recovering-- List incarnationsLIST INCARNATION OF DATABASE;
-- Reset to the prior incarnation to recover to a point before the last RESETLOGSRESET DATABASE TO INCARNATION &incarnation_number;
-- Then restore and recoverRESTORE DATABASE UNTIL SCN &target_scn;RECOVER DATABASE UNTIL SCN &target_scn;ALTER DATABASE OPEN RESETLOGS;Prevention Strategies
Section titled “Prevention Strategies”1. Validate Backup Consistency Before Recovery
Section titled “1. Validate Backup Consistency Before Recovery”-- Always validate backups before using them for recovery (run in RMAN)VALIDATE DATABASE;VALIDATE BACKUPSET ALL;CROSSCHECK BACKUP;CROSSCHECK ARCHIVELOG ALL;
-- Report files needing backup to avoid coverage gapsREPORT NEED BACKUP DAYS 1;REPORT UNRECOVERABLE;2. Maintain Complete Archive Log Retention
Section titled “2. Maintain Complete Archive Log Retention”-- Ensure archive log retention is sufficient for the recovery window-- Configure RMAN retention policyCONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
-- Or keep a minimum number of full backupsCONFIGURE RETENTION POLICY TO REDUNDANCY 2;
-- Check current archivelog deletion policySHOW ALL;3. Test Recovery Procedures Regularly
Section titled “3. Test Recovery Procedures Regularly”-- Periodically test RESTORE and RECOVER in a non-production environment-- This validates both backups and the recovery procedure itself-- At minimum, run a restore validationRESTORE DATABASE VALIDATE;RESTORE ARCHIVELOG ALL VALIDATE;4. Configuration Best Practices
Section titled “4. Configuration Best Practices”- Always run in
ARCHIVELOGmode — without it, only full offline restores are possible - Configure at least two archivelog destinations to guard against log loss
- Use a Recovery Catalog for RMAN in production — it retains historical backup and incarnation information beyond what the control file can store
- After any
OPEN RESETLOGS, take a full database backup immediately — this establishes a clean recovery baseline for the new incarnation - In Data Guard environments, monitor
v$archive_gapproactively and configureFAL_SERVER/FAL_CLIENTfor automatic gap resolution
5. Monitoring Recovery Window Coverage
Section titled “5. Monitoring Recovery Window Coverage”-- Check that all datafiles have a backup within the required windowSELECT df.name, MAX(bp.completion_time) AS last_backup_time, ROUND(SYSDATE - MAX(bp.completion_time), 1) AS days_since_backupFROM v$datafile dfLEFT JOIN ( SELECT file# AS file_number, MAX(completion_time) AS completion_time FROM rc_backup_datafile GROUP BY file#) bp ON df.file# = bp.file_numberGROUP BY df.nameORDER BY days_since_backup DESC NULLS FIRST;Diagnostic Scripts
Section titled “Diagnostic Scripts”These Oracle Day by Day scripts can assist with backup and recovery analysis:
- gvsess.sql — Identify active recovery sessions and their progress
Related Errors
Section titled “Related Errors”- ORA-01578 - Oracle data block corrupted
- ORA-00376 - File cannot be read at this time
- ORA-16038 - Log sequence cannot be archived
- ORA-19815 - Flash recovery area full
Emergency Response
Section titled “Emergency Response”Immediate Assessment
Section titled “Immediate Assessment”-- Determine which files are blocking OPEN RESETLOGSSELECT file#, name, status, recover, fuzzy, checkpoint_change#FROM v$datafileWHERE recover = 'YES' OR fuzzy = 'YES' OR status NOT IN ('ONLINE','SYSTEM');
-- Confirm the target recovery SCNSELECT checkpoint_change#, resetlogs_change#, current_scn FROM v$database;Immediate Actions
Section titled “Immediate Actions”- Do not issue
ALTER DATABASE OPEN RESETLOGSuntil all datafiles are confirmed consistent — doing so with inconsistent files will corrupt the database - Read the secondary error carefully — ORA-01194 or ORA-01152 will name the specific file that is the problem
- Check archive log availability for the sequences between the problem file’s SCN and the target SCN
- Engage RMAN for the recovery — manual recovery via SQL*Plus is error-prone for complex scenarios
Post-Resolution Verification
Section titled “Post-Resolution Verification”-- After successful OPEN RESETLOGS, verify all files are online and consistentSELECT file#, name, status, checkpoint_change# FROM v$datafile ORDER BY file#;
-- Confirm the database opened cleanlySELECT name, open_mode, resetlogs_change#, resetlogs_time FROM v$database;
-- Immediately take a full backup after RESETLOGS-- (Run in RMAN)BACKUP DATABASE PLUS ARCHIVELOG;