[20200422]瞭解相關程式的環境變數.txt

lfree發表於2020-04-22

[20200422]瞭解相關程式的環境變數.txt

--//昨天看連結:
--//自己前幾天討論http://www.itpub.net/thread-2133164-1-1.html=>在rac 環境中 sqlnet.ora 中眾多引數如何判斷?

# echo -e  "grid\noracle"  | xargs -IQ ps h -u Q -f | awk '{print $2}' | xargs -IQ strings -f /proc/Q/environ | tr '\0' '\n' | grep TNS_ADMIN
/proc/7009/environ: TNS_ADMIN=/u01/app/11.2.0/grid/network/admin/
/proc/7246/environ: TNS_ADMIN=/u01/app/11.2.0/grid/network/admin/
/proc/7736/environ: TNS_ADMIN=/u01/app/11.2.0/grid/network/admin/
/proc/12798/environ: TNS_ADMIN=/u01/app/11.2.0/grid/network/admin
/proc/12799/environ: TNS_ADMIN=/u01/app/11.2.0/grid/network/admin
/proc/31753/environ: TNS_ADMIN=/u01/app/oracle/product/11.2.0/dbhome_1/network/admin

# echo -e  "grid\noracle"  | xargs -IQ ps h -u Q -f | awk '{print $2}' | xargs -IQ strings -f /proc/Q/environ | tr '\0' '\n' | grep ORACLE_HOME| sort | uniq
...

# echo -e  "grid\noracle"  | xargs -IQ ps h -u Q -f | awk '{print $2}' | xargs -IQ strings  /proc/Q/environ | tr '\0' '\n' | grep ORACLE_HOME| sort | uniq
ORACLE_HOME=/u01/app/11.2.0/grid
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

# echo -e  "grid\noracle"  | xargs -IQ ps h -u Q -f | awk '{print $2}' | xargs -IQ strings  /proc/Q/environ | tr '\0' '\n' | grep ORACLE_HOME| sort | uniq -c
     48 ORACLE_HOME=/u01/app/11.2.0/grid
    133 ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2687706/,如需轉載,請註明出處,否則將追究法律責任。

相關文章