How to create spfile from pfile in ASM

Sometimes you need to recreate spfile from pfile located on filesystem and vice-versa. In Oracle RAC database spfile must be created on shared ASM storage.

Few days back I was changing some memory parameters and was unable to start the database. Because database was not accepting the parameter values.
After few changes I started the database using pfile and recreated the spfile.

Steps to Recreate spfile from pfile in ASM

 STEP 1: Shut down the database cluster. 
[oracle@orahow dbs]$ srvctl stop database -d TDPS
STEP 2: Start only one instance using existing pfile in nomount state.
Default pfile location will be $ORACLE_HOME/dbs directory.

[oracle@orahow dbs]$ sqlplus "/as sysdba"
SQL*Plus: Release 12.1.0.2.0 Production on Wed Aug 21 06:08:47 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup nomount pfile='/scratch/u01/app/oracle/product/12.1.0/dbhome_1/dbs/inittdps.ora';
ORACLE instance started.
Total System Global Area 4.2950E+10 bytes
Fixed Size 3722144 bytes
Variable Size 1.7717E+10 bytes
Database Buffers 2.5099E+10 bytes
Redo Buffers 130494464 bytes
SQL>
STEP 3: Create spfile on ASM from existing pfile.
SQL> create spfile='+DATA/spfiletdps1.ora' from pfile='/scratch/u01/app/oracle/product/12.1.0/dbhome_1/dbs/inittdps.ora';
File created.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Advanced Analytics
and Real Application Testing options 
STEP 4: Shutdown and start the database. 
[oracle@orahow dbs]$ srvctl stop database -d TDPS
[oracle@orahow dbs]$ srvctl start database -d TDPS
STEP 5: Check the status of the database.
[oracle@orahow ~]$ srvctl status database -d TDPS
Instance TDPS1 is running on node orahow
Instance TDPS2 is running on node orahox

Done!!!!

Some important queries related to this.

SQL> create pfile from spfile;
SQL> create spfile from pfile;
SQL> create pfile='/scratch/oracle/initsan.ora' from memory;
SQL> create pfile='/scratch/oracle/initsan.ora' from spfile;
SQL>  create pfile='/scratch/oracle/initsan.ora' from spfile='+DATA/spfiletdps.ora';
SQL> show parameter spfile;
SQL> create pfile='Location/initinstance_name.ora' from memory;