Skip to Main Content
  • Questions
  • Recovery following loss of all controlfiles

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, David.

Asked: June 03, 2004 - 8:29 am UTC

Last updated: January 31, 2013 - 8:51 am UTC

Version: 9.2.0

Viewed 10K+ times! This question is

You Asked

Tom,

I've just put together a hands-on course for new DBAs in order that they can practice various backup and recovery scenarios. Our current techniques are based on UNIX Korn shell scripts (RMAN is a future direction, but not here yet).

One of the scenarios I've scripted is to recover from a loss of *all* controlfiles. The manual set describes two methods of performing this recovery: -

a) Recover using a backup controlfile and open with resetlogs.
b) Recreate the controlfile using the SQL generated by a previous backup to trace command. In this case, the database can be recovered and opened without the resetlogs.

The documentation suggests that option (a) is the recommended approach, however option (b) has the advantage of not requiring the logs to be reset (and the database subsequently backed up & secured). Our backup scripts allow either option to be taken (i.e. controlfile backed up and also backed up to trace).

Could you comment on the two approaches please - in particular why (a) is preferrable to (b).

Thanks.

and Tom said...


I do not think the documentation makes a "preference", it just says "if you have backup control files, you can do this if you do not, you can do that".

option b is what I would definitely use. It is just slightly more complex. But, however, most of the times -- if you've lost ALL control files, you probably lost the SYSTEM it was on as well (eg: current online redo = gone). It would be very rare to lose just the control files and nothing else. In the event you lose the current online redo -- you'll be using the resetlogs after an incomplete recovery anyway (eg: you are restoring from backup and applying whatever you have and opening reset logs)

Rating

  (37 ratings)

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

Comments

Ta.

David Broomfield, June 04, 2004 - 6:28 am UTC

Thanks for the info Tom. As a follow-up, would I ever need to use the backup version of a controlfile during a recovery given that I've got the SQL commands to recreate it from scratch?


Tom Kyte
June 04, 2004 - 8:26 am UTC

if you were using rman..... it would have information for rman in there. else, no - if you can create controlfile...... you have what you need.

Hi Tom

A reader, June 04, 2004 - 10:05 am UTC

Here is what happened with us. We had a server with Oracle installed and it got corrupted and lost our database. Then I tried to recover it to a new server using the backups but failed to do so (after reading the docs on Disaster Recovery). Thankfully I had an export file of the database and was able to restore it, incomplete recovery of course. But the data loss was minimal. So no big deal.
My question is:
It asked for the DBID of the database which is in the Controlfile. So I created a service on windows. Then I started the service and connected to the idle instance. I cataloged the Spfile and Controlfile autobackups. But as per the documentation it says to specify the DBID first and then startup force nomount the database. How can I specify a dbid as I do not know it? As the DBID in the controlfile will be different from the one specified.
Any suggestions will be welcome.
Thanks as always.

Tom Kyte
June 04, 2004 - 11:01 am UTC

what is "it" in this case? what asked you for a dbid?

but in anycase, you need to have the instance there (to recover to) and simply "startup mount" will give you the ability to:

idle> alter database mount;

Database altered.

idle> select dbid from v$database;

DBID
----------
458458563


You need have *no* database files, just control files at this point.

Isn't DBID in the FORMAT string of controlfile autobackups?

Paul, June 04, 2004 - 1:07 pm UTC

We use CTL_%F as our format
Here is sample controlfile autobackup

CTL_C-1018050070-20040513-00

In this case, 1018050070 is the DBID.


Thanks Paul

A reader, June 04, 2004 - 1:38 pm UTC

I never paid attention to this tiny detail.
Thanks a lot........ :D

rcovering RMAN catalog

Pinguman, July 27, 2004 - 9:45 am UTC

Hi

We are using rman catalog to backup our databases, in backup the catalog itself we use the controlfile.
I am trying to restore catalog to another server for disaster recovery purposes.

In the new host if I issue restore controlfile from autobackup I see this message:

RMAN> set dbid = 303930080;

executing command: SET DBID

RMAN> connect target /

