To check os processid of oracle session , we can check v$process view.

SPID column of v$process view shows os processid.

We can use following query to check processid, status for specific user.

select p.spid, s.username, s.status, s.server, to_char(s.logon_time,'DD-MON-YY HH24:MI')
from v$process p, v$session s
where p.addr = s.paddr and s.status='ACTIVE'
;

I have connected through sys user :

[oracle@UAT-MIGR01 ~]$ sqlplus sys/oracle as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 10 14:04:51 2018

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

SQL> select name,open_mode from v$database;

NAME	  OPEN_MODE
--------- --------------------
TESTDB	  READ WRITE

SQL>

Now checking processid using above script.

SQL> select p.spid, s.username, s.status, s.server, to_char(s.logon_time,'DD-MON-YY HH24:MI')
from v$process p, v$session s
where p.addr = s.paddr and s.status='ACTIVE'
and s.username='SYS'; 
;  2    3    4  
SPID			 USERNAME			STATUS	 SERVER
------------------------ ------------------------------ -------- ---------
TO_CHAR(S.LOGON
---------------
14399			 SYS				ACTIVE	 DEDICATED
10-JAN-18 14:04


SQL>

check this processid 14399 from os prompt.

[oracle@UAT-MIGR01 ~]$ ps -ef| grep 14399
oracle   14399 14398  0 14:04 ?        00:00:00 oracletestdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   14413 12379  0 14:06 pts/3    00:00:00 grep 14399
[oracle@UAT-MIGR01 ~]$

 

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.