Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • on IBM-AIX for display Linux/Unix
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • DBMS_SQL for alter session. Oracle
  • process id based files and processes Linux/Unix
  • DB Console Mainenance. Oracle
  • Ports used by Oracle Software Oracle
  • online_bkup.sql Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • Histogram Overview Oracle
  • To see mem usage and CPU usage system wide. Linux/Unix
  • Space padding in korn shell Linux/Unix
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • Rman Notes -1 Oracle

Which environment is used by currently running process ( Very good)

Posted on 22-May-2009 By Admin No Comments on Which environment is used by currently running process ( Very good)

Goal

After a process has been started, in order to find out the environment that was used to start it, the following methods can be used, depending on the OS platform:

Solution

1. Determine the pid of the process at OS level, eg for the smon process:

ps -ef | grep smon

2. Get the environment of the process:

SOLARIS:

pargs -e | grep ORACLE

LINUX:

cat /proc//environ

AIX:

ps eauwww

HP-UX:

On this Unix flavor there is no command to grasp the process environment directly. This can only be extracted using a debugger from the _environ structure. This procedure can be used on the other Unix flavors, as follows:

gdb smon
This attaches gdb to the pid mentioned above. The smon name is just an indication that the process we attach to is smon, but the only parameter that matters is the pid.

After attaching to the process, the following command extracts the information from the _environ list:

p ((char**)_environ)[0]@30

which would list the first 30 environment variables. If more are defined, just increase the parameter after @.

As well, the list can be extracted one item from the list at a time, using an iterator like:

p ((char**)_environ)[i]

which would extract element #i+1.

Windows:

To get the information on Windows, 2 things are needed:

1. check the registry for the ORACLE_* keys used to start the Oracle process. These keys are in:

HKEY_LOCAL_MACHINE/Software/Oracle/HOME

(before 10g)

HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_

from 10g on.

2. check the environment variables that were used by the oracle process at startup.

For this, one would need the process explorer utility from sysinternals, which can be found at:

www.sysinternals.com

(http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)

After starting the procexp utility, find the oracle process you want to check in the process list, right click on it, then select Properties. The Environment tab should indicate all the environment variables used when the process was started (even if dynamically in command line).

The utility also displays the key values from registry, but being so many it’s difficult to look for them.

Linux/Unix, shell

Post navigation

Previous Post: Recovering lost SYS password
Next Post: note id 373303.1

Related Posts

  • catall.sh Linux/Unix
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • Looping for remote servers and find its database from oratab file. Linux/Unix
  • Changing default shell Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Goldengate document from Porus Oracle
  • create a folder in multiple places Linux/Unix
  • Oracle Standby Database Library Index from Metalink Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Very Good Oralce Internal Tuning Book Oracle
  • findobj.sql Oracle
  • Default User Profile Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme