Solved

Session identifier

Posted on 1997-11-06
1
807 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

636 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