Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Bolat.

Asked: November 21, 2016 - 6:48 am UTC

Last updated: November 23, 2016 - 5:23 am UTC

Version: 11.2.0.4.0

Viewed 1000+ times

You Asked

Hi Tom,
we were making DB move procedure.

NOTE:
Source DB - uses ASM architecture.
Target DB - will use filesystem.

Backup of DB via RMAN (Linux OS, machine1)
Restore of DB via RMAN (Linux OS, machine2)

1) backup was made
RMAN> backup database plus archivelog;

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
12 106.33M DISK 00:00:13 18-NOV-16
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20161118T131851
Piece Name: /u01/backup/db_0drl7nds_13_1

List of Archived Logs in backup set 12
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 5 836739 17-NOV-16 842409 17-NOV-16
1 6 842409 17-NOV-16 863633 17-NOV-16
1 7 863633 17-NOV-16 884259 17-NOV-16
1 8 884259 17-NOV-16 886680 17-NOV-16
1 9 886680 17-NOV-16 886728 17-NOV-16
1 10 886728 17-NOV-16 911267 18-NOV-16
1 11 911267 18-NOV-16 934377 18-NOV-16
1 12 934377 18-NOV-16 934424 18-NOV-16
1 13 934424 18-NOV-16 937971 18-NOV-16

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 1.01G DISK 00:02:34 18-NOV-16
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20161118T131907
Piece Name: /u01/backup/db_0erl7neb_14_1
List of Datafiles in backup set 13
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 937977 18-NOV-16 +DATA/orcl/datafile/system.256.786779295
2 Full 937977 18-NOV-16 +DATA/orcl/datafile/sysaux.257.786779297
3 Full 937977 18-NOV-16 +DATA/orcl/datafile/undotbs1.258.786779297
4 Full 937977 18-NOV-16 +DATA/orcl/datafile/users.259.786779297
5 Full 937977 18-NOV-16 +DATA/orcl/datafile/example.265.786779497

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
14 137.50K DISK 00:00:00 18-NOV-16
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20161118T132152
Piece Name: /u01/backup/db_0frl7njg_15_1

List of Archived Logs in backup set 14
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 14 937971 18-NOV-16 938081 18-NOV-16

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15 Full 9.36M DISK 00:00:04 18-NOV-16
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20161118T132153
Piece Name: /u01/backup/c-1314560188-20161118-01
SPFILE Included: Modification time: 18-NOV-16
SPFILE db_unique_name: ORCL
Control File Included: Ckp SCN: 938090 Ckp time: 18-NOV-16

RMAN>

2) Backup files were moved to other linux machine.

3) all prior activities were done
a) SPFILE restored -> edited for new specifics
b) control file restored

4) Restore and Recover of DB via RMAN
RMAN> list backup;

NOTE: When checking backup - Status: EXPIRED and location of source database was INVALID(source db location).
For its update - it was needed to run catalog command & crosscheck
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/BackupDB/BkpFiles/ORCL_backup/db_%u_%s_%p';

NOTE: location where Backup files are located.
RMAN> catalog start with '/u03/BackupDB/BkpFiles/ORCL_backup';

searching for all files that match the pattern /u03/BackupDB/BkpFiles/ORCL_backup

List of Files Unknown to the Database
=====================================
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0drl7nds_13_1
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0frl7njg_15_1
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/c-1314560188-20161118-01
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0erl7neb_14_1

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0drl7nds_13_1
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0frl7njg_15_1
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/c-1314560188-20161118-01
File Name: /u03/BackupDB/BkpFiles/ORCL_backup/db_0erl7neb_14_1

RMAN>

RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/db_0drl7nds_13_1 RECID=12 STAMP=928243132
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/BackupDB/BkpFiles/ORCL_backup/db_0drl7nds_13_1 RECID=15 STAMP=928255127
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/db_0erl7neb_14_1 RECID=13 STAMP=928243149
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/BackupDB/BkpFiles/ORCL_backup/db_0erl7neb_14_1 RECID=17 STAMP=928255127
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/backup/db_0frl7njg_15_1 RECID=14 STAMP=928243312
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u03/BackupDB/BkpFiles/ORCL_backup/db_0frl7njg_15_1 RECID=16 STAMP=928255127
Crosschecked 6 objects
RMAN>

RMAN ------RESTORE----------------
RMAN> run
{
SET NEWNAME FOR DATAFILE 1 to '/u01/app/oracle/oradata/orcl/system01.dbf';
SET NEWNAME FOR DATAFILE 2 to '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 to '/u01/app/oracle/oradata/orcl/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 to '/u01/app/oracle/oradata/orcl/users01.dbf';
SET NEWNAME FOR DATAFILE 5 to '/u01/app/oracle/oradata/orcl/example.dbf';
restore database;
switch datafile all;
recover database;
}2> 3> 4> 5> 6> 7> 8> 9> 10> 11>

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 18-NOV-2016 16:41:25
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 /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/example.dbf
channel ORA_DISK_1: reading from backup piece /u03/BackupDB/BkpFiles/ORCL_backup/db_0erl7neb_14_1
channel ORA_DISK_1: piece handle=/u03/BackupDB/BkpFiles/ORCL_backup/db_0erl7neb_14_1 tag=TAG20161118T131907
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 18-NOV-2016 16:41:32

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=928255292 file name=/u01/app/oracle/oradata/orcl/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=928255292 file name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=928255292 file name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=928255292 file name=/u01/app/oracle/oradata/orcl/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=928255292 file name=/u01/app/oracle/oradata/orcl/example.dbf

Starting recover at 18-NOV-2016 16:41:32
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=14
channel ORA_DISK_1: reading from backup piece /u03/BackupDB/BkpFiles/ORCL_backup/db_0frl7njg_15_1
channel ORA_DISK_1: piece handle=/u03/BackupDB/BkpFiles/ORCL_backup/db_0frl7njg_15_1 tag=TAG20161118T132152
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/product/11.2.0/dbhome_2/dbs/arch1_14_786779461.dbf thread=1 sequence=14
unable to find archived log
archived log thread=1 sequence=15
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/18/2016 16:41:33
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 15 and starting SCN of 938081

error because ArchiveLog with Seq #15 does not exist.


I would be happy if I had not seen RMAN-06054 - what does it mean?
By procedure I did everything correctly. Why I got that error?
How to check that DB was restored successfully - by incarnation?









and Connor said...

You are using a restored control file, so we cannot use the controlfile content to know how up to date the database is.

Hence when we recover, we will just keep applying archives continuously until we cannot find any more archives to apply (hence the error).

If you want to avoid the error, you can do a "recover until time" so that we stop at the appropriate point.

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

until scn

Bolat Makhmutov, November 22, 2016 - 5:51 am UTC

Thanks for reply, ok but what about if I want to restore db applying archivelogs in new server? Let's say prod server fully crashed,& not available. I have only backup file. How can I use UNTIL SCN for that, how can get SCN from backup file? With regards!

until scn

Bolat Makhmutov, November 22, 2016 - 5:51 am UTC

Thanks for reply, ok but what about if I want to restore db applying archivelogs in new server? Let's say prod server fully crashed,& not available. I have only backup file. How can I use UNTIL SCN for that, how can get SCN from backup file? With regards!

Right SCN

bolat makhmutov, November 22, 2016 - 11:03 am UTC

Sorry, HOW to find the right SCN to recover until? If prod.server crashed fully,only backup file. Thanks
Connor McDonald
November 23, 2016 - 5:23 am UTC

If you prod server has crashed, then you *want* to see the error you saw. That is, you want to recover every possible transaction you have available to you. So you would keep recoverying until you ran out of archive logs.

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.