I ran into this little bug when trying to restore a databases server parameter file using RMAN.

The scenario

Oracle 9iR2, RMAN using a recovery catalog, incremental level 0 backup of the complete database.

I shut down my test database and removed the spfile. I should be able to recover it easily with the following commands:

$ rman target=backup_admin/password catalog=rcat_user/password@rman

RMAN> startup nomount;

RMAN> restore spfile from autobackup;

But instead I get this error:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/29/2006 16:48:26
RMAN-12010: automatic channel allocation initialization failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

Now my ORACLE_SID is set and dandy, the target most certainly is in the recovery catalog, so why do I get this error?

The solution

Since I was only using an spfile (no init.ora at all) there was nothing to set the db_name as the database started up. To resolve this I created an initdoomed.ora in the default location with only the following line in it (my database is named doomed.)

db_name=doomed

Returned to RMAN and tried all this again:

RMAN> restore spfile from autobackup;

Starting restore at 30-JUN-06

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20060630
channel ORA_DISK_1: autobackup found: c-2546195804-20060630-01
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 30-JUN-06

Success! You can now shutdown the database, remove the spfile if desired and startup the database with the spfile in place.

oracle, database, backup, 9ir2, rman, dba