Friday, September 19, 2014

How to restore spfile from RMAN backup


Following are the steps which needs to be followed to recover spfile.

1. Create a pfile with only parameter db_name in it.
2. Start the instance using this pfile
3. Connect to rman 
4. Set the dbid
5. Restore spfile from autobackup
6. Remove the pfile and start the instance using restored spfile


[oracle@linux01 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Sep 19 07:20:28 2014

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

connected to target database: ORCL1 (not mounted)

RMAN> set dbid=1000680026

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 19-SEP-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1137 instance=ORCL1 device type=DISK

recovery area destination: +FRA_DG01
database name (or database unique name) used for search: ORCL1
channel ORA_DISK_1: AUTOBACKUP +fra_dg01/ORCL1/AUTOBACKUP/2014_09_19/s_858660592.8974.858660593 found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140919
channel ORA_DISK_1: restoring spfile from AUTOBACKUP +fra_dg01/ORCL1/AUTOBACKUP/2014_09_19/s_858660592.8974.858660593

channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 19-SEP-14

RMAN> exit

ERROR: NMO not setuid-root (Unix-only)

When trying to perform some operations from OEM for the recently installed agents server I got the below mentioned error:

ERROR: NMO not setuid-root (Unix-only)

Cause: root.sh had not been executed from agent home

Solution: Execute the root.sh from agent home and restart the agent.

[root@lnx01 12.1.0.4.0]# pwd
/opt/oracle/product/12.1.0.1.AGT/core/12.1.0.4.0

[root@lnx01 12.1.0.4.0]# ls -lrt root.sh
-rwxr-xr-x 1 oracle oradba 3916 Jul 23 23:33 root.sh

[root@lnx01 12.1.0.4.0]# sh root.sh