Saturday, May 23, 2020

SPFILE STORED ON ASM DISK and some parameter gone wrong after Value Update

SPFILE STORED ON ASM DISK and some parameter gone wrong after Value Update?

bash-4.1$  srvctl start instance -db TSTDB -node ux00114q
PRCR-1013 : Failed to start resource ora.tstdb.db
PRCR-1064 : Failed to start resource ora.tstdb.db on node ux00114q
CRS-5017: The resource action "ora.tstdb.db start" encountered the following error:
ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated =====> we got this error while starting rac instance1
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/ux00114q/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.tstdb.db' on 'ux00114q' failed


Currently instance on node1 is down and on second instance 2 on node is up.
Here I am trying to start the instance 1 on node 1 but we are getting parameter error
Here lets solve this error .

Check is any pfile/spfile are present in ORACLE_HOME

-bash-4.1$ cd /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs
-bash-4.1$ ls -ltr *Ts*
-rw-r--r-- 1 oracle asmadmin 2696 Jul  9  2019 initTstDB1.ora-bkp
-rw-rw---- 1 oracle asmadmin 1544 May 23 17:41 hc_TstDB1.dat
-bash-4.1$

In My case i have only backup of pfile and no spfile.

Lets apply one regular solution

-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 23 17:43:45 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>  create pfile from spfile; -----------------> this is not working 
 create pfile from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?=/dbs/spfile@.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7

we got above error  lets try another below command

SQL> show parameter spfile;
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

SQL> create pfile='/tmp/p1.tmp' from spfile;
create pfile='/tmp/p1.tmp' from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?=/dbs/spfile@.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7

specify the full paths for the pfile and spfile, as follows:

Two ways to get it 

1)first login as grid user and  get path of spfile :- 

ASMCMD> pwd
+DATA/TstDB/PARAMETERFILE

2) or easiest way use 

-bash-4.1$ srvctl config database -d TSTDB
Database unique name: TstDB
Database name: TstDB
Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1
Oracle user: oracle
Spfile: +DATA/TSTDB/PARAMETERFILE/spfile.338.1041181263  =======================> this is path of Spfile.
Domain: nilesh.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,REDO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dbaoper
Database instances: TstDB1,TstDB2
Configured nodes: ux0011oq,ux0000q
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed

SQL> create pfile='/tmp/p1.tmp' from spfile='+DATA/TSTDB/PARAMETERFILE/spfile.338.1041181263';

File created.

-bash-4.1$ vi /tmp/p1.tmp -------------> change the parameter value , correct the value

-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 23 16:31:16 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.
SQL> create spfile from pfile='/tmp/p1.tmp'
  2  ;

File created.

Let find where this spfile created?

SQL> create spfile from pfile='/tmp/p1.tmp'
  2  ;

File created.

SQL> exit
Disconnected
-bash-4.1$ cd $ORACLE_HOME
-bash-4.1$ cd dbs
-bash-4.1$ ls -tlr
total 41776
-rw-rw---- 1 oracle asmadmin     1544 May 23 17:41 hc_TstDB1.dat
-rw-r----- 1 oracle asmadmin     6656 May 23 17:48 spfileTstDB1.ora ============> this created at ORACLE_HOME but no use

-bash-4.1$ pwd
/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs
-bash-4.1$ date
Sat May 23 17:48:54 EDT 2020
-bash-4.1$

but it create file at ORACLE_HOME , But we need at shared ASM location 
So this option will required little bit effort like copy the spfile from ORACLE_HOME location to asm disk location
and after that you have to update new spfile name in OCR disk so this option we will see later 
for now please check OPTION :1 
is the easy option.


OPTION :1 

So lets remove or backup that newly created spfileTstDB1.ora, well see first easy option.

/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs
-bash-4.1$ rm spfileTstDB1.ora
-bash-4.1$

-bash-4.1$ ls -lrt /tmp/p1.tmp
-rw-r--r-- 1 oracle asmadmin 2693 May 23 16:31 /tmp/p1.tmp

-bash-4.1$ ls -lrt /tmp/p1.tmp
-rw-r--r-- 1 oracle asmadmin 2693 May 23 16:31 /tmp/p1.tmp
-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 23 16:35:10 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.


SQL> startup nomount pfile='/tmp/p1.tmp';
ORACLE instance started.