connected to target database: (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 20040727 17:30:14
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=273 devtype=DISK

channel ORA_DISK_1: looking for autobackup on day: 20040727
channel ORA_DISK_1: looking for autobackup on day: 20040726
channel ORA_DISK_1: looking for autobackup on day: 20040725
channel ORA_DISK_1: looking for autobackup on day: 20040724
channel ORA_DISK_1: looking for autobackup on day: 20040723
channel ORA_DISK_1: looking for autobackup on day: 20040722
channel ORA_DISK_1: looking for autobackup on day: 20040721
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/27/2004 17:30:17
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

Which is not TRUE because if I query my rman controlfile in the original instance I see this:


RMAN> connect target /

connected to target database: RCAT (DBID=303930080)

RMAN> list backup summary;

using target database controlfile instead of recovery catalog

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ----------------- ------- ------- ---------- ---
1 B F A DISK 20040718 18:58:02 1 1 YES 20040718_3
2 B F A DISK 20040718 18:58:06 1 1 YES 20040718_3
3 B F A DISK 20040718 18:58:09 1 1 YES 20040718_3
4 B F A DISK 20040718 18:58:13 1 1 YES 20040718_3
5 B F A DISK 20040718 18:58:16 1 1 NO TAG20040718T185815
6 B F A DISK 20040718 19:01:11 1 1 YES 20040718_4
7 B F A DISK 20040718 19:01:16 1 1 YES 20040718_4
8 B F A DISK 20040718 19:01:21 1 1 YES 20040718_4
9 B F A DISK 20040718 19:01:21 1 1 YES 20040718_4
10 B F A DISK 20040718 19:01:25 1 1 NO TAG20040718T190124
11 B F A DISK 20040719 04:30:33 1 1 YES 20040719_1
12 B F A DISK 20040719 04:30:36 1 1 YES 20040719_1
13 B F A DISK 20040719 04:30:38 1 1 YES 20040719_1
14 B F A DISK 20040719 04:30:39 1 1 YES 20040719_1
35 B F A DISK 20040720 11:43:09 1 1 NO TAG20040720T114307
36 B F A DISK 20040720 11:46:33 1 1 YES 20040720_9
37 B F A DISK 20040720 11:46:39 1 1 YES 20040720_9
38 B F A DISK 20040720 11:46:51 1 1 YES 20040720_9
39 B F A DISK 20040720 11:46:52 1 1 YES 20040720_9
40 B F A DISK 20040720 11:46:56 1 1 NO TAG20040720T114654
41 B F A DISK 20040727 11:29:06 1 1 YES 20040727_1
42 B F A DISK 20040727 11:29:07 1 1 YES 20040727_1
43 B F A DISK 20040727 11:29:11 1 1 YES 20040727_1
44 B F A DISK 20040727 11:29:23 1 1 YES 20040727_1
45 B F A DISK 20040727 11:29:30 1 1 NO TAG20040727T112929

RMAN> list backupset 45;


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

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -----------------
45 Full 2M DISK 00:00:01 20040727 11:29:30
BP Key: 45 Status: AVAILABLE Compressed: NO Tag: TAG20040727T112929
Piece Name: /ORABACKUP/rdbms_backup/RCAT/AUTOBACKUP/c-303930080-20040727-00
Controlfile Included: Ckp SCN: 524867 Ckp time: 20040727 11:28:19

There are autobackups! Why it syas there arent?

We are using Oracle 10g

cheers


Tom Kyte
July 27, 2004 - 9:59 am UTC

are the backups available in the same named place on this new host?

of course!!

pinguman, July 27, 2004 - 10:12 am UTC

they are!
----------
new_host
ll /ORABACKUP/rdbms_backup/RCAT/AUTOBACKUP
total 14260
-rw-r--r-- 1 oracle oinstall 2916352 Jul 27 17:26 c-303930080-20040718-00
-rw-r--r-- 1 oracle oinstall 2916352 Jul 27 17:26 c-303930080-20040718-01
-rw-r--r-- 1 oracle oinstall 2916352 Jul 27 17:26 c-303930080-20040720-03
-rw-r--r-- 1 oracle oinstall 2916352 Jul 27 17:26 c-303930080-20040720-04
-rw-r--r-- 1 oracle oinstall 2916352 Jul 27 17:26 c-303930080-20040727-00
----------
old_host
ll /ORABACKUP/rdbms_backup/RCAT/AUTOBACKUP
total 14260
-rw-r----- 1 oracle oinstall 2916352 Jul 18 18:58 c-303930080-20040718-00
-rw-r----- 1 oracle oinstall 2916352 Jul 18 19:01 c-303930080-20040718-01
-rw-r----- 1 oracle oinstall 2916352 Jul 20 11:43 c-303930080-20040720-03
-rw-r----- 1 oracle oinstall 2916352 Jul 20 11:46 c-303930080-20040720-04
-rw-r----- 1 oracle oinstall 2916352 Jul 27 11:29 c-303930080-20040727-00


Totally LOST! :-(


Tom Kyte
July 27, 2004 - 11:03 am UTC

ahh, i think this is <Bug:2981422>, when using a non-default location.

can you copy them to $ORACLE_HOME/dbs and retry quick? that'll confirm it.

worked

A reader, July 27, 2004 - 11:08 am UTC

Hi

It worked!

So I guess AUTOBACKUP must always stay in $ORACLE_HOME/dbs?



CONTROLFILE AUTOBACKUP

Paul, July 27, 2004 - 12:32 pm UTC

If you use a different directory/format for controlfile autobackup you can set that format in the recovery script

eg:

set DBID=8267167
set controlfile autobackup format for device type disk to 'e:\dev\back\ctl-%F';
restore controlfile from autobackup;

Otherwise, yes, move them to OH\dbs or in my case on WinNT it looks in OH\database



Tom Kyte
July 27, 2004 - 12:53 pm UTC

correct -- the default format is just %F

RMAN> set dbid=458458563;

executing command: SET DBID

RMAN> restore controlfile from autobackup;

Starting restore at 27-JUL-04

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=17 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20040727
channel ORA_DISK_1: looking for autobackup on day: 20040726
channel ORA_DISK_1: looking for autobackup on day: 20040725
channel ORA_DISK_1: looking for autobackup on day: 20040724
channel ORA_DISK_1: looking for autobackup on day: 20040723
channel ORA_DISK_1: looking for autobackup on day: 20040722
channel ORA_DISK_1: looking for autobackup on day: 20040721
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/27/2004 12:44:51
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> show all
2> ;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
RMAN configuration has no stored or default parameters
RMAN configuration has no stored or default parameters
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 07/27/2004 12:44:56
ORA-01507: database not mounted

RMAN> set CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ORABACKUP/rdbms_backup/RCAT/AUTOBACKUP/%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

RMAN> restore controlfile from autobackup;

Starting restore at 27-JUL-04

using channel ORA_DISK_1
channel ORA_DISK_1: looking for autobackup on day: 20040727
channel ORA_DISK_1: autobackup found: /ORABACKUP/rdbms_backup/RCAT/AUTOBACKUP/c-458458563-20040727-02
channel ORA_DISK_1: controlfile restore from autobackup complete
replicating controlfile
input filename=/home/ora9ir2/oradata/ora9ir2/control01.ctl
output filename=/home/ora9ir2/oradata/ora9ir2/control02.ctl
output filename=/home/ora9ir2/oradata/ora9ir2/control03.ctl
Finished restore at 27-JUL-04



set dbid

A reader, July 28, 2004 - 1:45 am UTC

Hi

From documentation it suggests we should run set dbid before connecting but I see that you dont do it. Why the doc suggest that?

Tom Kyte
July 28, 2004 - 8:13 am UTC

we did set dbid's? you need to do it before running some of the commands, but you can connect to the instance.

Is this just a 10g thing?

Richard, April 23, 2005 - 5:30 am UTC

This thread has helped me a lot! I, too, could not fathom why RMAN was failing to find a backup I'd made just 10 minutes prior to attemting a restore of the spfile!

Is the bug an *oldie*, or is this a 10g problem?

Licencing Question: In a production situation I would want to have a catalog. I would (naturally) want the catalog in its own database on a separate server. In such a scenario, would separate licencing apply to the catalog setup? It would be a bit stingy of Oracle if a licence was required, wouldn't it?!

Tom Kyte
April 23, 2005 - 9:24 am UTC

it was reported in 9.2 and fixed in 10.1


I'm not the right source of accurate licensing information -- my *understanding* that you would want to confirm is the databases used by EM, RMAN and such are limited use run time databases that come with the feature.

My understanding.

Licensing

Richard, April 23, 2005 - 10:45 am UTC

I know this is drifting off-topic, a bit, but it would be marvellous if Oracle had an online program to answer licensing questions. Maybe a series of questions could be asked by the program, and it then, *ta-da*, presents the answer.

I realise that the issue of licensing can become complex, so such a program would help everyone, including the Oracle Sales Team, who, I imagine, spend a lot of time on this sort of question.

Just a thought.

I am having the same issue

Nags, August 14, 2006 - 6:09 pm UTC

I am using Oracle 10G 10.2.0.1.0 and I am getting the error

RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

All my backup files are under C:\Oracle\BACKUP\flash_recovery_area\DEVPTC6\CONTROLFILE\2006_08_11

I copied the files into database as will as dbs folder in my oracle home directory. But, still it does not work. What am I doing wrong ?

Here is the output of the commands that I run.
C:\>set ORACLE_SID=DEVPTC6

C:\>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 14 17:58:29 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database: DUMMY (not mounted)

RMAN> set dbid=2234322508

executing command: SET DBID

RMAN> set CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\Oracle\BACKUP\flash_recovery_area\DEVPTC6\CONTROLFILE\2006_08_11\%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
using target database control file instead of recovery catalog

RMAN> restore spfile from autobackup db_name='DEVPTC6';

Starting restore at 14-AUG-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=22 devtype=DISK

channel ORA_DISK_1: looking for autobackup on day: 20060814
channel ORA_DISK_1: looking for autobackup on day: 20060813
channel ORA_DISK_1: looking for autobackup on day: 20060812
channel ORA_DISK_1: looking for autobackup on day: 20060811
channel ORA_DISK_1: looking for autobackup on day: 20060810
channel ORA_DISK_1: looking for autobackup on day: 20060809
channel ORA_DISK_1: looking for autobackup on day: 20060808
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/14/2006 17:59:30
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece



Tom Kyte
August 15, 2006 - 7:18 am UTC

it would appear that you do not have the autobackup?

To Nags

Michel Cadot, August 15, 2006 - 7:32 am UTC

Maybe your autobackup is older.
You can use the MAXDAYS clause to allow RMAN to search for more than 7 days or use the UNTIL clause to start the search from a given date.

Michel

no autobackup found or specified handle is not a valid copy or piece

Nags, August 16, 2006 - 10:06 am UTC

I do have the autobackup files. Do I need to have the folder AUTOBACKUP or can I just put all the files under one folder ?

Currently all my files are under one folder, both normal and autobackup files. Is this going to cause issue ? Does oracle look for specific folders ?

Tom Kyte
August 16, 2006 - 10:39 am UTC

did you see Michael's comment above?

no autobackup found or specified handle is not a valid copy or piece

Nags, August 16, 2006 - 10:45 am UTC

I have the latest files in that folder. The backups were taken on 11th August 2006. And today is 16th. It is less than 7 days.

no autobackup found or specified handle is not a valid copy or piece

Nags, August 16, 2006 - 11:01 am UTC

I was able to figure it out. Oracle expects AUTOBACKUP files to be under AUTOBACKUP folder. It expectes that the paths are maintained under the root (flash_Recovery_area folder for me).

The moment I created the folder and matched the paths exactly as in my original machine, the restore was successful.

I would expect oracle to be smart enough to pick up all files under the folder that I give.

Query

aru, August 23, 2006 - 10:02 pm UTC

Hi Tom,
The above disaster recovery scenerios all use the AUTOBACKUP controlfile and spfile. What if we do not have autobackup configured but we do have backup of controlfile and spfile in the backupsets that we can see when we do a
> list backup of controlfile;

How else can we do the disaster recovery scenerio without autobackup or is autobackup a prerequesite??

C:\>set ORACLE_SID=DEVPTC6

C:\>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 14 17:58:29 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database: DUMMY (not mounted)

RMAN> set dbid=2234322508

executing command: SET DBID

RMAN> restore spfile;

Starting restore at 14-AUG-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=22 devtype=DISK

channel ORA_DISK_1: looking for autobackup on day: 20060814
channel ORA_DISK_1: looking for autobackup on day: 20060813
channel ORA_DISK_1: looking for autobackup on day: 20060812
channel ORA_DISK_1: looking for autobackup on day: 20060811
channel ORA_DISK_1: looking for autobackup on day: 20060810
channel ORA_DISK_1: looking for autobackup on day: 20060809
channel ORA_DISK_1: looking for autobackup on day: 20060808
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/14/2006 17:59:30
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece


Please help.

Regards,
ARU.




Query - please ignore the above query.

aru, August 23, 2006 - 10:06 pm UTC

Hi Tom,
The above disaster recovery scenerios all use the AUTOBACKUP controlfile and spfile. What if we do not have autobackup configured but we do have backup of controlfile and spfile in the backupsets that we can see when we do a
> list backup of controlfile;

How else can we do the disaster recovery scenerio without autobackup or is autobackup a prerequesite??

C:\>set ORACLE_SID=DEVPTC6

C:\>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 14 17:58:29 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database: DUMMY (not mounted)

RMAN> set dbid=2234322508

executing command: SET DBID

RMAN> restore spfile;

Starting restore at 24-AUG-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=22 devtype=DISK

RMAN-00571: ============================================
RMAN-00569: =========ERROR MESSAGE STACK FOLLOWS========
RMAN-00571: ============================================
RMAN-03002: failure of restore command at 24-AUG-06
RMAN-06563: control file or spfile must be restored from autobackup

Please help.

Regards,
ARU.




Restore controlfile without autobackup enabled and not having the current controlfile

PS, August 24, 2006 - 8:33 am UTC

Tom,

we have a situation here that due to hardware failure we lost the disk it is Prior year database. When i check the TSM server it shows the last backup taken on 18-Jul-06.

If i try to restore controlfile from autobackup it failed.

Oracle version 9205
TSM version 5.2

I used 11th July snap_control_f from the flat file backup to get these values.
RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default


i have old control file (11-jul-06) from the flat file backup, but TSM do not have more than one copy.

Even if we have the full backup on tape, would we still loose the data if we not enabled the AUTOBACKUP?

Regards,
VPS

Tom Kyte
August 27, 2006 - 7:47 pm UTC

why do you want to restore an old control file?


RESTORE SPFILE FROM AUTOBACKUP

Laxman Kondal, February 12, 2007 - 2:44 pm UTC

Hi Tom,

I am trying to test restore and recover Oracle10gR2 on Linux 4. Both old and new host are having same dir structrue and its a cold backup.
I followed instruction on document Oracle Database Backup and Recovery Basics 10g Release 2 (10.2)Part Number 14192-03 section 6.4.2.1 Restore of the SPFILE from the Control File Autobackup and got an error. What I did is:

[oracle@orael4b ~]$ echo $ORACLE_SID
optest
[oracle@orael4b ~]$ rman | tee /tmp/rman12.log

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Feb 12 14:09:02 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database: DUMMY (not mounted)

RMAN> set dbid=4284767456

executing command: SET DBID

RMAN> startup nomount

connected to target database (not started)
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initoptest.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 1218244 bytes
Variable Size 58722620 bytes
Database Buffers 92274688 bytes
Redo Buffers 7168000 bytes


RMAN> RUN
2> {
3> ALLOCATE CHANNEL C1 DEVICE TYPE DISK;
4> SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
5> '/u01/app/oracle/flash_recovery_area/OPTEST/autobackup/2007_02_12/%F';
6> RESTORE SPFILE FROM AUTOBACKUP;
7> }

using target database control file instead of recovery catalog
allocated channel: C1
channel C1: sid=39 devtype=DISK

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

Starting restore at 12-FEB-07

channel C1: looking for autobackup on day: 20070212
channel C1: looking for autobackup on day: 20070211
channel C1: looking for autobackup on day: 20070210
channel C1: looking for autobackup on day: 20070209
channel C1: looking for autobackup on day: 20070208
channel C1: looking for autobackup on day: 20070207
channel C1: looking for autobackup on day: 20070206
channel C1: no autobackup in 7 days found
released channel: C1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/12/2007 14:11:36
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> exit

Recovery Manager complete.
[oracle@orael4b ~]$ cd $ORACLE_BASE
[oracle@orael4b oracle]$ cd flash_recovery_area/OPTEST/autobackup/2007_02_12/
[oracle@orael4b 2007_02_12]$ ls -lrt
total 7308
-rw-r----- 1 oracle oinstall 7471104 Feb 12 13:23 o1_mf_s_614339344_2x17djdr_.bkp
[oracle@orael4b 2007_02_12]$

Autoback is in FRA and I moved it to $ORACLE_HOME/dbs also but no luck.

Sure there is some thing I am missing some but can not figure out.

Thanks and regards.

Bit confused about autobackup

Aru, April 12, 2007 - 7:23 pm UTC

Hi Tom,
Which mode of backup of controlfile would you recommend:-

1) configure controlfile autobackup format for device type disk to '/u02/...';
2) backup database include current controlfile;

