Home » RDBMS Server » Backup & Recovery » How To Determine The Start and End SCN of Restore and Recovery (11.2.0.4 SE Windows 2012 R2 Data Center)
How To Determine The Start and End SCN of Restore and Recovery [message #668822] |
Thu, 15 March 2018 10:03  |
 |
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
Dear all,
my partial controlfile restore looks like the following:
RMAN-08553: channel ch01: restoring control file from AUTOBACKUP c-2228540098-20180315-01
RMAN-08534: channel ch01: control file restore from AUTOBACKUP complete
RMAN-08505: output file name=D:\APP\ORACLE\ORADATA\kamden\CONTROL01.CTL
RMAN-08505: output file name=D:\APP\ORACLE\FAST_RECOVERY_AREA\kamden\CONTROL02.CTL
RMAN-03091: Finished restore at 2018-03-15 01:00:10
before I begin restore and recovery, I find out the maximum recovery point
SYS@rotterdam amsterdam/kamden.eindhoven.com>select sequence#, thread#, first_change#, next_change#
2 from v$archived_log L, v$database D
3 where L.resetlogs_change# = D.resetlogs_change# and
4 sequence# in (:v_sequence);
SEQUENCE# THREAD# FIRST_CHANGE# NEXT_CHANGE#
--------- ------- ------------- ------------
374833 1 86670157235 86671317955
SYS@rotterdam amsterdam/kamden.eindhoven.com>
SYS@rotterdam amsterdam/kamden.eindhoven.com>
SYS@rotterdam amsterdam/kamden.eindhoven.com>
SYS@rotterdam amsterdam/kamden.eindhoven.com>select sequence#, thread#, first_change#, next_change#
2 from v$backup_redolog
3 where sequence# in (:v_sequence);
no rows selected
so of course the expected recovery is up to 374833
but to my surprise.
from my restore log
RMAN-03002: failure of recover command at 03/15/2018 08:16:49
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 374878 and starting SCN of 86719434183 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 374877 and starting SCN of 86718256242 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 374876 and starting SCN of 86717065755 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 374875 and starting SCN of 86715873995 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 374874 and starting SCN of 86714674847 found to restore
I only expected an error expecting no backup of archivelog log for thread 1 with sequence 374833 but not that far out 374874
when I look the the rman_output of the last backup job where the controlfile backuppiece is used for my restore
input archived log thread=1 sequence=374873 RECID=833739 STAMP=970786266
channel ch00: starting piece 1 at 15-march -2018 12:38:53 am
channel ch00: finished piece 1 at 15-march -2018 12:39:08 am
piece handle=archivelog_kamden_374873_s131787_Umbstq7ot_1_1_t970792733 tag=TAG20180314T225107 comment=API Version 2.0,MMS Version
channel ch00: backup set complete, elapsed time: 00:00:15
channel ch00: deleting archived log(s)
archived log file name=R:\APP\ORACLE\ORADATA\kamden\ARC0000374873_0847665026.0001 RECID=833739 STAMP=970786266
Finished backup at 15-march -2018 12:39:08 am
Starting Control File and SPFILE Autobackup at 15-march -2018 12:39:08 am
piece handle=c-2228540098-20180315-00 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 15-march -2018 12:39:24 am
released channel: ch00
allocated channel: ch00
channel ch00: SID=9 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.7.2 (20160111)
sent command to channel: ch00
Starting backup at 15-march -2018 12:39:30 am
channel ch00: starting full datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 15-march -2018 12:39:32 am
channel ch00: finished piece 1 at 15-march -2018 12:39:47 am
piece handle=controlcopy.ctl_kamden_s131789_t970792771 tag=TAG20180315T003931 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:00:15
Finished backup at 15-march -2018 12:39:47 am
Starting Control File and SPFILE Autobackup at 15-march -2018 12:39:47 am
piece handle=c-2228540098-20180315-01 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 15-march -2018 12:40:03 am
from the rman_output log, it is quite obvious that the last archivelog backup is 374873, but why when I started restore and recovery, it goes to recover all the way out to 374874
why is this so?
my restore command is as follow:
run {
allocate channel ch01 device type sbt;
send 'NB_ORA_CLIENT=rotterdam';
#https://juliandontcheff.wordpress.com/2012/01/11/restoring-the-oracle-database-when-is-it-ready-can-i-start-start-the-application/
sql "alter session set optimizer_mode=RULE";
SET NEWNAME FOR ........
.......
restore database;
SWITCH DATAFILE ALL;
recover database;
}
g
my customer is backing up directly to tape.
the tape server is accessible to both the production server as well as to my server where I'm doing the restore.
also when I try to find my fuzzines or begin scn I could not find it:
select max(absolute_fuzzy_change#) fuzz#, max(checkpoint_change#) chkpnt# from
2 (select file#, completion_time, checkpoint_change#, absolute_fuzzy_change# from v$backup_datafile
3 where
4 incremental_level = 0
5 --and trunc(completion_time) <= to_date('2017-07-28','YYYY-MM-DD')
6 AND trunc(completion_time) <= to_date(:v_completion_time_c,'YYYY-MM-DD')
7 and file# <> 0
8 order by completion_time desc
9 );
FUZZ# CHKPNT#
--------------------------- ---------------------------
the only backup I have is file#=0 i.e.
SELECT DISTINCT file# FROM v$backup_datafile;
FILE#
----------
0
so how do I know the starting recovery scn and end scn.
seems that I'm using the wrong query to find out the starting and end recovery scn.
many thanks in advance!
|
|
|
|
|
|
|
|
|
Re: How To Determine The Start and End SCN of Restore and Recovery [message #669293 is a reply to message #669292] |
Thu, 12 April 2018 10:57  |
John Watson
Messages: 8974 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
All you need to do is read the Backup And Recovery User Guide, it has plenty of examples and tutorials.
There is nothing wrong with your separate commands to backup the database and then the archivelogs, there is no necessity to have them in one: you get separate backupsets anyway. The problem will be in your restore and recover commands.
|
|
|
Goto Forum:
Current Time: Fri Apr 04 20:43:00 CDT 2025
|