View the environment variables of a process in Oracle

Source: Internet
Author: User

View the value of the environment variable used by an Oracle process. When nls_lang is null, we want to know the default value. When installing the version, we want to know that a process is generated by the database of that version, we can use the following method to view the environment variable value of the ORACLE process.

Because different operating systems use different commands, only the commands under the solaris platform are tested here, and only the methods are written on other platforms.

Environment: solaris 10, oracle 11gr2

1. view the process ID.

 
 
  1. $ ps -ef|grep ora 
  2.   oracle  4530     1   0 20:07:12 ?           0:00 ora_reco_htzdg 
  3.   oracle  4548     1   0 20:07:18 ?           0:02 ora_arc0_htzdg 
  4.   oracle  4575     1   0 20:07:22 ?           0:04 ora_cjq0_htzdg 
  5.   oracle 12667     1   0 22:05:34 ?           0:00 ora_w002_htzdg 
2. view the process environment variables:
 
 
  1. $ pargs -e 12667 
  2. 12667:  ora_w002_htzdg 
  3. envp[0]: SKGP_SPAWN_DIAG_PRE_EXEC_TS= 
  4. envp[1]: SKGP_HIDDEN_ARGS= 
  5. envp[2]: SKGP_SPAWN_DIAG_POST_FORK_TS= 
  6. envp[3]: SKGP_SPAWN_DIAG_PRE_FORK_TS= 
  7. envp[4]: ORACLE_SPAWNED_PROCESS=1 
  8. envp[5]: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt 
  9. envp[6]: DISPLAY=192.168.100.1:0.0 
  10. envp[7]: ORACLE_BASE=/u01/app/oracle 
  11. envp[8]: PWD=/u01/app/oracle/product/11.2.0/db_2/bin 
  12. envp[9]: _=./dbua 
  13. envp[10]: SHELL_HOME=/home/oracle/rs 
  14. envp[11]: ORACLE_SID=htzdg 
  15. envp[12]: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat 
  16. envp[13]: MAIL=/usr/mail/oracle 
  17. envp[14]: TZ=PRC 
  18. envp[15]: NLS_LANG=AMERICAN_AMERICA.AL32UTF8 
  19. envp[16]: JAVA64FLAG=-d64 
  20. envp[17]: HOME=/home/oracle 
  21. envp[18]: LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_2/lib:/u01/app/oracle/product/11.2.0/db_2/jdk/jre/lib/amd64/server:/u01/app/oracle/product/11.2.0/db_2/jdk/jre/lib/amd64:/u01/app/oracle/product/11.2.0/db_2/jdk/jre/../lib/amd64:/u01/app/oracle/product/11.2.0/db_2/lib:/u01/app/oracle/product/11.2.0/db_2/network/lib: 
  22. envp[19]: TERM=vt100 
  23. envp[20]: SHELL=/bin/ksh 
  24. envp[21]: LOGNAME=oracle 
  25. envp[22]: PATH= 
  26. envp[23]: ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_2 
  27. envp[24]: ORA_NET2_DESC=10,13 

The default NLS_LANG and other values that use the default environment variables appear.

3. Other platforms

LINUX: cat/proc/<pid from above>/environ
AIX: ps eauwww <pid from above>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.