0% found this document useful (0 votes)
92 views3 pages

Document 2484229.1 Recover Oracle Error

This document describes symptoms, cause, and solutions for when a partial restore of a database to a new server fails with ORA-01547 or ORA-01152 errors after running open resetlogs. The cause is an issue with the control file. Solutions include faking recovery or recreating the control file after ensuring the needed datafiles are restored and recovered to the correct checkpoint.

Uploaded by

andfr2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views3 pages

Document 2484229.1 Recover Oracle Error

This document describes symptoms, cause, and solutions for when a partial restore of a database to a new server fails with ORA-01547 or ORA-01152 errors after running open resetlogs. The cause is an issue with the control file. Solutions include faking recovery or recreating the control file after ensuring the needed datafiles are restored and recovered to the correct checkpoint.

Uploaded by

andfr2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Document 2484229.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Copyright (c) 2023, Oracle. All rights reserved. Oracle Confidential.

After PITR to alternate server open resetlogs fails with ORA-01547 / ORA-01152: file 1 was
not restored from a sufficiently old backup (Doc ID 2484229.1)

In this Document

Symptoms
Cause
Solution
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.2.0.1 [Release 10.2 to 12.2]
Information in this document applies to any platform.

SYMPTOMS

- Partial restore of the database to new server, skipping tablepspaces failing with error:

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/<path>/<filename>'

- Required datafiles have been recovered till the time required and files are non Fuzzy.
- Non CDB environment.

CAUSE

There is issue with the Controlfile

SOLUTION

- Ensure the database has been restored and recovery till the Until time or the SCN specified in the PITR script

- In the below example PITR is being done until time 24-DEC-2018 15:00:00.

- Only few Selected tablespaces have been restored (Out of 45 datafiles only 15 datafiles from system, sysaux, undo, and
required tablespace have been restored

Run the below query to find the checkpoint time and SCN in the restored datafiles

select status, checkpoint_change#,


to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS')
as checkpoint_time, count(*) from v$datafile_header
group by status, checkpoint_change#, checkpoint_time
order by status, checkpoint_change#, checkpoint_time;

STATUS CHECKPOINT_CHANGE# CHECKPOINT_TIME COUNT(*)


------- ------------------ -------------------- -----------------------------------

1 of 3 24/08/2023, 00:18
Document 2484229.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

OFFLINE 0 30 # Datafiles belong to the skipped


tablespaces
ONLINE 592225477425 24-DEC-2018 15:00:00 15 # 15 datafile belong to the needed
tablespaces

Check for individual files"

Select status,name,file#,ts#,CHECKPOINT_CHANGE# from v$datafile_header where ts# in(Select ts# from


v$tablespace where name in ('<replace with tablespace name seperated by comma including system/sysuax/undo>'));

STATUS NAME FILE# TS# checkpoint_change#


------- ------------------------------------------------------------------- ---------- ----------
ONLINE /<path>/<filename> 1 0 592225477425
ONLINE /<path>/<filename> 2 1 592225477425
ONLINE /<path>/<filename> 3 2 592225477425
ONLINE /<path>/<filename> 4 4 592225477425
ONLINE /<path>/<filename> 5 5 592225477425
ONLINE /<path>/<filename> 6 4 592225477425
.
.

15 rows selected.

All the 15 datafiles are at Same Checkpoint time, Checkpoint change#. These datafiles belong to the tablespaces which
have been included in the restore and recovery command
Ensure the needed datafiles are not Fuzzy:

select count(*),status,checkpoint_change#,fuzzy from v$datafile_header group by status,checkpoint_change#,fuzzy ;

COUNT(*) STATUS CHECKPOINT_CHANGE# FUZ


---------- ------- ------------------ ---
30 OFFLINE 0 NO
15 ONLINE 592225477425 NO --------------------------------> All 15 datafiles are at same
checkpoint change# and are not fuzzy

The above confirms the 15 datafiles are all not fuzzy and at having the same SCN.

To resolve the issue try Option 1 first. If option 1 does not work, try Option 2

Option 1 : Fake recovery

SQL> Recover database using backup controlfile until cancel ;

Type Cancel

If no errors,then open the database with resetlogs:

SQL> Alter database open resetlogs ;

2 of 3 24/08/2023, 00:18
Document 2484229.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...

Option 2 : Recreate controlfile

- If Option 1 still gives the same error recreate the controlfile.

- Save the current database information:


Spool /<path>/<LogfileName>.log
Select name,file#,status,ts# from v$datafile :
Select member,group# from v$logfile ;
Select * from v$log ;
Show parameter control
Spool off

- Create controlfile dump to recreate the controlfile:

Alter session set tracefile_identifier='create' ;

alter database backup controlfile to trace resetlogs ;

- Shut down the restored database

- Edit the controlfile dump file which should be created under the trace directory. Remove the datafiles which are not
needed. Keeping only 15 datafiles which were restored and needed

SQL>Startup nomount ;

SQL>@/<path>/<controlfile_dump>

SQL>Alter database mount ;

SQL> Recover database using backup controlfile until cancel ;

Type cancel ;

SQL>Alter database open resetlogs ;

REFERENCES

NOTE:1929376.1 - My Oracle Support - Automated Troubleshooting


NOTE:1671416.1 - SRDC - Required Diagnostic Data Collection for RMAN Restore and Recover Issues
Didn't find what you are looking for?

3 of 3 24/08/2023, 00:18

You might also like