Also I read that if datafile 1 is backed up then RMAN automatically inclues the current controlfile and spfile in backups of datafile 1. Then why should I use autobackup at all??

Frankly I do not understand the implications of the different types of controlfile backup's.

Thanks in advance,
Regards,
ARU.

Autobackups

Aru, April 26, 2007 - 12:49 am UTC

Hi Tom,
Suppose I wanted to test disaster recovery as in the document you sent me a bit earlier in the thread, it says;-

'To perform a disaster recovery, the minimum required set of backups is backups of some datafiles, some archived redo logs generated after the time of the backup, and at least one autobackup of the control file'.

What if someone has got no autobackup but has got RMAN backup's of controlfiles which are all validated ?
Please help,
Regards,
ARU.

Controlfile autobackup format

Serge Shmygelsky, May 11, 2007 - 10:29 am UTC

Looks like there is a problem with default 'FORMAT' clause for controlfile autobackup. If you leave it as it is:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'
then RMAN cannot find autobackup. But if you change it and add some directory, e.g.:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/tmp/%F'
then everything is OK.
At least that's happened on my system

DBID and RMAN

Confused, September 11, 2009 - 7:04 am UTC

Hi Tom :

Today something puzzling happened to me. I tried cloning using RMAN.

The clone server tnsnames.ora has an entry that points to the original db_instance in the source server.

