Solved

Session identifier

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL 6 59
Select and Insert Query running slow 4 36
oracle- set role and grant privileges 6 29
error in my cursor 5 33
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…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

809 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