Restore from prod to test [message #396697] |
Tue, 07 April 2009 14:27 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Hello,
I've created backup of the prod DB using backup database plus archive log. Now I want to restore this backup on the test DB. Can someone tell me how to go about. I'd copied the control file, pfile over from prod to test (directory structure is similar). I then use this pfile to mount the DB. After mounting it I ran the Restore Database command but it didn't work. I'm not using catalog. Please help!
Following is the error i got:
C:\Documents and Settiprod\snegi>rman target /@test nocatalog
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Apr 7 10:50:42 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: prod (DBID=725524422, not open)
using target database control file instead of recovery catalog
RMAN> restore;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, channel, che
ck, controlfile, clone, database, datafile, device, from, force, high, (, previe
w, spfile, standby, tablespace, until, validate"
RMAN-01007: at line 1 column 8 file: standard input
RMAN> restore database;;
Starting restore at 07-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=485 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\prod\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\prod\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\prod\CP_prod_I08.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\prod\SYSAUX01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\prod\CP_prod_I09.DBF
restoring datafile 00006 to D:\ORACLE\ORADATA\prod\USERS01.DBF
restoring datafile 00008 to D:\ORACLE\ORADATA\prod\TOOLS01.DBF
restoring datafile 00010 to D:\ORACLE\ORADATA\prod\XDB01.DBF
restoring datafile 00011 to D:\ORACLE\ORADATA\prod\CP_prod_D01.DBF
restoring datafile 00012 to D:\ORACLE\ORADATA\prod\CP_prod_D02.DBF
restoring datafile 00013 to D:\ORACLE\ORADATA\prod\CP_prod_D03.DBF
restoring datafile 00014 to D:\ORACLE\ORADATA\prod\CP_prod_D04.DBF
restoring datafile 00015 to D:\ORACLE\ORADATA\prod\CP_prod_D05.DBF
restoring datafile 00016 to D:\ORACLE\ORADATA\prod\CP_prod_D06.DBF
restoring datafile 00017 to D:\ORACLE\ORADATA\prod\CP_prod_D07.DBF
restoring datafile 00018 to D:\ORACLE\ORADATA\prod\CP_prod_D08.DBF
restoring datafile 00019 to D:\ORACLE\ORADATA\prod\CP_prod_D09.DBF
restoring datafile 00020 to D:\ORACLE\ORADATA\prod\CP_prod_D10.DBF
restoring datafile 00021 to D:\ORACLE\ORADATA\prod\CP_prod_I01.DBF
restoring datafile 00022 to D:\ORACLE\ORADATA\prod\CP_prod_I02.DBF
restoring datafile 00023 to D:\ORACLE\ORADATA\prod\CP_prod_I03.DBF
restoring datafile 00024 to D:\ORACLE\ORADATA\prod\CP_prod_I04.DBF
restoring datafile 00025 to D:\ORACLE\ORADATA\prod\CP_prod_I05.DBF
restoring datafile 00026 to D:\ORACLE\ORADATA\prod\CP_prod_D11.DBF
restoring datafile 00027 to D:\ORACLE\ORADATA\prod\CP_prod_D12.DBF
restoring datafile 00028 to D:\ORACLE\ORADATA\prod\CP_prod_D13.DBF
restoring datafile 00029 to D:\ORACLE\ORADATA\prod\CP_prod_D14.DBF
restoring datafile 00030 to D:\ORACLE\ORADATA\prod\TE_MASTER01.DBF
restoring datafile 00031 to D:\ORACLE\ORADATA\prod\TE_prod_D01.DBF
restoring datafile 00032 to D:\ORACLE\ORADATA\prod\TE_prod_I01.DBF
restoring datafile 00033 to D:\ORACLE\ORADATA\prod\CP_prod_I06.DBF
restoring datafile 00035 to D:\ORACLE\ORADATA\prod\CP_prod_D15.DBF
restoring datafile 00036 to D:\ORACLE\ORADATA\prod\CP_prod_D16.DBF
restoring datafile 00037 to D:\ORACLE\ORADATA\prod\CP_prod_I07.DBF
restoring datafile 00038 to D:\ORACLE\ORADATA\prod\CP_prod_D17.DBF
restoring datafile 00039 to D:\ORACLE\ORADATA\prod\CP_prod_D18.DBF
restoring datafile 00040 to D:\ORACLE\ORADATA\prod\CP_prod_D19.DBF
restoring datafile 00041 to D:\ORACLE\ORADATA\prod\CP_prod_D20.DBF
channel ORA_DISK_1: reading from backup piece E:\ORACLE\ORADATA\prod\DATA\ORA_DF
683488821_S10415_S1
ORA-19870: error reading backup piece E:\ORACLE\ORADATA\prod\DATA\ORA_DF68348882
1_S10415_S1
ORA-19505: failed to identify file "E:\ORACLE\ORADATA\prod\DATA\ORA_DF683488821_
S10415_S1"
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.
failover to previous backup
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\prod\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\prod\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\prod\CP_prod_I08.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\prod\SYSAUX01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\prod\CP_prod_I09.DBF
restoring datafile 00006 to D:\ORACLE\ORADATA\prod\USERS01.DBF
restoring datafile 00008 to D:\ORACLE\ORADATA\prod\TOOLS01.DBF
restoring datafile 00010 to D:\ORACLE\ORADATA\prod\XDB01.DBF
restoring datafile 00011 to D:\ORACLE\ORADATA\prod\CP_prod_D01.DBF
restoring datafile 00012 to D:\ORACLE\ORADATA\prod\CP_prod_D02.DBF
restoring datafile 00013 to D:\ORACLE\ORADATA\prod\CP_prod_D03.DBF
restoring datafile 00014 to D:\ORACLE\ORADATA\prod\CP_prod_D04.DBF
restoring datafile 00015 to D:\ORACLE\ORADATA\prod\CP_prod_D05.DBF
restoring datafile 00016 to D:\ORACLE\ORADATA\prod\CP_prod_D06.DBF
restoring datafile 00017 to D:\ORACLE\ORADATA\prod\CP_prod_D07.DBF
restoring datafile 00018 to D:\ORACLE\ORADATA\prod\CP_prod_D08.DBF
restoring datafile 00019 to D:\ORACLE\ORADATA\prod\CP_prod_D09.DBF
restoring datafile 00020 to D:\ORACLE\ORADATA\prod\CP_prod_D10.DBF
restoring datafile 00021 to D:\ORACLE\ORADATA\prod\CP_prod_I01.DBF
restoring datafile 00022 to D:\ORACLE\ORADATA\prod\CP_prod_I02.DBF
restoring datafile 00023 to D:\ORACLE\ORADATA\prod\CP_prod_I03.DBF
restoring datafile 00024 to D:\ORACLE\ORADATA\prod\CP_prod_I04.DBF
restoring datafile 00025 to D:\ORACLE\ORADATA\prod\CP_prod_I05.DBF
restoring datafile 00026 to D:\ORACLE\ORADATA\prod\CP_prod_D11.DBF
restoring datafile 00027 to D:\ORACLE\ORADATA\prod\CP_prod_D12.DBF
restoring datafile 00028 to D:\ORACLE\ORADATA\prod\CP_prod_D13.DBF
restoring datafile 00029 to D:\ORACLE\ORADATA\prod\CP_prod_D14.DBF
restoring datafile 00030 to D:\ORACLE\ORADATA\prod\TE_MASTER01.DBF
restoring datafile 00031 to D:\ORACLE\ORADATA\prod\TE_prod_D01.DBF
restoring datafile 00032 to D:\ORACLE\ORADATA\prod\TE_prod_I01.DBF
restoring datafile 00033 to D:\ORACLE\ORADATA\prod\CP_prod_I06.DBF
restoring datafile 00035 to D:\ORACLE\ORADATA\prod\CP_prod_D15.DBF
restoring datafile 00036 to D:\ORACLE\ORADATA\prod\CP_prod_D16.DBF
restoring datafile 00037 to D:\ORACLE\ORADATA\prod\CP_prod_I07.DBF
restoring datafile 00038 to D:\ORACLE\ORADATA\prod\CP_prod_D17.DBF
restoring datafile 00039 to D:\ORACLE\ORADATA\prod\CP_prod_D18.DBF
restoring datafile 00040 to D:\ORACLE\ORADATA\prod\CP_prod_D19.DBF
restoring datafile 00041 to D:\ORACLE\ORADATA\prod\CP_prod_D20.DBF
channel ORA_DISK_1: reading from backup piece E:\ORACLE\ORADATA\prod\DATA\ORA_DF
683485291_S10413_S1
ORA-19870: error reading backup piece E:\ORACLE\ORADATA\prod\DATA\ORA_DF68348529
1_S10413_S1
ORA-19505: failed to identify file "E:\ORACLE\ORADATA\prod\DATA\ORA_DF683485291_
S10413_S1"
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.
failover to previous backup
Thanks,
SN
[Updated on: Tue, 07 April 2009 14:31] by Moderator Report message to a moderator
|
|
|
|
|
Re: Restore from prod to test [message #396700 is a reply to message #396697] |
Tue, 07 April 2009 14:38 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Mahesh,
And use CODE tag to format your code.
I apologize for not putting the code in the proper tags.
ORA-19505: failed to identify file "E:\ORACLE\ORADATA\prod\DATA\ORA_DF683485291_S10413_S1" Does this directory path exist in your "test" environment?
No, I was thinking (guess was thinking wrong) that the restore will get the backup file from the prod DB server. I opened the RMAN session for test DB on the prod DB server and ran the restore command. So Do I have to place the backup file in the test DB server and issue the restore command?
I was reading some of your responses in the forum and I must say you've contributed a lot. Thanks a ton!
Thanks,
SN
|
|
|
|
Re: Restore from prod to test [message #396706 is a reply to message #396697] |
Tue, 07 April 2009 15:01 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Mahesh,
Does the E:\ORACLE\ORADATA\PROD\DATA exist?
Yes the above structure exists. However the DATA folder doesn't not have the backup file "ORA_DF683485291_S10413_S1". So do I have to manually place the backup file in the 'E:\ORACLE\ORADATA\PROD\DATA' location first on the test Db server and then perform restore?
Thank you for your prompt response,
SN
|
|
|
|
Re: Restore from prod to test [message #396710 is a reply to message #396697] |
Tue, 07 April 2009 15:49 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Where have you placed the backupsets for RMAN to restore?
You are right, I didn't place the backup set on the machine locally. I'm in the process of copying the backup file to the test DB server. I'll try to perform restore and let you know how it goes. Thanks a lot!
Thanks,
SN
|
|
|
|
Re: Restore from prod to test [message #396995 is a reply to message #396697] |
Wed, 08 April 2009 10:19 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Just to make things simple I copied the backup set to the test DB server in the exact same location. When I issues restore database command I got the following error. It complains about the channel but the channel is allocated clearly:
C:\Documents and Settings\SN>rman target/@test
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Apr 8 11:01
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: test (DBID=1234567)
RMAN> restore database;
Starting restore at 08-APR-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=477 devtype=DISK
RMAN-00571: ========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ============
RMAN-00571: ========================================================
RMAN-03002: failure of restore command at 04/08/2009 11:01:26
RMAN-06026: some targets not found - aborting restore
RMAN-06100: no channel to restore a backup or copy of datafile 41
RMAN-06100: no channel to restore a backup or copy of datafile 40
RMAN-06100: no channel to restore a backup or copy of datafile 39
RMAN-06100: no channel to restore a backup or copy of datafile 38
RMAN-06100: no channel to restore a backup or copy of datafile 37
RMAN-06100: no channel to restore a backup or copy of datafile 36
RMAN-06100: no channel to restore a backup or copy of datafile 35
RMAN-06100: no channel to restore a backup or copy of datafile 33
RMAN-06100: no channel to restore a backup or copy of datafile 32
RMAN-06100: no channel to restore a backup or copy of datafile 31
RMAN-06100: no channel to restore a backup or copy of datafile 30
RMAN-06100: no channel to restore a backup or copy of datafile 29
RMAN-06100: no channel to restore a backup or copy of datafile 28
RMAN-06100: no channel to restore a backup or copy of datafile 27
RMAN-06100: no channel to restore a backup or copy of datafile 26
RMAN-06100: no channel to restore a backup or copy of datafile 25
RMAN-06100: no channel to restore a backup or copy of datafile 24
RMAN-06100: no channel to restore a backup or copy of datafile 23
RMAN-06100: no channel to restore a backup or copy of datafile 22
RMAN-06100: no channel to restore a backup or copy of datafile 21
RMAN-06100: no channel to restore a backup or copy of datafile 20
RMAN-06100: no channel to restore a backup or copy of datafile 19
RMAN-06100: no channel to restore a backup or copy of datafile 18
RMAN-06100: no channel to restore a backup or copy of datafile 17
RMAN-06100: no channel to restore a backup or copy of datafile 16
RMAN-06100: no channel to restore a backup or copy of datafile 15
RMAN-06100: no channel to restore a backup or copy of datafile 14
RMAN-06100: no channel to restore a backup or copy of datafile 13
RMAN-06100: no channel to restore a backup or copy of datafile 12
RMAN-06100: no channel to restore a backup or copy of datafile 11
RMAN-06100: no channel to restore a backup or copy of datafile 10
RMAN-06100: no channel to restore a backup or copy of datafile 8
RMAN-06100: no channel to restore a backup or copy of datafile 6
RMAN-06100: no channel to restore a backup or copy of datafile 5
RMAN-06100: no channel to restore a backup or copy of datafile 4
RMAN-06100: no channel to restore a backup or copy of datafile 3
RMAN-06100: no channel to restore a backup or copy of datafile 2
RMAN-06100: no channel to restore a backup or copy of datafile 1
After the failure I tried to open the database
using startup pfile=................init.ora (which in turn calls spfile). The DB comes to a mount state.
Then I did the following:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01190: control file or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\test\SYSTEM01.DBF'
SQL> recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\test\SYSTEM01.DBF'
SQL> recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\test\SYSTEM01.DBF' .
I had rolled to the current incarnation since the DB wasnt opening up. Is the later error because of that? If yes can someone please suggest some solutions?
Thanks,
SN
|
|
|
|
|
|
|
Re: Restore from prod to test [message #397077 is a reply to message #397070] |
Wed, 08 April 2009 16:05 |
shekharnegi12
Messages: 52 Registered: October 2008
|
Member |
|
|
Mahesh,
I was able to restore the database to test DB but it failed to recover. fllowing is the error:
SQL> recover database using backup controlfile;
ORA-00279: change 461601044 generated at 04/07/2009 18:04:54 needed for thread
1
ORA-00289: suggestion :
E:\ORACLE\FLASH_RECOVERY_AREA\test\ARCHIVELOG\2009_04_08\O1_MF_1_9_%U_.ARC
ORA-00280: change 461601044 for thread 1 is in sequence #9
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'E:\ORACLE\FLASH_RECOVERY_AREA\test\ARCHIVELOG\2009_04_08\O1_MF_1_9_%U_.ARC'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
I looked for the archive file in the mention location and the file doesn't exist. I have no idea what file is it referring to. Which archive file should I apply to the test DB. I checked the incarnation and heres what I found:
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 test 803771630 PARENT 190578 23-AUG-07
2 2 test 803771630 PARENT 76099602 17-JAN-08
3 3 test 803771630 PARENT 237815329 08-AUG-08
4 4 test 803771630 PARENT 242583726 15-AUG-08
5 5 test 803771630 PARENT 399793634 21-FEB-09
6 6 test 803771630 PARENT 403154793 24-FEB-09
7 7 test 803771630 CURRENT 459524607 02-APR-09
8 8 test 803771630 ORPHAN 459524607 02-APR-09
Can you suggest?
Thanks,
SN
|
|
|
|
|
|
Re: Restore from prod to test [message #397082 is a reply to message #397081] |
Wed, 08 April 2009 16:57 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Or you could try to
recover database using backup controlfile until cancel;
And then say "cancel" when the suggested archive log doesn't exist.
|
|
|