首页 » ORACLE 9i-23ai » Troubleshooting Rman Errors ora-1547 ora-1152 ora-1110 During recover

Troubleshooting Rman Errors ora-1547 ora-1152 ora-1110 During recover

Restore RMAN backup from standby database to another server create a test database, and to Database Point in Time Recovery. but faced ora-1547 ora-1152 ora-1110 During recover.

RMAN> RUN{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_SERV=nbujxq,NB_ORA_CLIENT=abmstb2';
RESTORE CONTROLFILE from 'cntrl_11484_1_1038669002';
RELEASE CHANNEL ch00;
}

RMAN> RUN{
set until time = '2020-04-25 09:00:00';
restore database;
}

RMAN> RUN{
set until time = '2020-04-25 09:00:00';
recover database;
}
Oracle 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: '+DATA/abmdb/datafile/system.455.1039079339'
SQL>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(*)
------- ------------------ ----------------------- ----------
ONLINE          1.6887E+13 25-APR-2020 09:00:00           567


SQL> recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01666: control file is for a standby database

You’re waking up a Physical standby database, and are welcomed by the following ORA-Code:

ORA-01666: controlfile is for a standby database

This is because the database has been configured as a Standby one. Therefore, you can only open it as a Standby database.

SQL> select name,open_mode ,database_role from v$database;
NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ANBOB READ ONLY            PHYSICAL STANDBY
 
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ORA-10877: error signaled in parallel recovery slave

Cause:

The errors are reporting that the archivelog file required is not possible to
restore it from the backups done.

Solution:

方法一

set numwidth 30;
set pagesize 50000;
alter session set nls_date_format = 'DD-MON-RRRR HH24:MI:SS';

SQL> select TS#,STATUS,ENABLED,file# from v$datafile order by status;
-- check 'RECOVER' status datafiles 

sys.>select status,checkpoint_change#,checkpoint_time, resetlogs_change#, resetlogs_time, count(*), fuzzy 
from v$datafile_header 
group by status,checkpoint_change#,checkpoint_time, resetlogs_change#, resetlogs_time, fuzzy;

fuzzy值为yes表示数据文件在checkpoint以后仍然有些写入的动作,比如有一些比存储在v$datafile_header.checkpoint_change#字段里scn更高的scn事务对数据文件进行了修改操作,所以为了让数据文件保持一致性,则需要前滚应用日志

KCVFH means kernel cache recovery file header. you can print kcvfh structure with BBED,The length of datafile header for different version is different.

BBED> p kcvfh

x$kcvfh是v$datafile_header的源,datafile header上不仅记录了checkpoint_change#,更重要的是记录了checkpoint_change#所在的redo sequence#,恢复时到底需要那些归档日志可以通过查看 v$recovery_log来获得:v$recovery_log的信息就是通过比较control file中的checkpoint_change#和datafile header上的checkpoint_change#而产生的

select hxfil,fhrba_seq,fhrba_bno,fhrba_bof from x$kcvfh;

— to do Consistency recovery

SQL> recover database until time [you might choose a time just after the completion time of the backup]; 

SQL> alter database open resetlogs;

方法二

-- on standby or primary db 
SQL>Alter session set tracefile_identifie='create' ; 
SQL>alter database backup controlfile to trace resetlogs ;
 
SQL> startup nomount 

-- recretae controlfie file
SQL> @recretectl.sql edit above generated  
-- on new host , using backupset of standby db 
RMAN> run {
 set until time "to_date('22-APR-2020 13:30:00','DD-MON-YYYY HH24:MI:SS')"; 
 restore database; 
 recover database;
 alter database open resetlogs; 
}

ORACLE异机数据库基于时间点的恢复 (DBPITR) Method

打赏

,

对不起,这篇文章暂时关闭评论。