So I made an rman backup from source server and ftp'd it to the clone server.

at the clone server, I started nomount an instance using an edited init.ora from the source server

then i fired up rman

connect target / (rman reports that db is not mounted)
restore controlfile from < backup path >
alter database mount
catalog start with < backup path >
restore database

Upon checking the alert log of the SOURCE database, I found "Incremental restore complete of datafile" entries on the source database. Somehow my restore database was executed on the source instead of the clone server.

What caused this? Could it be the unedited DBID or the tnsnames.ora entry?
Tom Kyte
September 14, 2009 - 12:02 pm UTC

mechanics of controlfile recreation

Hashmi, September 14, 2009 - 1:09 pm UTC

Dear Tom,
If we are taking controlfiles as RMAN metadata repository,then if all the controlfiles are lost and no backup is available whatsoever,then the only option left is
recreating the controlfile and open the database.
My question is:
would RMAN backups still be valid?
I guess not..What is your view?
Tom Kyte
September 14, 2009 - 2:02 pm UTC

you can sync the controlfile from a recovery catalog.

if you do not have a recovery catalog, then you would be in very very "manual mode".

manual mode?

Hashmi, September 15, 2009 - 8:52 am UTC

Dear Tom,
Assuming I have no recovery catalog,then how would i use my previous rman backups?
Tom Kyte
September 15, 2009 - 10:09 am UTC

your rman backups would have controlfiles in them - if they don't, you are doing it totally wrong. so it would be a non-issue.

Controlfile autobackup conditions

Ari, June 13, 2011 - 1:38 am UTC

Hi Tom,

I would like to ask a very basic question about RMAN:

I read : "RMAN can be configured to automatically back up the control file and server parameter file whenever the database structure metadata in the control file changes and whenever a backup record is added."
a)Now what do we mean by the term "database structure metadata in the control file changes"?
b) Is the autobackup of controlfile and spfile depends upon the either of the above conditions or autobackup happens whenever backup is taken only?
Tom Kyte
June 17, 2011 - 10:57 am UTC

a) add/drop datafiles for example.

b) backups only happen when backups are run - external conditions/states may affect what is backed up, but backing up only happens when you are backing up.

Multiplexing Backupset and FILESPERSET parameter

A reader, June 19, 2011 - 3:57 pm UTC

Hi Tom,

In one of the oracle document I found that:
The number of files in each backup set is determined by computing the lesser of the following values:
– The default number of files in a backup set (16 for archived logs, and 4 for datafiles)
– The number of files read by each channel.


Now I would like to know:
1) Is the above sentence "The default number of files in a backup set" is same as the term FILESPERSET parameter? If yes then how 16 for archived logs and 4 for datafiles (whereas RMAN compares the term 64 with the files per channel and get its minimum)?
2) Why in above case,number of files in each backup set depends upon "The number of files read by each channel" also?
3) Also I couldn't properly understand why multiplexing too many files can decrease restore performance?
Tom Kyte
June 20, 2011 - 12:55 pm UTC

