Home » RDBMS Server » Backup & Recovery » Restore & Recover controlfile after its deletion from a Backup Set (OEL, Oracle 11g R2)
Restore & Recover controlfile after its deletion from a Backup Set [message #584163] Thu, 09 May 2013 07:50 Go to next message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Hi all,

I am doing some tests to on backup & recovery scenarios on a testing VM.
I've set the database to archivelog, bounced the database:

Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size                  2215944 bytes
Variable Size            1392513016 bytes
Database Buffers         1107296256 bytes
Redo Buffers                3313664 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> ARCHIVE LOG START;
Statement processed.
SQL> ALTER DATABASE OPEN;

Database altered.

SQL>



I've created a folder for the backup sets in the OS:
[oracle@test1-oracle-1 ~]$  mkdir /u01/app/oracle/oradata/orcl/BACKUPSETS/


I've backed up my database, including the controlfile to this location:

login as: oracle
oracle@10.2.3.40's password:
Last login: Thu May  9 12:15:49 2013 from 10.10.12.230
[oracle@test1-oracle-1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu May 9 12:21:24 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1341263457)

RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE format '/u01/app/oracle/oradata/orcl/BACKUPSETS/%t_%s_%r.BCKP';

Starting backup at 09-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-MAY-13
channel ORA_DISK_1: finished piece 1 at 09-MAY-13
piece handle=/u01/app/oracle/oradata/orcl/BACKUPSETS/814969288_1_%r.BCKP tag=TAG20130509T122128 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-MAY-13
channel ORA_DISK_1: finished piece 1 at 09-MAY-13
piece handle=/u01/app/oracle/oradata/orcl/BACKUPSETS/814969314_2_%r.BCKP tag=TAG20130509T122128 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-MAY-13

RMAN>


After my database, and my controlfile were backed up, I went to find out where my controlfile resides:

SQL> show parameter DB_RECOVERY_FILE_DEST

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery
                                                 _area
db_recovery_file_dest_size           big integer 3882M


Then, I have deleted the control file from the OS:

[oracle@test1-oracle-1 ORCL]$
[oracle@test1-oracle-1 ORCL]$ cd /u01/app/oracle/flash_recovery_area/
[oracle@test1-oracle-1 flash_recovery_area]$
[oracle@test1-oracle-1 flash_recovery_area]$
[oracle@test1-oracle-1 flash_recovery_area]$ cd orcl
[oracle@test1-oracle-1 orcl]$ ls
control02.ctl
[oracle@test1-oracle-1 orcl]$ rm control02.ctl
[oracle@test1-oracle-1 orcl]$ ls
[oracle@test1-oracle-1 orcl]$


Now, I've found some info in documentation as well as on the web about restoring the controlfile from autobackup,

However, what if I have it only in my backup set, which is located in '/u01/app/oracle/oradata/orcl/BACKUPSETS/' ?

I also cannot seem to be able to even start RMAN in order to try, because I have no control file anymore:

[oracle@test1-oracle-1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu May 9 12:48:48 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/flash_recovery_area/orcl/control02.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
[oracle@test1-oracle-1 ~]$


How do I restore my controlfile from the backup set 814969314_2_%r.BCKP ?

Best Regards,
Andrey
Re: Restore & Recover controlfile after its deletion from a Backup Set [message #584166 is a reply to message #584163] Thu, 09 May 2013 08:18 Go to previous messageGo to next message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Just for the sake of good order, I've queried GV$CONTROLFILE to see where my copy of controlfile is,
Then performed

[oracle@hermes-oracle-1 orcl]$ cp /u01/app/oracle/oradata/orcl/control01.ctl /u01/app/oracle/flash_recovery_area/orcl/control02.ctl

and started the database.

Still, I would like to know what do I do if I don't have any FILE-BACKUP of my controlfile, except the backup-set (it is backed up for this exact cause, otherwise, why is it there at all, right? ).

How do I restore my controlfile from the backup set 814969314_2_%r.BCKP ?

[Updated on: Thu, 09 May 2013 08:19]

Report message to a moderator

Re: Restore & Recover controlfile after its deletion from a Backup Set [message #584169 is a reply to message #584166] Thu, 09 May 2013 08:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
restore controlfile from '<backup set file>';


This is in the documentation.

Regards
Michel
Re: Restore & Recover controlfile after its deletion from a Backup Set [message #584171 is a reply to message #584169] Thu, 09 May 2013 09:27 Go to previous messageGo to next message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Hi Michel,
Yes, I've come across it, however, I can't run it from SQL*PLUS (or trying to do so wrong),
and can't connect to RMAN, as it demands me to have a controlfile (deleted both the files I've found in V$CONTROLFILE):

SQL> restore controlfile from '/u01/app/oracle/oradata/orcl/BACKUPSETS/814969314_2_%r.BCKP';
SP2-0734: unknown command beginning "restore co..." - rest of line ignored.
SQL>




SQL> host rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu May 9 14:29:13 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

SQL>



Regards,
Andrey

[Updated on: Thu, 09 May 2013 09:27]

Report message to a moderator

Re: Restore & Recover controlfile after its deletion from a Backup Set [message #584175 is a reply to message #584171] Thu, 09 May 2013 11:26 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
The target database must be in nomount mode.
You must then set the dbib (in RMAN of course, SET DBID command) and execute the command I mentioned.

Regards
Michel
Re: Restore & Recover controlfile after its deletion from a Backup Set [message #584212 is a reply to message #584175] Fri, 10 May 2013 04:16 Go to previous message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Hi Michel,
Thank you for your help.

I started the database in nomount, set the DBID in RMAN, restored the controlfile from my datafile,
then performed recovery of the database and opened the database with resetlogs option.

Regards,
Andrey
Previous Topic: Recovery through RMAN 10g
Next Topic: rman deleting backup directory
Goto Forum:
  


Current Time: Thu Dec 26 19:22:05 CST 2024