Total System Global Area 4294967296 bytes
Fixed Size                  8628936 bytes
Variable Size             956302648 bytes
Database Buffers         3288334336 bytes
Redo Buffers               41701376 bytes
SQL>
SQL>
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL>create spfile from pfile='/tmp/p1.tmp';
File created.
Then check again whether its created spfile or not======>

-bash-4.1$ cd $ORACLE_HOME
-bash-4.1$ cd dbs
-bash-4.1$ pwd
/u01/app/oracle/product/12.2.0.1/dbhome_1/dbs
-bash-4.1$ ls -ltr
total 41768

-rw-r--r-- 1 oracle asmadmin     2696 Jul  9  2019 initTstDB1.ora
-rw-rw---- 1 oracle asmadmin     1544 May 23 16:36 hc_TstDB1.dat
-bash-4.1$

here i do not see spfile   after removed here its some weird behavior its ok , lets focus on our main issue.


SQL> !ls -tlr /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/*spfil*
 No spfile created at ORACLE_HOME location.

 Lets verify the location of spfile is it created ?

 Database unique name: TstDB
Database name: TstDB
Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1
Oracle user: oracle
Spfile: +DATA/TSTDB/PARAMETERFILE/spfile.338.1041181263  ====>  spfile location  showing old spfile which have worng parameter value
Domain: nilesh.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,REDO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dbaoper
Database instances: TstDB1,TstDB2
Configured nodes: ux0011oq,ux0000q
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed


Now lets me verify  at  ASM location i can see two files.No new spfile created
Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  MIRROR  COARSE   MAY 23 16:00:00  Y    spfile.266.1009721795
PARAMETERFILE  MIRROR  COARSE   MAY 23 16:00:00  Y    spfile.338.1041179851

lets use New way to create spfile from pfile.

-bash-4.1$ sqlplus / as sysdba
SQL> create spfile='+DATA' from pfile='/tmp/p1.tmp';

File created.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

check at ASM DISK location

ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  MIRROR  COARSE   MAY 23 16:00:00  Y    spfile.266.1009721795
PARAMETERFILE  MIRROR  COARSE   MAY 23 17:00:00  Y    spfile.338.1041184527
PARAMETERFILE  MIRROR  COARSE   MAY 23 18:00:00  Y    spfile.300.1041184811 ==> Its create new file with 300* name


SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

-bash-4.1$ srvctl config database -d TSTDB

Database unique name: TstDB
Database name: TstDB
Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1
Oracle user: oracle
Spfile: +DATA/TSTDB/PARAMETERFILE/spfile.300.1041184811 -------->Its automatic also update in the OCR disk.
Password file: +DATA/TSTDB/PASSWORD/pwdtstdb.260.1009721525
Domain: nilesh.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,REDO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dbaoper
Database instances: TstDB1,TstDB2
Configured nodes: ux00114q,ux00115q
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed

-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 23 18:02:07 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> shut immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
-bash-4.1$

lets check instance2 on Node 2.

-bash-4.1$ srvctl status instance -db TSTDB -node ux0011xxq ------> Still running good
Instance TstDB2 is running on node ux00115q

lets start instance 1 on Node 1.

-bash-4.1$ srvctl start instance -db TSTDB -node ux00114q

-bash-4.1$ srvctl status instance -db TSTDB -node ux00114q

Instance TstDB1 is running on node ux00114q
-bash-4.1$

-bash-4.1$ srvctl config database -d TSTDB

Database unique name: TstDB
Database name: TstDB
Oracle home: /u01/app/oracle/product/12.2.0.1/dbhome_1
Oracle user: oracle
Spfile: +DATA/TSTDB/PARAMETERFILE/spfile.300.1041184811 ------->Its automatic also update in the OCR disk.
Password file: +DATA/TSTDB/PASSWORD/pwdtstdb.260.1009721525
Domain: nilesh.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,REDO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dbaoper
Database instances: TstDB1,TstDB2
Configured nodes: ux00114q,ux00115q
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed

Instance TstDB1 is running on node ux00114q
Instance TstDB2 is running on node ux00115q
-bash-4.1$
-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 23 18:12:13 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> select name from v$database;

NAME
---------
TSTDB

SQL>  show parameter reco

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
db_recovery_file_dest                string      +RECO ========> value updated corrected.
db_recovery_file_dest_size           big integer 200G
db_unrecoverable_scn_tracking        boolean     TRUE
recovery_parallelism                 integer     0
remote_recovery_file_dest            string
SQL>

                                                      EOD

No comments:

Post a Comment