Solved

Session identifier

Posted on 1997-11-06
1
804 Views
Last Modified: 2012-05-04
Which is the number that identifies uniquely an Oracle Session?
How can an user know it?

I know the session id SID and SERIAL# on table V$SESSION.
This two attributes are necessary to KILL a session.
How can an user know his sesion id SID and SERIAL#?

Besides, Auditing session id exists in the same table too (AUDSID column).
An user can know his AUDSID with: SELECT USERENV('SESSIONID') FROM DUAL

What's the different between AUDSID and (SID,SERIAL#)?

Thanks!
0
Comment
Question by:ppgg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
poncejua earned 80 total points
ID: 1080745
Hi ppgg,

First of all let me tell you that you have a funny user name.

The SID identifies the session; the SERIAL# identifies the session serial number and it is used to identify uniquely a session's objects; also guarantees that session-level commands are applied to the correct session objects if the session ends and another session begins with the same session ID.

On the other hand, AUDSID represents the auditing session ID.

If you want to obtain some information about the session you can do a join between the V$SESSION and DUAL tables. Let me give you an example:

Suppose that I want to know the username for my current session (username means the client name not the oracle username):

SELECT OSUSER FROM V$SESSION WHERE AUDSID = ( SELECT USERENV('SESSIONID') FROM DUAL);

I hope this helps you. If not please do not hesitate to contact me directly to my e-mail address: jmponcemartinez@hotmail.com

Regards,

Juan Manuel Ponce Martinez
DBA - Bridas S.A.P.I.C.
Buenos Aires - Argentina
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question