Wednesday 21 August 2019

RMAN - Restore the SPFILE from AUTOBACKUP on RAC 2 node 12.1.0.2.0

Senerio Preview:


  • Autobackup on confiured.
  • We can restore spfile using Autobackup
  • Remove spfile from location 
Solution:
  • Startup nomount 
  • Set DB ID
  • Restore spfile from autobackup
  • Shutdown immedaite and startup  using SRVCTL 
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> show all;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # 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
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0/dbhome_2/dbs/snapcf_rac1.f'; # default

ASMCMD> rm -f spfile.268.1016715759
ASMCMD> ls
ASMCMD-8002: entry 'PARAMETERFILE' does not exist in directory '+DATA/RAC/'
ASMCMD>
'

[root@srv1 trace]# srvctl start instance -i rac2 -d rac
[root@srv1 trace]#


rman target /
STARTUP FORCE NOMOUNT;
RUN
{
SET DBID (DBID=2604196865);
RESTORE SPFILE FROM AUTOBACKUP DB_RECOVERY_FILE_DEST='+FRA' DB_NAME='RAC';
}


[oracle@srv1 dbs]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Mon Aug 19 14:17:45 2019

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

connected to target database (not started)

RMAN> STARTUP FORCE NOMOUNT;

startup failed: ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/rac/spfilerac.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/rac/spfilerac.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA/rac/spfilerac.ora
ORA-15173: entry 'spfilerac.ora' does not exist in directory 'rac'
ORA-06512: at line 4

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

Total System Global Area    1073741824 bytes

Fixed Size                     2932632 bytes
Variable Size                281018472 bytes
Database Buffers             784334848 bytes
Redo Buffers                   5455872 bytes

RMAN> run
2> {

RMAN> SET DBID 2604196865;

executing command: SET DBID


RMAN> RESTORE SPFILE FROM AUTOBACKUP DB_RECOVERY_FILE_DEST='+FRA' DB_NAME='RAC';

Starting restore at 19-AUG-19
using channel ORA_DISK_1

recovery area destination: +FRA
database name (or database unique name) used for search: RAC
channel ORA_DISK_1: AUTOBACKUP +FRA/RAC/AUTOBACKUP/2019_08_19/s_1016719308.394.1016719309 found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20190819
channel ORA_DISK_1: restoring spfile from AUTOBACKUP +FRA/RAC/AUTOBACKUP/2019_08_19/s_1016719308.394.1016719309
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 19-AUG-19

RMAN> }


RMAN> SHUTDOWN IMMEDIATE

Oracle instance shut down

RMAN> STARTUP;

connected to target database (not started)
Oracle instance started
database mounted
database opened

Total System Global Area    1795162112 bytes

Fixed Size                     2925456 bytes
Variable Size                620760176 bytes
Database Buffers            1157627904 bytes
Redo Buffers                  13848576 bytes

RMAN> e
[root@srv1 trace]# srvctl start instance -i rac2 -d rac

No comments:

Post a Comment