"switch datafile" returns "RMAN-06015"
Hi,
I'm facing a strange error.
I'm trying to restore a database from a cold backupsets created by RMAN into a new machine.
My restore commands returns "RMAN-06015" when it tries to execute "switch datafile" command.
RMAN> run{
2> set newname for datafile
3> 'E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201' TO
4> 'D:\oracle\oradata\dawa\UNDOTBS201';
5> switch datafile all;
6> }
executing command: SET NEWNAME
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch command at 07/19/2011 11:36:55
RMAN-20230: datafile copy not found in the recovery catalog
RMAN-06015: error while looking up datafilecopy name: D:\ORACLE\ORADATA\DAWA\UNDOTBS201The file D:\ORACLE\ORADATA\DAWA\UNDOTBS201 doesn't exist in the production.
It doesn't exist in the controlfile either. I made a bakup of the control file into the trace folder and checked the generated file. That file doesn't exist overthere.
It isn't part of the backupset either.
RMAN> list backup of tablespace undotbs2 ;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
780 Full 1M DISK 00:26:37 06-JUL-11
BP Key: 780 Status: EXPIRED Compressed: NO Tag: FULLDB
Piece Name: \\PRODSERVER\DBBACKUPS\PLMGPUNM_1_1
List of Datafiles in backup set 780
File LV Type Ckp SCN Ckp Time Name
117 Full 24338668495 06-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201
119 Full 24338668495 06-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS203
121 Full 24338668495 06-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS205
BS Key Type LV Size Device Type Elapsed Time Completion Time
781 Full 128K DISK 00:27:54 07-JUL-11
BP Key: 781 Status: EXPIRED Compressed: NO Tag: FULLDB
Piece Name: \\PRODSERVER\DBBACKUPS\PMMGQ09T_1_1
List of Datafiles in backup set 781
File LV Type Ckp SCN Ckp Time Name
118 Full 24338668495 06-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS202
120 Full 24338668495 06-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS204
BS Key Type LV Size Device Type Elapsed Time Completion Time
783 Full 22G DISK 00:33:07 09-JUL-11
BP Key: 783 Status: EXPIRED Compressed: NO Tag: FULLDB09072011
Piece Name: \\PRODSERVER\DBBACKUPS\PQMH1JNA_1_1
List of Datafiles in backup set 783
File LV Type Ckp SCN Ckp Time Name
2 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS206
53 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS207
118 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS202
119 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS203
120 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS204
BS Key Type LV Size Device Type Elapsed Time Completion Time
784 Full 13G DISK 00:28:33 09-JUL-11
BP Key: 784 Status: EXPIRED Compressed: NO Tag: FULLDB09072011
Piece Name: \\PRODSERVER\DBBACKUPS\PRMH1LLN_1_1
List of Datafiles in backup set 784
File LV Type Ckp SCN Ckp Time Name
54 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS208
117 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201
121 Full 24380946158 09-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS205
BS Key Type LV Size
786 Full 28G
List of Datafiles in backup set 786
File LV Type Ckp SCN Ckp Time Name
2 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS206
53 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS207
118 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS202
119 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS203
121 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS205
Backup Set Copy #1 of backup set 786
Device Type Elapsed Time Completion Time Compressed Tag
DISK 00:31:39 16-JUL-11 NO TAG20110716T135920
List of Backup Pieces for backup set 786 Copy #1
BP Key Pc# Status Piece Name
786 1 UNAVAILABLE \\PRODSERVER\DBBACKUPS\PTMHJ91Q_1_1
Backup Set Copy #2 of backup set 786
Device Type Elapsed Time Completion Time Compressed Tag
DISK 00:31:39 19-JUL-11 NO TAG20110716T135920
List of Backup Pieces for backup set 786 Copy #2
BP Key Pc# Status Piece Name
789 1 AVAILABLE X:\TEMP\PTMHJ91Q_1_1
BS Key Type LV Size
787 Full 17G
List of Datafiles in backup set 787
File LV Type Ckp SCN Ckp Time Name
54 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS208
117 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201
120 Full 24470026732 16-JUL-11 E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS204
Backup Set Copy #1 of backup set 787
Device Type Elapsed Time Completion Time Compressed Tag
DISK 00:29:36 16-JUL-11 NO TAG20110716T135920
List of Backup Pieces for backup set 787 Copy #1
BP Key Pc# Status Piece Name
787 1 UNAVAILABLE \\PRODSERVER\DBBACKUPS\PUMHJATD_1_1
Backup Set Copy #2 of backup set 787
Device Type Elapsed Time Completion Time Compressed Tag
DISK 00:29:36 19-JUL-11 NO TAG20110716T135920
List of Backup Pieces for backup set 787 Copy #2
BP Key Pc# Status Piece Name
788 1 AVAILABLE X:\TEMP\PUMHJATD_1_1In OS level, logged on user has access privileges:
D:\>copy d:\temp\test.log D:\ORACLE\ORADATA\DAWA\UNDOTBS201.txt
1 file(s) copied.
What should I do to get rid of that error?
Oracle 10g R1 on Windows 2003 32-bit
OzOracle wrote:
Hi,
I'm facing a strange error.
I'm trying to restore a database from a cold backupsets created by RMAN into a new machine.
My restore commands returns "RMAN-06015" when it tries to execute "switch datafile" command.
RMAN> run{
2> set newname for datafile
3> 'E:\ORACLE\PRODUCT\10.1.0\ORADATA\DAWA\UNDOTBS201' TO
4> 'D:\oracle\oradata\dawa\UNDOTBS201';
5> switch datafile all;
6> }
executing command: SET NEWNAME
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch command at 07/19/2011 11:36:55
RMAN-20230: datafile copy not found in the recovery catalog
RMAN-06015: error while looking up datafilecopy name: D:\ORACLE\ORADATA\DAWA\UNDOTBS201
Hi,
Unless you have restored the datafile or it does exist then it is expected error when you try to switch datafile
Try restore the datafile first and switch datafile after that
Cheers
Similar Messages
-
Switch datafile datafilespec to copy ; what this does ?
1) SWITCH DATAFILE datafileSpec;
2) SWITCH DATAFILE datafileSpec TO COPY;
^^
I cant understand the difference in the above 2 commands teIs there a difference in the above 2 commands.
The description in DOC is :
DATAFILE datafileSpec TO COPY : Specifies the datafile that you wish to rename. As with DATABASE TO COPY, specifies to switch this datafile to the latest image copy.
When would the 2nd option be preferred over the 1st ?The basic difference is that switch datafile datafileSpec can not be run outsize a run block whereas "SWITCH DATAFILE datafileSpec TO COPY";
perfectly does. More over "SWITCH DATAFILE datafileSpec" can not be use barely.
consolidaterac1@oracle $ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Mon May 18 09:03:27 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: X4540 (DBID=1568043037)
RMAN> copy datafile 1 to '+DATA';
Starting backup at 18-MAY-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=292 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/x4540/datafile/system.256.685477569
output file name=+DATA/x4540/datafile/system.370.687171837 tag=TAG20090518T090350 RECID=392 STAMP=687171858
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> startup mount force;
Oracle instance started
database mounted
Total System Global Area 2058981376 bytes
Fixed Size 1300968 bytes
Variable Size 553649688 bytes
Database Buffers 1493172224 bytes
Redo Buffers 10858496 bytes
RMAN> switch datafile 1 to copy;
datafile 1 switched to datafile copy "+DATA/x4540/datafile/system.370.687171837"
RMAN> recover datafile 1 ;
Starting recover at 18-MAY-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=314 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 18-MAY-09
RMAN> alter database open;
database opened
RMAN> copy datafile 1 to '+DATA';
Starting backup at 18-MAY-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=314 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/x4540/datafile/system.370.687171837
output file name=+DATA/x4540/datafile/system.369.687172089 tag=TAG20090518T090802 RECID=394 STAMP=687172107
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
Finished backup at 18-MAY-09
RMAN> startup mount force;
Oracle instance started
database mounted
Total System Global Area 2058981376 bytes
Fixed Size 1300968 bytes
Variable Size 553649688 bytes
Database Buffers 1493172224 bytes
Redo Buffers 10858496 bytes
RMAN> switch datafile 1;
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: "comma, to"
RMAN-01007: at line 1 column 18 file: standard input
RMAN> run{
2> switch datafile 1;
3> }
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch command at 05/18/2009 09:09:41
RMAN-06039: SET NEWNAME command has not been issued for datafile 1
RMAN> copy datafile 20 to '+DATA';
Starting backup at 18-MAY-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+DATA/x4540/datafile/academy.327.685962083
output file name=+DATA/x4540/datafile/academy_bts.368.687172365 tag=TAG20090518T091237 RECID=396 STAMP=687172384
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> sql 'alter database datafile 20 offline';
sql statement: alter database datafile 20 offline
RMAN> run{
2> switch datafile 20 to datafilecopy '+DATA/x4540/datafile/academy_bts.368.687172365';
3> }
datafile 20 switched to datafile copy
input datafile copy RECID=396 STAMP=687172384 file name=+DATA/x4540/datafile/academy_bts.368.687172365
RMAN> recover datafile 20;
Starting recover at 18-MAY-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-MAY-09
RMAN> sql 'alter database datafile 20 online';
sql statement: alter database datafile 20 online
RMAN> copy datafile 20 to '+DATA';
Starting backup at 18-MAY-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+DATA/x4540/datafile/academy_bts.368.687172365
output file name=+DATA/x4540/datafile/academy_bts.367.687172763 tag=TAG20090518T091915 RECID=398 STAMP=687172779
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> sql 'alter database datafile 20 offline';
sql statement: alter database datafile 20 offline
RMAN> run{
2> set newname for datafile 20 to '+DATA/x4540/datafile/academy_bts.367.687172763';
3> switch datafile 20;
4> }
executing command: SET NEWNAME
datafile 20 switched to datafile copy
input datafile copy RECID=398 STAMP=687172779 file name=+DATA/x4540/datafile/academy_bts.367.687172763
RMAN> recover datafile 20;
Starting recover at 18-MAY-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-MAY-09
RMAN> sql 'alter database datafile 20 online';
sql statement: alter database datafile 20 online
For more refer to
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta061.htm "Restrictions and Usage Notes" section.
Regards,
HS -
Creating a new controlfile with datafiles in RMAN backup
Hi,
i am using oracle 10g (10.2.0.1) in RHEL5 server. i am trying to restore a RMAN backup from one server to another new server with new db name. i have taken out the spfile from RMAN autobackup and created pfile from it and edited the pfile with new dbname and directory structure and started the db in nomount with the new pfile. Now i have restored the controfile from the RMAN autobackup tried to put the database in mount state. But it failed due to the below error
RMAN-03002: failure of alter db command at 11/05/2012 21:44:56
ORA-01103: database name 'ORADB' in control file is not 'DEVDB'
Hence i shutdown the database and started the db in nomount with new pfile and tried to create the controlfile with the new db name,but it failed as it is looking for the datafiles.
ORA-01503: CREATE CONTROLFILE failed
ORA-01565: error in identifying file
'/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_80jq0kfw_.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
All my datafiles reside in my RMAN backup. How to get the datafiles from RMAN backup in the above scenario??
Regards,
007Hello;
The location and filename and DBIS will be different, but you need something like this :
$ORACLE_HOME/bin/rman << EOF
CONNECT TARGET /
STARTUP NOMOUNT;
SET DBID 3754763357; #DBID of PROD database
RUN
ALLOCATE CHANNEL c1 DEVICE TYPE disk format '/u01/oradata/backups';
RESTORE CONTROLFILE FROM '/u01/oradata/backups/sb_t790762003_s85_p1';
ALTER DATABASE MOUNT;
SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/CLONE/system01.dbf';
SET NEWNAME FOR TEMPFILE 1 TO '/u01/app/oracle/oradata/CLONE/temp01.dbf';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
release channel c1;
ALTER DATABASE OPEN RESETLOGS; So you need "SET NEWNAME" for all your files
Full Example
http://www.visi.com/~mseberg/rman/restore_database_without_catalog.html
Best Regards
mseberg -
Hi
If I use "set new name" command in rman, do I always have to issue "switch datafile all;" command ?
I`ve just used duplicate command to duplicate a database and used "set new name" in run block , I didnt specify "switch datafile all" command , and it worked without any issuesHi,
We don't know your version, the commands you entered etc. but it's not always necessary. Perhaps you use DB_FILE_NAME_CONVERT for example ? In this case RMAN even does the "set new name" commands for you.
A quick example with a single command "duplicate" (the initP102DUP.ora I created from the spfile of P102 includes DB_FILE_NAME_CONVERT
and LOG_FILE_NAME_CONVERT) :
rman target sys/XXXXXX@P102 auxiliary /
Recovery Manager: Release 10.2.0.5.0 - Production on Sam. Févr. 5 09:25:01 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connecté à la base de données cible : P102 (DBID=1526015026)
connexion établie avec la base de données auxiliaire : P102DUP (non montée)
RMAN> duplicate target database to P102DUP;
Démarrage de Duplicate Db dans 05/02/11
utilisation du fichier de contrôle de la base de données cible au lieu du catalogue de récupération
canal affecté : ORA_AUX_DISK_1
canal ORA_AUX_DISK_1 : sid=155 typedev=DISK
contenu de script mémoire:
set until scn 454134;
set newname for datafile 1 to
"/u02/oradata/P102DUP/system01.dbf";
set newname for datafile 2 to
"/u02/oradata/P102DUP/undotbs01.dbf";
set newname for datafile 3 to
"/u02/oradata/P102DUP/sysaux01.dbf";
set newname for datafile 4 to
"/u02/oradata/P102DUP/users01.dbf";
restore
check readonly
clone database
exécution de script mémoire
exécution de la commande : SET until clause
exécution de la commande : SET NEWNAME
exécution de la commande : SET NEWNAME
exécution de la commande : SET NEWNAME
exécution de la commande : SET NEWNAME
Démarrage de restore dans 05/02/11
utilisation du canal ORA_AUX_DISK_1
canal ORA_AUX_DISK_1 : restauration du fichier de données 00001
copie du fichier de données en entrée recid=5 horodatage=741817866 nom=/u01/app/oracle/product/10.2.0/db_1/dbs/data_D-P102_I-1526015026_TS-SYSTEM_FNO-1_06m3eff4
destination de restauration du fichier de données 00001: /u02/oradata/P102DUP/system01.dbf
canal ORA_AUX_DISK_1 : copie du fichier de données 00001 copiée
fichier de sortie=/u02/oradata/P102DUP/system01.dbf
canal ORA_AUX_DISK_1 : restauration du fichier de données 00002
copie du fichier de données en entrée recid=7 horodatage=741817901 nom=/u01/app/oracle/product/10.2.0/db_1/dbs/data_D-P102_I-1526015026_TS-UNDOTBS1_FNO-2_08m3efhb
destination de restauration du fichier de données 00002: /u02/oradata/P102DUP/undotbs01.dbf
canal ORA_AUX_DISK_1 : copie du fichier de données 00002 copiée
fichier de sortie=/u02/oradata/P102DUP/undotbs01.dbf
canal ORA_AUX_DISK_1 : restauration du fichier de données 00003
copie du fichier de données en entrée recid=6 horodatage=741817895 nom=/u01/app/oracle/product/10.2.0/db_1/dbs/data_D-P102_I-1526015026_TS-SYSAUX_FNO-3_07m3efgh
destination de restauration du fichier de données 00003: /u02/oradata/P102DUP/sysaux01.dbf
canal ORA_AUX_DISK_1 : copie du fichier de données 00003 copiée
fichier de sortie=/u02/oradata/P102DUP/sysaux01.dbf
canal ORA_AUX_DISK_1 : restauration du fichier de données 00004
copie du fichier de données en entrée recid=8 horodatage=741817903 nom=/u01/app/oracle/product/10.2.0/db_1/dbs/data_D-P102_I-1526015026_TS-USERS_FNO-4_09m3efhe
destination de restauration du fichier de données 00004: /u02/oradata/P102DUP/users01.dbf
canal ORA_AUX_DISK_1 : copie du fichier de données 00004 copiée
fichier de sortie=/u02/oradata/P102DUP/users01.dbf
Fin de restore dans 05/02/11
instruction SQL : CREATE CONTROLFILE REUSE SET DATABASE "P102DUP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u02/oradata/P102DUP/redo01.rdo' ) SIZE 50 M REUSE,
GROUP 2 ( '/u02/oradata/P102DUP/redo02.rdo' ) SIZE 50 M REUSE,
GROUP 3 ( '/u02/oradata/P102DUP/redo03.rdo' ) SIZE 50 M REUSE
DATAFILE
'/u02/oradata/P102DUP/system01.dbf'
CHARACTER SET WE8ISO8859P1
contenu de script mémoire:
switch clone datafile all;
exécution de script mémoire
fichier de données 2 changé en copie de fichier de données
copie du fichier de données en entrée recid=1 horodatage=742296381 nom=/u02/oradata/P102DUP/undotbs01.dbf
fichier de données 3 changé en copie de fichier de données
copie du fichier de données en entrée recid=2 horodatage=742296381 nom=/u02/oradata/P102DUP/sysaux01.dbf
fichier de données 4 changé en copie de fichier de données
copie du fichier de données en entrée recid=3 horodatage=742296381 nom=/u02/oradata/P102DUP/users01.dbf
contenu de script mémoire:
set until scn 454134;
recover
clone database
delete archivelog
exécution de script mémoire
exécution de la commande : SET until clause
Démarrage de recover dans 05/02/11
utilisation du canal ORA_AUX_DISK_1
démarrage de la récupération après défaillance matérielle
journal d'archivage, thread 1 séquence 3 déjà sur disque en tant que fichier /u01/app/oracle/product/10.2.0/db_1/dbs/arch1_3_741731765.dbf
journal d'archivage, thread 1 séquence 4 déjà sur disque en tant que fichier /u01/app/oracle/product/10.2.0/db_1/dbs/arch1_4_741731765.dbf
journal d'archivage nom=/u01/app/oracle/product/10.2.0/db_1/dbs/arch1_3_741731765.dbf thread=1 séquence=3
journal d'archivage nom=/u01/app/oracle/product/10.2.0/db_1/dbs/arch1_4_741731765.dbf thread=1 séquence=4
récupération après défaillance matérielle terminée, temps écoulé : 00:00:01
Fin de recover dans 05/02/11
contenu de script mémoire:
shutdown clone;
startup clone nomount ;
exécution de script mémoire
base de données ouverte
Fin de Duplicate Db dans 05/02/11Best regards
Phil
Edited by: Philippe Florent on Feb 5, 2011 9:36 AM -- typo -
Switch datafile to datafile copy
Hello,
SWITCH DATAFILE '?/dbs/tbs_1.f' TO DATAFILECOPY '?/dbs/copies/cp1.f'
it's the line from RMAN reference docs.
But when I try to use this command RMAN tells me about error and says, it expected "to copy"...
Any clue?
Thanks in advance,
AliqIt has to be run inside a run { }:
RMAN> switch datafile 6 to datafilecopy '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbf';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "datafilecopy": expecting one of: "copy"
RMAN-01007: at line 1 column 22 file: standard input
RMAN> run {
2> switch datafile 6 to datafilecopy
3> '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbf';
4> }
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=670614636 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbfHTH
Enrique
PS. If your problem was solved, consider marking the question as answered. -
Step By step guide to recover lost datafiles from RMAN
Hi All
I am new to RMAN recovery.
I tried searching internet but I cannot find the detail steps for "How to restore datafile using RMAN when we have backup on tape and How to then apply archive logs" .
Can anyone please explain the steps .
I will really appreciate that.
ThanksThanks All I really appreciate your help :)
So as far as I understand here is my scenario and here are the steps I will follow please correct me if I am wrong.
I have last night backup of all datafiles and archivelog files on tape.
I lost one of datafile in morning.
Here are the steps I will perform to recover datafile
Restore the backup(including archive files) from tape to OS directory.
Mount the database
RMAN> run{
restore datafile 6;
RMAN > recover datafile 6;
RMAN> alter database open;
The RMAN will apply all the archivelog file and datafile will be available again.
I also have some additional question:
1) do I have to take datafile offline?
2) are these steps same for tablespace restore ? Do i have to take tablespace offline?
3) How will I confirm if all the archivelogs were applied to data file and data is upto date?
Thanks -
Extract datafile from rman backup
Hi
I want to search when logical corruption occurs in my database, so i want to extract my rman's backup and test one file with db_verify.
But i don't want to recover database. How to extract one file without recovery and destroing working database?
thnx
Podkovpodkov wrote:
Hi
I want to search when logical corruption occurs in my database, so i want to extract my rman's backup and test one file with db_verify.
But i don't want to recover database. How to extract one file without recovery and destroing working database?
thnx
PodkovWhy don't you use VALIDATE command to check for corruption without restoring the original file?
VALIDATE BACKUPSET 4;Instead backupset number, write correct backupset number where datafiles resides. VALIDATE command will check that datafile in that backupset against physical or logical corruption and will update V$DATABASE_BLOCK_CORRUPTION view
Additionaly, you should know that you can restore any datafile from backup and not recover it. Restore is the operation where you get database files from backup, Recover is the operation when you apply archived redo log files to restored datafiles and synchronize all files in the database
Edited by: Kamran Agayev A. on Aug 28, 2009 1:18 PM -
Error while recovering datafile using rman
Hi Friends,
I was trying to recover the deleted datafile 5 , but getting the following error... ( oracle 10g , database archive log mode )
RMAN> startup
database is already started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 02/28/2012 10:54:30
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: 'F:\ORACLE\ORADATA\DEMO\DEM01.DBF'
RMAN> restore datafile 5;
Starting restore at 28-FEB-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
released channel: ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/28/2012 10:54:49
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
RMAN>
Whats the way out...RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # defa
ult
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 100 M;
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' MAXPIECESIZE 100 M;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'G:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\S
NCFDEMO.ORA'; # default -
Restore datafile problem (RMAN)
I delete the datafile branch.
Than restore it form the yesterdays backup
RMAN>restore tablespace branch.
successfully restored branch.dbf.
RMAN> recover tablespace branch;
archive log thread 1 sequence 12 is already on disk as file C:\ESAS\ORACLE\APP\O
RACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2008_01_21\O1_MF_1_12_3S8KWFJM_.ARC
archive log thread 1 sequence 13 is already on disk as file C:\ESAS\ORACLE\APP\O
RACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2008_01_21\O1_MF_1_13_3S8KWZM1_.ARC
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/21/2008 10:20:57
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 5 lowscn 28752248 found to restore
RMAN-06025: no backup of log thread 1 seq 4 lowscn 28749190 found to restore
RMAN-06025: no backup of log thread 1 seq 3 lowscn 28735538 found to restore
RMAN-06025: no backup of log thread 1 seq 2 lowscn 28732630 found to restore
RMAN-06025: no backup of log thread 1 seq 1 lowscn 28704663 found to restore
RMAN-06025: no backup of log thread 1 seq 4 lowscn 28704627 found to restore
RMAN-06025: no backup of log thread 1 seq 3 lowscn 28684595 found to restore
RMAN-06025: no backup of log thread 1 seq 2 lowscn 28664563 found to restore
RMAN-06025: no backup of log thread 1 seq 1 lowscn 28642042 found to restore
RMAN-06025: no backup of log thread 1 seq 2225 lowscn 28640983 found to restore
RMAN-06025: no backup of log thread 1 seq 2224 lowscn 28640978 found to restore
RMAN-06025: no backup of log thread 1 seq 2223 lowscn 28633884 found to restore
SQL> alter tablespace branch online;
alter tablespace branch online
ERROR at line 1:
ORA-01190: control file or data file 4 is from before the last RESETLOGS
ORA-01110: data file 4: 'C:\ESAS\ORACLE\ORADATA\XE\BRANCH.DBF'
Also the size of the branch.dbf is 2,800GB normally, but when I restore it from the backupset it is nearly 500MB.If you did a RESETLOGS 3 days ago, that would have been between
the SCNs 26840983 and 28642042 ! based on these lines :
RMAN-06025: no backup of log thread 1 seq 1 lowscn 28642042 found to restore
RMAN-06025: no backup of log thread 1 seq 2225 lowscn 28640983 found to restore
However you do not expect to see a 500MB file. So I wonder if Oracle found
no backup of the datafile from recent days but found the most recent backup to be of so long ago (3+ days) that the datafile then was only 500MB.
That would mean that your recent daily backups have been failing or silently erroring out.
If RMAN cannot find a most recent (eg yesterday's) backup of a datafile, it will go back in time till it can find the "lastest" backup -- so the "lastest" backup of that datafile was a 500MB image many days ago ?
Check your backup destination directory -- your FlashbackRecoveryArea to see if backups are really going there. Check your backup logs. -
Rman, no datafile backup.
Dear...
I have one scenario.
RMAN Backup - Yesterday.
Datafile added today, and it lost in evening. How can one restore/recover datafile using RMAN, as datafile was not backed up in last RMAN backup.
Version : 10.2.0.1.0
Regards.YES, here is below.
archived log file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_18_7N6MQBWS_.ARC thread=1 sequence=18
creating datafile file number=7 name=C:\ORACLE\ORADATA\ORCL\USERS03.DBF
RMAN> backup database;
Starting backup at 21-FEB-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00002 name=C:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00003 name=C:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00005 name=C:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00006 name=C:\ORACLE\ORADATA\ORCL\USERS02.DBF
input datafile file number=00004 name=C:\ORACLE\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 21-FEB-12
channel ORA_DISK_1: finished piece 1 at 21-FEB-12
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_02_21\O1_MF_NNNDF_TAG20120221T132643_7N6MKWPX_.BKP tag=TAG20120221T132643 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 21-FEB-12
Starting Control File and SPFILE Autobackup at 21-FEB-12
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2012_02_21\O1_MF_S_775834060_7N6MMO5Q_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 21-FEB-12
RMAN> exit
SQL> alter tablespace users add datafile 'C:\ORACLE\ORADATA\ORCL\USERS03.dbf' size 10m;
Tablespace altered.
SQL>
SQL> alter system switch logfile;
System altered.
SQL> startup force mount exclusive restrict;
ORACLE instance started.
Total System Global Area 778387456 bytes
Fixed Size 1374808 bytes
Variable Size 310379944 bytes
Database Buffers 461373440 bytes
Redo Buffers 5259264 bytes
Database mounted.
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
C:\Users\bn2676>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 21 13:51:27 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 778387456 bytes
Fixed Size 1374808 bytes
Variable Size 310379944 bytes
Database Buffers 461373440 bytes
Redo Buffers 5259264 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\Users\bn2676>rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 21 13:51:52 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)
RMAN> restore controlfile from 'C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2012_02_21\O1_MF_S_775834060_7N6MMO5Q_.BKP';
Starting restore at 21-FEB-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=C:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
output file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL
Finished restore at 21-FEB-12
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 21-FEB-12
Starting implicit crosscheck backup at 21-FEB-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 21-FEB-12
Starting implicit crosscheck copy at 21-FEB-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 21-FEB-12
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_18_7N6MQBWS_.ARC
File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_19_7N6NXV4M_.ARC
File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2012_02_21\O1_MF_S_775834060_7N6MMO5Q_.BKP
File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2012_02_21\O1_MF_S_775834547_7N6N2WHN_.BKP
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 C:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to C:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00003 to C:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
channel ORA_DISK_1: restoring datafile 00004 to C:\ORACLE\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to C:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
channel ORA_DISK_1: restoring datafile 00006 to C:\ORACLE\ORADATA\ORCL\USERS02.DBF
channel ORA_DISK_1: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_02_21\O1_MF_NNNDF_TAG20120221T132643_7N6MKWPX_.BKP
channel ORA_DISK_1: piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2012_02_21\O1_MF_NNNDF_TAG20120221T132643_7N6MKWPX_.BKP tag=TAG20120221T132643
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 21-FEB-12
R recover database;
Starting recover at 21-FEB-12
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 18 is already on disk as file C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_18_7N6MQBWS_.ARC
archived log for thread 1 with sequence 19 is already on disk as file C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_19_7N6NXV4M_.ARC
archived log file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_18_7N6MQBWS_.ARC thread=1 sequence=18
creating datafile file number=7 name=C:\ORACLE\ORADATA\ORCL\USERS03.DBF
archived log file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_18_7N6MQBWS_.ARC thread=1 sequence=18
archived log file name=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_02_21\O1_MF_1_19_7N6NXV4M_.ARC thread=1 sequence=19
unable to find archived log
archived log thread=1 sequence=20
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/21/2012 13:54:04
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 20 and starting SCN of 1226889
RMAN> sql 'alter database open resetlogs';
sql statement: alter database open resetlogs
RMAN> exit
Recovery Manager complete.
C:\Users\bn2676>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 21 13:54:42 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select file_name from dba_data_files where tablespace_name='USERS';
FILE_NAME
C:\ORACLE\ORADATA\ORCL\USERS01.DBF
C:\ORACLE\ORADATA\ORCL\USERS02.DBF
C:\ORACLE\ORADATA\ORCL\USERS03.DBF
SQL> -
RMAN-06094: datafile 1 must be restored
Hello,
in standby database, using RMAN
RMAN> recover database noredo;
Starting recover at 11-DEC-12
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=4353 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.4.1.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4344 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=4346 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/11/2012 09:25:19
RMAN-06094: datafile 1 must be restored
RMAN> restore datafile 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/11/2012 09:38:05
ORA-27191: sbtinfo2 returned error
Additional information: 3402
Any idea,
thank you very much.Thank you very much.
yes, I know, but the primary is a 2TB huge database, a full backup will take a lot of time and disk space. in fact, I don't have disk to hold it (even compressed backup)
another option is go to rman catalog, trying to restore from tape full backup of primary.
do
RMAN> show all;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 12/11/2012 09:52:11
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of partial resync command on default channel at 12/11/2012 09:52:11
ORA-00001: unique constraint (RMAN.BDF_U1) violated
ORA-00001: unique constraint (RMAN.BDF_U2) violated
RMAN> restore datafile 1;
Starting restore at 11-DEC-12
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/11/2012 09:55:26
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of partial resync command on default channel at 12/11/2012 09:55:26
ORA-00001: unique constraint (RMAN.BDF_U1) violated
ORA-00001: unique constraint (RMAN.BDF_U2) violated
I checked ,that is a bug.
so seems like a little despire.
by the way, I have question:
we didn't backup the standby database. so if I login rman catalog and try to restore standby database,
how can I restore a standby databaes by using a primary database's full backup? (is there any possible to do this)
thank you very much.
Edited by: 968967 on Dec 11, 2012 8:28 AM -
RMAN can't SET NEWNAME for datafiles added after Level 1
Version: 11.2.0.3
Platform : Solaris 10
I have the most recent Level 0 , Level 1 and post-L1 Archive logs of the source DB.
I am trying restore, recover in a different machine using plain RMAN (not RMAN DUPLICATE) into a new datafile location.
After the Level 1 backup was taken, 2 datafiles (namdata01.dbf, finaldata01.dbf) were added ( this got 'recorded' on the subsequent post-L1 archivelogs )
Before I ran restore and recover, I restored the latest control file from the most recent L1
RMAN> restore controlfile from '/u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0cnjqk54_1_1_20120829.rmbk' ;Understandably, this control file doesn't have info about the 2 datafiles added after L1 .Wish I could restore control file from archive log :)
So, I cataloged the archive logs as well using CATALOG command.
RMAN> catalog start with '/u01/CATALOGTST/rmanBkpPieces';
using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/CATALOGTST/rmanBkpPieces
List of Files Unknown to the Database
=====================================
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_full_07njqj6j_1_1_20120828.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_full_08njqj8u_1_1_20120828.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0bnjqk3d_1_1_20120829.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0cnjqk54_1_1_20120829.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_13_790513173.arc
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_14_790513173.arc
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_15_790513173.arc
File Name: /u01/CATALOGTST/rmanBkpPieces/06njqj6h_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/09njqj90_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/0anjqk3b_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/0dnjqk56_1_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: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_full_07njqj6j_1_1_20120828.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_full_08njqj8u_1_1_20120828.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0bnjqk3d_1_1_20120829.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0cnjqk54_1_1_20120829.rmbk
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_13_790513173.arc -------------------> arch logs that contain info on the new datafiles
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_14_790513173.arc -------------------> arch logs that contain info on the new datafiles
File Name: /u01/CATALOGTST/rmanBkpPieces/arch_1_15_790513173.arc -------------------> arch logs that contain info on the new datafiles
File Name: /u01/CATALOGTST/rmanBkpPieces/06njqj6h_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/09njqj90_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/0anjqk3b_1_1
File Name: /u01/CATALOGTST/rmanBkpPieces/0dnjqk56_1_1
RMAN> EXITDuring Recovery , RMAN applied the archive logs and managed to create the datafiles successfully. But it can't restore the datafiles to the new location specified in the SET NEWNAME location. Luckily , I had created the original path and these 2 datafiles got restored there.
RMAN can't seem enforce SET NEWNAME for datafiles added after Level 1 backup despite cataloging.
Does SET NEWNAME .... thing work only for RESTORE ?
Log of restore and recover
$ cat restore-recover.txt
run
set newname for database to '/u01/app/CLONE1/oradata/sntcdev/%b' ;
set newname for tempfile '/u01/app/oradata/sntcdev/temp01.dbf' to '/u01/app/CLONE1/oradata/sntcdev/temp01.dbf' ;
restore database;
switch datafile all;
switch tempfile all;
recover database;
$
$ rman target / cmdfile=restore-recover.txt
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Sep 16 21:27:49 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: SNTCDEV (DBID=2498462290, not open)
RMAN> run
2> {
3> set newname for database to '/u01/app/CLONE1/oradata/sntcdev/%b' ;
4> set newname for tempfile '/u01/app/oradata/sntcdev/temp01.dbf' to '/u01/app/CLONE1/oradata/sntcdev/temp01.dbf' ;
5> restore database;
6> switch datafile all;
7> switch tempfile all;
8> recover database;
9> }
10>
11>
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 16-SEP-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
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/CLONE1/oradata/sntcdev/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/CLONE1/oradata/sntcdev/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/CLONE1/oradata/sntcdev/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/CLONE1/oradata/sntcdev/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/CLONE1/oradata/sntcdev/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/CLONE1/oradata/sntcdev/cisdata01.dbf
channel ORA_DISK_1: reading from backup piece /u01/RMAN_bkp/BKP_sntcdev/SNTCDEV_full_07njqj6j_1_1_20120828.rmbk
channel ORA_DISK_1: errors found reading piece handle=/u01/RMAN_bkp/BKP_sntcdev/SNTCDEV_full_07njqj6j_1_1_20120828.rmbk
channel ORA_DISK_1: failover to piece handle=/u01/CATALOGTST/rmanBkpPieces/SNTCDEV_full_07njqj6j_1_1_20120828.rmbk tag=TAG20120828T234834
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:35
Finished restore at 16-SEP-12
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=794179772 file name=/u01/app/CLONE1/oradata/sntcdev/cisdata01.dbf
renamed tempfile 1 to /u01/app/CLONE1/oradata/sntcdev/temp01.dbf in control file
Starting recover at 16-SEP-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/CLONE1/oradata/sntcdev/system01.dbf
destination for restore of datafile 00002: /u01/app/CLONE1/oradata/sntcdev/sysaux01.dbf
destination for restore of datafile 00003: /u01/app/CLONE1/oradata/sntcdev/undotbs01.dbf
destination for restore of datafile 00004: /u01/app/CLONE1/oradata/sntcdev/users01.dbf
destination for restore of datafile 00005: /u01/app/CLONE1/oradata/sntcdev/example01.dbf
destination for restore of datafile 00006: /u01/app/CLONE1/oradata/sntcdev/cisdata01.dbf
channel ORA_DISK_1: reading from backup piece /u01/RMAN_bkp/BKP_sntcdev/SNTCDEV_L1_0bnjqk3d_1_1_20120829.rmbk
channel ORA_DISK_1: errors found reading piece handle=/u01/RMAN_bkp/BKP_sntcdev/SNTCDEV_L1_0bnjqk3d_1_1_20120829.rmbk
channel ORA_DISK_1: failover to piece handle=/u01/CATALOGTST/rmanBkpPieces/SNTCDEV_L1_0bnjqk3d_1_1_20120829.rmbk tag=TAG20120829T000356
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
starting media recovery
archived log for thread 1 with sequence 13 is already on disk as file /u01/CATALOGTST/rmanBkpPieces/arch_1_13_790513173.arc
archived log for thread 1 with sequence 14 is already on disk as file /u01/CATALOGTST/rmanBkpPieces/arch_1_14_790513173.arc
archived log for thread 1 with sequence 15 is already on disk as file /u01/CATALOGTST/rmanBkpPieces/arch_1_15_790513173.arc
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_DISK_1: reading from backup piece /u01/CATALOGTST/rmanBkpPieces/0dnjqk56_1_1
channel ORA_DISK_1: piece handle=/u01/CATALOGTST/rmanBkpPieces/0dnjqk56_1_1 tag=TAG20120829T000454
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/archLogs/arch_1_12_790513173.arc thread=1 sequence=12
archived log file name=/u01/CATALOGTST/rmanBkpPieces/arch_1_13_790513173.arc thread=1 sequence=13
creating datafile file number=7 name=/u01/app/oradata/sntcdev/namdata01.dbf
archived log file name=/u01/CATALOGTST/rmanBkpPieces/arch_1_13_790513173.arc thread=1 sequence=13
archived log file name=/u01/CATALOGTST/rmanBkpPieces/arch_1_14_790513173.arc thread=1 sequence=14
archived log file name=/u01/CATALOGTST/rmanBkpPieces/arch_1_15_790513173.arc thread=1 sequence=15
creating datafile file number=8 name=/u01/app/oradata/sntcdev/finaldata01.dbf
archived log file name=/u01/CATALOGTST/rmanBkpPieces/arch_1_15_790513173.arc thread=1 sequence=15
unable to find archived log
archived log thread=1 sequence=16
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/16/2012 21:29:51
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 16 and starting SCN of 1004015
Recovery Manager complete.
$
$
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 16 21:30:04 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name from v$datafile;
NAME
/u01/app/CLONE1/oradata/sntcdev/system01.dbf
/u01/app/CLONE1/oradata/sntcdev/sysaux01.dbf
/u01/app/CLONE1/oradata/sntcdev/undotbs01.dbf
/u01/app/CLONE1/oradata/sntcdev/users01.dbf
/u01/app/CLONE1/oradata/sntcdev/example01.dbf
/u01/app/CLONE1/oradata/sntcdev/cisdata01.dbf
/u01/app/oradata/sntcdev/namdata01.dbf ----------------------> restored to old location ignoring SET NEWNAME ....
/u01/app/oradata/sntcdev/finaldata01.dbf ----------------------> restored to old location ignoring SET NEWNAME ....
8 rows selected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ cd /u01/app/oradata/sntcdev # -----------------------------> the old location
$
$ ls -alrt
total 243924
drwxr-xr-x 3 oracle oinstall 512 Aug 5 10:55 ..
drwxr-xr-x 2 oracle oinstall 512 Sep 16 20:59 .
-rw-r----- 1 oracle oinstall 104865792 Sep 16 21:29 namdata01.dbf
-rw-r----- 1 oracle oinstall 19931136 Sep 16 21:29 finaldata01.dbfRMAN> run
2> {
3> set newname for database to '/u01/app/CLONE1/oradata/sntcdev/%b' ;
4> set newname for tempfile '/u01/app/oradata/sntcdev/temp01.dbf' to '/u01/app/CLONE1/oradata/sntcdev/temp01.dbf' ;
5> restore database;
6> switch datafile all;
7> switch tempfile all;
8> recover database;
9> }RMAN executes the commands in the run block stepwise. In your case, starting from "set newname for database..." and lastly executing "recover database...".
Let me interpret it for you.
1. You restored the controlfile from the L1 backup which does not have any information about the 2 newly added datafiles. You cataloged the backuppieces and the archives to this controlfile, which means that the controlfile would now be aware that the required backups and archives are in this cataloged location.
2. You set newname for database to the desired location, thereby this command is executed restoring the database from the L0 and L1 backups. (These 2 backups do not have any information about the newly added datafiles and hence the 2 files would still not be restored).
3. You execute restore database which restores the files from L0 and L1 backup.
4. Switch datafile all, this renames all the files that were restored in the previous steps to the desired name/location that was mentioned in step 2.
5. Recover database: This is where the archivelogs come into picture. The data in the archives would be created & recovered. The newly added datafiles are now created & recovered but RMAN does not go back to STEP 2 and STEP 4 to re-execute the commands in STEP2 and STEP4 to restore it to the desired location (STEP 2) and Rename it (STEP 4). The files will have to renamed later by moving them manually to the location that you require.
So, RMAN does not execute the SET NEWNAME for datafiles which were added after the backup as the information about these files do not exist in the RMAN backuppieces. -
I am executing this command at the MOUNT mode and it is giving me an error. Can anyone specify the correct procedure for SWITCHING files
RMAN> SWITCH DATAFILE 'f:\oracle\oradata\ora1\user01.dbf' TO DATAFILECOPY 'f:\or
acle\oradata\user01.dbf';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01005: syntax error: found "switch": expecting one of: "allocate, alter, ba
ckup, beginline, blockrecover, catalog, change, connect, copy, create, crosschec
k, configure, duplicate, debug, delete, drop, exit, endinline, host, {, library,
list, mount, open, print, quit, recover, register, release, replace, report, re
normalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, spool
, startup, shutdown, send, show, test, upgrade, validate"
RMAN-01007: at line 1 column 1 file: standard inputAssuming 10.2: http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta061.htm#sthref967
-
RMAN-06010: error while looking up datafile: 82
Iam building dataguard - Physical Standby database by using the RMAN duplicate command and we are not using the recovery catalog but control file.
Iam getting the following error while running the duplicate command.
set newname for datafile 82 to
"/dflx02/flx/o01flx3rbs/rbs02_02.O01FLX3";
RMAN-06010: error while looking up datafile: 82
Actually we dropped the datafile(tablespace) before taken the backup but it is giving error though we are using the latest control file.
I do not see this file is available in the database as we dropped it successfully.
Could some one let me know what could be the problem and how to resolve it.
Your early response is greatly appreciated.
Note:
backup script -- It went successfully.
# Script to be used to backup the production in preparation of creating a DataGuard instance
YYYY=`date +"%Y"`
mmdd=`date +"%m%d"`
hh=`date +"%H"`
mm=`date +"%M"`
ss=`date +"%S"`
hhmmss=${hh}${mm}${ss}
dt=${YYYY}${mmdd}_${hhmmss}
echo "Starting backup on O01FLX3"
$ORACLE_HOME/bin/rman nocatalog <<EOF >> /dflx02/flx/oracle/log/full_backup_run_$dt.log
connect target /
configure device type disk clear;
configure channel device type disk maxpiecesize 4G;
configure device type disk backup type to compressed backupset parallelism 8;
run{
change archivelog all validate;
backup current controlfile for standby format '/tmp/stby_snapcf_O01FLX3.f';
backup database format '/dflx02/flx/o01flx3dump/rman/O01FLX3_%s_%p_%T_%t.bak';
sql 'alter system archive log current';
backup archivelog all format '/dflx02/flx/o01flx3dump/rman/O01FLX3_%s_%p_%T_%t.arc';
EXIT
EOF
duplicate Script:
#!/bin/ksh
# Script to create standby database for production.
YYYY=`date +"%Y"`
mmdd=`date +"%m%d"`
hh=`date +"%H"`
mm=`date +"%M"`
ss=`date +"%S"`
hhmmss=${hh}${mm}${ss}
dt=${YYYY}${mmdd}_${hhmmss}
echo "Starting dataguard instance on O01FLX3DR"
$ORACLE_HOME/bin/rman nocatalog <<EOF >> /dflx02/flx/oracle/log/cr_stdby_O01FLX3$dt.log
connect target /
connect auxiliary sys/xxxxxx@O01FLX3DR
configure channel device type disk maxpiecesize 4G;
configure device type disk backup type to compressed backupset parallelism 8;
run {
set until time "to_date('20080217:19:00', 'YYYYMMDD:HH24:MI')";
duplicate target database for standby dorecover nofilenamecheck;
exit;
EOF
set newname for datafile 82 to
"/dflx02/flx/o01flx3rbs/rbs02_02.O01FLX3";Thank you for your reply. Actually Iam not renaming the datafile but building the
dataguard instance and some how control file is looking for old datafile that was deleted.
Actually both primary and dataguard instances are running on 10.2.0.3 . Oracle control file is listing the datafile 82 as old deleted file, while building the dataguard.
---- This file was deleted long time back but still oracle control file is looking for this file while building the dataguard. Iam using the latest control file.
set newname for datafile 82 to
"/dflx02/flx/o01flx3rbs/rbs02_02.O01FLX3"
When I listed the datafile 82, it is showing the correct datafile.
RMAN> list backup of datafile 82;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
50234 Incr 2 26.93M DISK 00:04:03 18-FEB-08
BP Key: 101470 Status: AVAILABLE Compressed: YES Tag: DATABASE_BACKUP
Piece Name: /dflx02/flx/o01flx3dump/rman/O01FLX3_51757_1_20080218_647031779.bak
List of Datafiles in backup set 50234
File LV Type Ckp SCN Ckp Time Name
82 2 Incr 7953177017970 18-FEB-08 /dflx02/flx/o01flx3ndx15/flx_ndx3_18.O01FLX3
BS Key Type LV Size Device Type Elapsed Time Completion Time
50334 Incr 2 27.76M DISK 00:04:16 19-FEB-08
BP Key: 101587 Status: AVAILABLE Compressed: YES Tag: DATABASE_BACKUP
Piece Name: /dflx02/flx/o01flx3dump/rman/O01FLX3_51857_1_20080219_647119328.bak
List of Datafiles in backup set 50334
File LV Type Ckp SCN Ckp Time Name
82 2 Incr 7953257549488 19-FEB-08 /dflx02/flx/o01flx3ndx15/flx_ndx3_18.O01FLX3
So Iam thinking that there should be a problem in control file and let me know how to resolve it.
Please let me know if you have any questions.
Thanks for your help.
Suresh.D -
RMAN Duplicate DB fails to restore datafile created during backup.
Database is 9i.
Performing duplicate database using rman on seperate host.
Reason of failure is , there were datafiles created during backup. Question is , Is there a workaround to perform duplicate database to work.
Error :
released channel: aux1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/16/2007 14:42:44
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 791 found to restore
RMAN-06023: no backup or copy of datafile 790 found to restore
RMAN-06023: no backup or copy of datafile 789 found to restore
RMAN-06023: no backup or copy of datafile 788 found to restore
RMAN-06023: no backup or copy of datafile 787 found to restore
RMAN-06023: no backup or copy of datafile 786 found to restore
Backup Date is : 23rd Nov to 26th Nov
Datafile created between backup period are :
786 /oracle/prod/proddata17/btabd_322/btabd.data322 Nov-25-2007 02:58:38 AM
787 /oracle/prod/proddata17/btabd_323/btabd.data323 Nov-25-2007 03:06:02 AM
788 /oracle/prod/proddata17/btabd_324/btabd.data324 Nov-25-2007 03:17:48 AM
789 /oracle/prod/proddata17/btabd_325/btabd.data325 Nov-25-2007 03:26:50 AM
790 /oracle/prod/proddata17/btabd_326/btabd.data326 Nov-25-2007 03:32:31 AM
791 /oracle/prod/proddata17/btabd_327/btabd.data327 Nov-25-2007 03:39:59 AM
Restore Script :
rman TARGET dtbackup/dt0dmin@prod CATALOG rman_prd/rman_prd@rcat_db connect auxiliary /
run {
set until time = "TO_DATE('11/26/2007 10:30:00','mm/dd/yyyy hh24:mi:ss')";
allocate auxiliary channel aux1 type 'SBT_TAPE' PARMS="BLKSIZE=262144";
DUPLICATE TARGET DATABASE TO DUP ;
}I think there is no workaround and this is expected behavior - atleast till 10.2. If you refer oracle documentation, it says that it requires target database in either MOUNT or OPEN stage to duplicate database using RMAN. So RMAN will get current physical structure information about target database from its control file and when any file is not there in the backup, it will give error. Only way to resolve this is to take backup of these datafiles through RMAN either as backupset or copy. ( I think oracle can take hint from here and make RMAN database duplication possible for which backup is not available - its a small change in code - if backup not found, then start taking backup. Already in 11g, during RMAN duplication, RMAN can use backup from other server)
Maybe you are looking for
-
ITunes wont upgrade my iPhone 4 iOS software.
Hi. I recently updated my itunes to ver 10.2.1 I am now using a 16GB iPhone 4 but i used to have an iPhone 3GS. I didnt have any problems with my 3GS but for some reason I can't download the iOS 4.3 software using my iTunes for my iPhone 4. I tried u
-
I try to create a url item (e.g http://www.oracle.com) but when the url runs it returns the message 'The parameter is incorrect'. The <<http server>> and <<http server port>> fields in global settings portlet are correct. Can anyone help me? Thanks
-
White halo around exported flash gif animation
I am working on a Imac using Flash CS5. I can create a Flash animation with a transparent background but there is a slight white halo around the images. How do I export a Flash animation as a gif with absolutely no white halo at all. Is this possible
-
Here is messaqge : "I can't access iPhoto because of this message (sorry, it is in French) : "Votre bibliothèque est utilisée par une autre application ou est devenue illisible"". I am on a iMac 27"with OS X Lion. The problem appeared while I was doi
-
The itune Program will not load at work why
The Itune program wil not load at work why