Posts

Showing posts with the label find ORACLE_HOME

Oracle Database Auto Discovery

Image
Hi, I was asked by our development team to provide the best way to identify database parameters from database host, I was surprised to find so many options. Identifying all instances on the current machine Option 1:  $ ps -ef |grep smon | grep -v grep oracle    3025  1  0  2016 ?   00:00:48 asm_smon_+ASM oracle    11459  1  0 17:24 ?  00:00:00 ora_smon_ fdb oracle SID is  fdb and process id is  11459 Option 2:  $ pgrep  -lf _pmon_ 3025 asm_pmon_+asm 11459 ora_pmon_ fdb oracle SID is  fdb  and process id is  11459 Option 3:  cleaner way for sid: $ ps -ef |grep 'ora_smon_.*$' | grep -v grep | awk -F_ '/ora_smon/{print $NF}' fdb oracle SID is  fdb  Option 4:  When we already know ASM home (grid infrastructure) we can use the cluster commands: $ /oracle/product/12.1.0.2/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type"|awk '...

Basics commands for DBA part 1 - finding instance

Image
Hi, In the next few blogs I will discuss on scripting technics that DBA usually needs. I am concentrating in the commands, that are usually part of larger script. Later on I will submit some scripts that uses these technics. Identifying all instances running on the current machine Option 1:  # ps -ef |grep smon oracle    3025     1  0  2016 ?        00:00:48 asm_smon_+ASM oracle    11459      1  0 17:24 ?        00:00:00 ora_smon_ fdb root     12763 11332  0 17:52 pts/1    00:00:00 grep --color=auto smon SID is fdb and process id is 11459     Option 2:  # pgrep  -lf _pmon_ 3025 asm_pmon_+asm 11459 ora_pmon_ fdb SID is fdb and process id is 11459    Option 3:  Cleaner way for sid: $ ps -ef |grep 'ora_smon_.*$' | grep -v grep | awk -F_ '/ora_smon/{print $NF}' fdb SID is fdb Op...