It is typically greatly useful to read things in context - having a link to the quotes would have been really nice...


filesperset is a maximum file count, there are other things that can cause the number of files to be less than that.

a backupset is created by a channel, if you have multiple channels, you'll have multiple backupsets



If you multiplex two files together - you'll have interleaved them together - they are not stored one after the other - but interleaved, a little of file 1, then file 2 then file 1 then file 2 etc.

In order to restore file 1, you have to read all of file 1 and file 2.

Now, if you multiplex 30 files together - file 1 .. file 30 - you'd have to read files 1 through 30 in order to get it all.

Multiplexing of backupset

A reader, June 20, 2011 - 1:47 pm UTC

Hi Tom,

1) So what exactly needs to be done to prevent multiplexing? Do we have to use MAXOPENFILES parameter value as 1 always?

Also 2) We knew the disadvantage of Multiplexing of backupset, but what is the advantage? Is it reduces storage only?
Tom Kyte
June 20, 2011 - 1:58 pm UTC

1) you can do that, it is assigned on a per channel basis, so a setting of 1 would cause us to read one file at a time

2) it doesn't reduce storage??? How could it - you still have file 1 and file 2 on the backup media, they are just interleaved.

It permits for faster backups in many cases - you open more than one file and read from more than one file at a time - while some files are being read, others are being written to the backup device. It gives you parallelism.

