Pythian Blog: Technical Track

Using asmcmd to Find the spfile and Password from ASM

I’m currently reviewing an environment that has been upgraded to 19c based on information from oratab. The reason for the review is to remove previously installed versions of the software.

 

 

Oracle software is installed to ORACLE_HOME, with variables pointing to directory location.

To my surprise, there are references to the previous ORACLE_HOME.

Here are the details:

--- Check oratab
[oracle@host.dr]/home/oracle>grep -Ev "^#|^$" /etc/oratab
testdb:/opt/oracle/product/19c/db_1:N         # line added by Agent
+ASM:/opt/oracle/product/19c/grid:N            # line added by Agent
[oracle@host.dr]

--- ASM version
[oracle@host.dr]/home/oracle>asmcmd -V
ORACLE_SID = [+ASM] ?
The Oracle base remains unchanged with value /opt1/oracle
asmcmd version 19.14.0.0.0
[oracle@host.dr]/home/oracle>

--- Source ASM
[oracle@host.dr]/home/oracle>. oraenv <<< +ASM
[oracle@host.dr]/home/oracle>echo $ORACLE_HOME
/opt/oracle/product/19c/grid
[oracle@host.dr]/home/oracle>

--- Find DB spfile
[oracle@host.dr]/home/oracle>asmcmd find + spfile*
+DATA/testdb_STB/PARAMETERFILE/spfile.1940.1080508983
+DATA/spfiletestdb.ora
[oracle@host.dr]/home/oracle>

--- Find ASM spfile
[oracle@host.dr]/home/oracle>asmcmd spget
/opt/oracle/product/18.5/grid/dbs/spfile+ASM.ora
[oracle@host.dr]/home/oracle>

--- Find DB password file
[oracle@host.dr]/home/oracle>asmcmd find + pw*

--- Find ASM password file
[oracle@host.dr]/home/oracle>asmcmd pwget --asm
/opt/oracle/product/18.5/grid/dbs/orapw+ASM
[oracle@host.dr]/home/oracle>

Based on the information found, the ASM password file and spfile are still residing in old homes.

Conclusion

  1. Verify all configurations before removing previous software versions.
  2. Before removing the directory, rename the directory and append old to it.
  3. After a defined time period, delete the directory.

 

I hope you found this post helpful. Feel free to drop any questions or share your thoughts in the comments, and make sure to sign up for updates.

 

 

 

No Comments Yet

Let us know what you think

Subscribe by email