Thursday, November 13, 2014

SPFILE restore failed with RMAN-04014 and RMAN-04014


User normally restores SPFILE when it is deleted accidently or the database is completed decommissioned and database need to restore from backup.

To restore SPFILE user must set the DBID
RMAN> set DBID=4563434343232

Before you restore SPFILE you need to bring up the database in nomount. But there is not SPFILE to bring the database.

Where SPFILE is not available startup the database with “STARTUP FORCE NOMOUNT”, RMAN will start the instance with a dummy parameter

You might see below error when trying to startup the database

RMAN> startup force nomount;
executing command: SET DBID
database name is “TST” and DBID is 4563434343232
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/u01/home/oracle/product/10.2.0/db_1/dbs/initTST.ora’
starting Oracle instance without parameter file for retrival of spfile
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 11/13/2014 15:37:45
RMAN-04014: startup failed: ORA-04031: unable to allocate 4128 bytes of shared memory (“shared pool”,”unknown object”,”sga heap(1,0)”,”kglsim hash table bkts”)


As you see ERROR message in bold, the default values to startup the database is not sufficient. These default values depend up on the version and operating system.

Set the SGA_TARGET environment variable with higher value at O/S level.
export ORA_RMAN_SGA_TARGET= 10240 

RMAN> startup force nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/home/oracle/product/10.2.0/db_1/dbs/initTST.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 107374182400 bytes
Fixed Size 2286808 bytes
Variable Size 1325402920 bytes
Database Buffers 106032005120 bytes
Redo Buffers 14487552 bytes


Now the database instance opened NOMOUNT state and you can restore the SPFILE

RMAN> restore spfile from autobackup;
Starting restore at 2014-11-13:15:40:35
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=33 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20141113
channel ORA_DISK_1: looking for autobackup on day: 20141112
channel ORA_DISK_1: looking for autobackup on day: 20141111
channel ORA_DISK_1: looking for autobackup on day: 20141110
channel ORA_DISK_1: looking for autobackup on day: 20141109
channel ORA_DISK_1: looking for autobackup on day: 20141108
channel ORA_DISK_1: looking for autobackup on day: 20141107
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 11/13/2014 15:40:37
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

 

The SPFILE restore has failed because the database mounted with DUMMY spfile and it does not have information about AUTOBACKUP of the SPFILE.

You have two options.

1. Restore the SPFILE using FROM clause
RMAN> restore spfile from '/ora-backup/TST/cf_c-2786659778-20141110-05';
Starting restore at 2014-11-13:15:40:59
using channel ORA_DISK_1
channel ORA_DISK_1: autobackup found: /ora-backup/TST/cf_c-2786659778-20141110-05
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 2014-11-13:15:41:02


2. Restore the SPFILE using Control file AUTOBACKUP
RMAN> RUN {
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'autobackup_format';
RESTORE SPFILE FROM AUTOBACKUP;
}

executing command: SET CONTROLFILE AUTOBACKUP FORMAT Starting restore at 13-JUN-13
using channel ORA_DISK_1
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20141113
channel ORA_DISK_1: AUTOBACKUP found: '/ora-backup/TST/cf_c-2786659778-20141110-05’
channel ORA_DISK_1: restoring spfile from AUTOBACKUP '/ora-backup/TST/cf_c-2786659778-20141110-05
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 2014-11-13:16:49:02

Regards
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com

2 comments:

  1. Hi, I encountered a similar issue. I backup a DB using these commands on the production server:

    run
    {
    backup database format '/DBDumps/SV_RmanBackups/db_%U';
    backup spfile format '/DBDumps/SV_RmanBackups/spfile_%U';
    backup archivelog all format '/DBDumps/SV_RmanBackups/arch_%U';
    }

    I see files generated on the backup folder.

    On another machine (same Linux and Oracle version), I used this:

    rman nocatalog
    connect target
    STARTUP NOMOUNT;
    set DBID 3102811003
    RESTORE CONTROLFILE from '/DBDumps/SV_RmanBackups/c-3102811003-20150512-02'

    and I got:
    [snip]
    channel ORA_DISK_1: looking for autobackup on day: 20150507
    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 05/13/2015 14:25:37
    RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

    I did the above backup and restore commands on the same day. Interestingly, on the production server (not really production so I can take it down), the same restore commands work.

    Any idea?

    ReplyDelete