Scenario:
- Spfile is lost and we also do not have pfile .
- We encountered some error , getting details from alert log and create pfile based on backup of spfile
- Restore spfile from autobackup . But in rman setting autobackup should be on.
Error Faced ;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file
Restore the SPFILE from AUTOBACKUP example :
- Check rman parameter setting
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name SMRPLM are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
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 'C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\SNCFSMRPLM.ORA'; # default
- Backup full database , So every time we create backup spfile and controlfile backup automatically created.
RMAN> BACKUP DATABASE TAG 'DB_FULL';
ALTER SYSTEM SWITCH LOGFILE;
Starting backup at 18-MAY-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=869 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=C:\APP\TEST\ORADATA\SMRPLM\SOETBS01.DBF
input datafile file number=00003 name=C:\APP\TEST\ORADATA\SMRPLM\SYSAUX01.DBF
input datafile file number=00001 name=C:\APP\TEST\ORADATA\SMRPLM\SYSTEM01.DBF
input datafile file number=00005 name=C:\APP\TEST\ORADATA\SMRPLM\UNDOTBS01.DBF
input datafile file number=00007 name=C:\APP\TEST\ORADATA\SMRPLM\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 18-MAY-20
channel ORA_DISK_1: finished piece 1 at 18-MAY-20
piece handle=C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\01V0H36C_1_1 tag=DB_FULL comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:46
Finished backup at 18-MAY-20
Starting Control File and SPFILE Autobackup at 18-MAY-20
piece handle=C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\C-1550500176-20200518-00 comment=NONE
Finished Control File and SPFILE Autobackup at 18-MAY-20
Statement processed
- Delete spfile at OS level
SQL> sho parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string C:\APP\TEST\PRODUCT\12.2
.0\DBHOME_1\DATABASE\SPFILESMR
PLM.ORA
SQL>
- Shutdown DB and startup again we found some error during startup
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\INITSMRPLM.ORA'
SQL>
- Check alert log you will find DBID from there, also create pfile based on getting information from alert log
2020-05-18T16:38:10.299878+05:30
Starting control autobackup
2020-05-18T16:38:11.612072+05:30
Control autobackup written to DISK device
handle 'C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\C-1550500176-20200518-00'
2020-05-18T16:38:13.642886+05:30
Thread 1 advanced to log sequence 35 (LGWR switch)
Current log# 2 seq# 35 mem# 0: C:\APP\TEST\ORADATA\SMRPLM\REDO02.LOG
ORACLE_HOME = C:\app\TEST\product\12.2.0\dbhome_1
Node name : TEST
CPU : 8 - type 8664, 4 Physical Cores
Process Affinity : 0x0x0000000000000000
Memory (Avail/Total): Ph:11515M/1627
Using parameter settings in server-side spfile C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\SPFILESMRPLM.ORA
System parameters with non-default values:
processes = 640
nls_language = "AMERICAN"
nls_territory = "AMERICA"
sga_target = 4896M
control_files = "C:\APP\TEST\ORADATA\SMRPLM\CONTROL01.CTL"
control_files = "C:\APP\TEST\ORADATA\SMRPLM\CONTROL02.CTL"
db_block_size = 8192
compatible = "12.2.0"
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
dispatchers = "(PROTOCOL=TCP) (SERVICE=smrplmXDB)"
local_listener = "(ADDRESS=(PROTOCOL=TCP)(HOST=2TEST)(PORT=1521))"
audit_file_dest = "C:\APP\TEST\ADMIN\SMRPLM\ADUMP"
audit_trail = "DB"
db_name = "smrplm"
open_cursors = 300
pga_aggregate_target = 1628M
diagnostic_dest = "C:\APP\TEST"
vi INITSMRPLM.ORA
*.processes=640
*.nls_language="AMERICAN"
*.nls_territory= "AMERICA"
*.sga_target= 4896M
*.control_files="C:\APP\TEST\ORADATA\SMRPLM\CONTROL01.CTL","C:\APP\TEST\ORADATA\SMRPLM\CONTROL02.CTL"
*.db_block_size=8192
*.compatible="12.2.0"
*.undo_tablespace="UNDOTBS1"
*.remote_login_passwordfile="EXCLUSIVE"
*.dispatchers="(PROTOCOL=TCP) (SERVICE=smrplmXDB)"
*.local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=2TEST)(PORT=1521))"
*.audit_file_dest="C:\APP\TEST\ADMIN\SMRPLM\ADUMP"
*.audit_trail="DB"
*.db_name="smrplm"
*.instance_name="SMRPLM"
*.open_cursors=300
*pga_aggregate_target=1628M
*.diagnostic_dest="C:\APP\TEST"
- Restore spfile from autobackup
RMAN> STARTUP FORCE NOMOUNT;
Oracle instance started
Total System Global Area 5133828096 bytes
Fixed Size 8757472 bytes
Variable Size 1207963424 bytes
Database Buffers 3909091328 bytes
Redo Buffers 8015872 bytes
RMAN> RUN
2> {
3> SET DBID 1550500176;
4> RESTORE SPFILE FROM AUTOBACKUP DB_RECOVERY_FILE_DEST='C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\' DB_NAME='SMRPLM';
5> }
executing command: SET DBID
Starting restore at 18-MAY-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=251 device type=DISK
recovery area destination: C:\APP\TEST\PRODUCT\12.2.0\DBHOME_1\DATABASE\
database name (or database unique name) used for search: SMRPLM
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20200518
channel ORA_DISK_1: AUTOBACKUP found: c-1550500176-20200518-00
channel ORA_DISK_1: restoring spfile from AUTOBACKUP c-1550500176-20200518-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 18-MAY-20
- Shutdown and startup again database
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 5133828096 bytes
Fixed Size 8757472 bytes
Variable Size 956305184 bytes
Database Buffers 4160749568 bytes
Redo Buffers 8015872 bytes
RMAN> exit
Recovery Manager complete.
C:\Users\varunyadav>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon May 18 17:51:25 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> sho parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string C:\APP\VARUNYADAV\PRODUCT\12.2
.0\DBHOME_1\DATABASE\SPFILESMR
PLM.ORA
SQL>
No comments:
Post a Comment