Incremental RMAN Backups

A reader, June 21, 2011 - 3:55 pm UTC

Hi Tom,

In an Oracle document I found: "Each data block in a datafile contains a system change number (SCN), which is the
SCN at which the most recent change was made to the block. During an incremental backup, RMAN reads the SCN of each data block in the input file and compares it to the checkpoint SCN of the parent incremental backup......... If the SCN in the input data block is greater than or equal to the checkpoint SCN of the parent, then RMAN copies the block."


Now my questions are:

1) In the above scenario what do mean by "checkpoint SCN of parent incremental backup"? Is it a datafile level or block checkpoint SCN when the parent backup was made? and Why?
2) Suppose in a differential level 1 backup scenario, Block#2 and Block#3 are changed on Tuesday since level 0 incremental backup taken on Monday. So RMAN backs up only Block#2 and Block#3. Now say Block#1 and Block#2 are changed on Wednesday. So will RMAN backs up Block#1 and Block#2 both on Wednesday differential's backup (i.e. would it be looking back to both level 1 of Tuesday and level 0 of Monday)?
Tom Kyte
June 22, 2011 - 10:24 am UTC

1) that is a datafile level checkpoint

2) the parent of that level 1 would be a level 0 backup.

Incremental RMAN Backups

A reader, June 22, 2011 - 2:18 pm UTC

Hi Tom,

Therefore will that differential level 1 backup take the blocks which have changed since last level 1 backup (cumulative or differential) as well as any change in any other blocks recorded which was not included in the last level 1 differential backup? i.e. will it finally backs up block#2 as well as block#1 in the above example?
Tom Kyte
June 22, 2011 - 2:22 pm UTC

any block that was modified since the parent was backed up will be backed up.

forget about the other level 1's, they are not the parent. A level 1 incremental will backup all blocks modified since the last level 0 was taken.


Incremental RMAN Backups

A reader, June 22, 2011 - 2:38 pm UTC

Hi Tom,

I am bit confused now. You said that "A level 1 incremental will backup all blocks modified since the last level 0 was taken."

If the differential level 1 ignores its last level 1 incremental backup and backs up everything since level 0, then that should be behaving same as a Cumulative incremental backup which backs up everything since recent level 0 backup? Isn't it? I urge you to kindly clear my confusion or I cannot sleep tonight. :)
Tom Kyte
June 22, 2011 - 2:41 pm UTC

sorry, I read right over that word entirely. My mistake

http://docs.oracle.com/docs/cd/E11882_01/backup.112/e10642/glossary.htm#BRADV90151

the differential will go back to the last level 1 or 0 taken and get everything modified since then.

I was thinking, for whatever reason, "cumulative"

Incremental RMAN Backups

A reader, June 22, 2011 - 2:55 pm UTC

Hi Tom,

That's absolutely no problem.
So please check the below scenario for a final time and tell me if it is ok:

Let's assume a database has Blocks: block#1, block#2, block#3, block#4, block#5, block#6
Monday: Level 0 backup backup (Backs up block#1 to block#6).
Tuesday: Level 1 differential backup (Backs up say block#2, block#3 and block#5 only as these changed since level 0).
Wednesday: block#1, block#6, block#2 and block#5 are changed.
Thursday: Level 1 differential backup (backs up block#1, block#6, block#2 and block#5 only as changed since level 1 or level 0).

Is my understanding ok?
Tom Kyte
June 22, 2011 - 3:12 pm UTC

correct, for a differential incremental.

Incremental Backups

A reader, June 23, 2011 - 4:27 pm UTC

Hi Tom,

What happens after taking level 0 backup I mount or shutdown (or restricted user access) my database and I want to take a level 1 backup? Will I get any incremental level 1 backup at all?
Tom Kyte
June 23, 2011 - 4:40 pm UTC

You'll get a backup, the database never sleeps, transactions are happening continuously in the background. pmon, smon, all of those guys are doing stuff - there are always blocks being modified somewhere.

Rman incremental updated backup

A reader, June 26, 2011 - 10:10 am UTC

Hi Tom,

I have something to know Rman incremental updated backup. Suppose, we are running the below command:
RUN {
RECOVER COPY OF DATABASE WITH TAG 'incr_update';
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_update'
DATABASE;
}

Now the RECOVER COPY OF DATABASE command will search for incremental level 1 backup images for each datafile from recent level 1 backup and applies any update to the image copy backup created for those.
Whereas the BACKUP INCREMENTAL LEVEL 1 FOR RECOVER.. command will cause the incremental level 1 backupset (default) of old datafiles and as well as it creates an image copy of newly added datafile (if any) and adds that image copy of new datafile to full image copy backup of database (which are created by the same command earlier).
1) Are the above assumptions made correct?
2) I noticed that the image copy created by the BACKUP INCREMENTAL LEVEL 1 FOR RECOVER.. command of each datafile has size almost 2MB larger than what is defined for those datafiles. Can you please tell me why it is so?

RMAN queries

AK, November 17, 2011 - 8:00 am UTC

Greetings Tom, Thanks for all your help.

I have few queries regarding RMAN backup/recovery.

i) Consider a scenario where a single datafile is to be recovered.
During Recovery, can RMAN be made to skip,from applying some of the missing
archived redo logs, especially the ones which doesn't have redo vectors relevant
to the datafile in question.

ii) If we loose all datafiles related to SYSTEM tablespace(rest of database intact)
and realize no backup is available. Is there a way to recover the rest of the data,
(like recreating the Database and attaching the data files to it).

iii)Should we really worry about loosing UNDO tablespace(in context of RMAN recovery)
After all its contents can be re-generated through the redo logs ?

Thanks Again.
Tom Kyte
November 17, 2011 - 7:07 pm UTC

1) rman will make that decision, it will read the redo and apply what it wants to. You cannot make that decision for it, it will do it.

2) not unless you had previously transported the data out of the database - meaning the metadata we need in system (which you have lost) exists elsewhere.

in general - no, you just have a bunch of big files that are not useful if you lose your system tablespace.

3) YES - you better be worried about it.

Think about this "Should we really worry about losing our DATA tablespace. After all its contents can be re-generated through the redo logs?". Does that statement make sense (hopefully not). UNDO is just data in a data file. Redo is only useful if you have SOME STARTING POINT to apply the redo to. If you just have the redo for the last month - and nothing to apply it to (no backup from within the last month) - you have a bunch of data in some files, nothing of use.


redo needs to be applied to something, if you have nothing - you have nothing.

Control File Recovery

prathyush, January 28, 2013 - 4:25 am UTC

Hello Tom,

Why We Call, recovering the loss of control file using Cold backup as a Incomplete , though we'll apply all the redologs while recovery
Tom Kyte
January 31, 2013 - 8:51 am UTC

you are following the steps of what you would do for an incomplete recovery. The steps you follow to do an incomplete recovery - but you end up applying all redo.

it is because you are doing what you would do in order to perform an incomplete recovery.

it is also known as a "cancel based recovery"

More to Explore

Backup/Recovery

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