Finding SID of current session

2003-12-02 Thread George Leonard
Hi there all.

How can I find the sid of the current session,

I got a pl/sql procedure that needs to do a select from v$session_event
but only want to do it for it's own session so I need to know this for
the where clause ?

George 
 
__
George Leonard
Oracle Database Administrator
Professional Services (Oracle Business Unit)
Dimension Data (Pty) Ltd
(Reg. No. 1987/006597/07)
Cell: (+27) 82 655 2466
Tel: (+27 11) 575 0573
Fax: (+27 11) 576 0573
E-mail:[EMAIL PROTECTED]
Web:   http://www.didata.co.za

 
You Have The Obligation to Inform One Honestly of the risk, 
And As a Person You Are Committed to Educate Yourself to the Total Risk
In Any Activity! 
Once Informed  Totally Aware of the Risk, 
Every Fool Has the Right to Kill or Injure Themselves as They See Fit!

“This e-mail is sent on the Terms and Conditions that can be accessed by Clicking on 
this link http://www.vodacom.net/legal/email.asp 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: George Leonard
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: Finding SID of current session

2003-12-02 Thread Suhen Pather (S)


select sid from v$mystat
where rownum2
/

Kind Regards
Suhen Pather
IT Software Specialist
Land  +27 12 680 3282
Cell   +27 82 562 3124
email  [EMAIL PROTECTED]


-Original Message-
Sent: Tuesday, December 02, 2003 9:44 AM
To: Multiple recipients of list ORACLE-L


Hi there all.

How can I find the sid of the current session,

I got a pl/sql procedure that needs to do a select from
v$session_event but only want to do it for it's own session so I need
to know this for the where clause ?

George 
 
__
George Leonard
Oracle Database Administrator
Professional Services (Oracle Business Unit)
Dimension Data (Pty) Ltd
(Reg. No. 1987/006597/07)
Cell: (+27) 82 655 2466
Tel: (+27 11) 575 0573
Fax: (+27 11) 576 0573
E-mail:[EMAIL PROTECTED]
Web:   http://www.didata.co.za

 
You Have The Obligation to Inform One Honestly of the risk, 
And As a Person You Are Committed to Educate Yourself to the Total
Risk In Any Activity! 
Once Informed  Totally Aware of the Risk, 
Every Fool Has the Right to Kill or Injure Themselves as They See Fit!

This e-mail is sent on the Terms and Conditions that can be accessed
by Clicking on this link http://www.vodacom.net/legal/email.asp 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: George Leonard
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L (or the
name of mailing list you want to be removed from).  You may also send
the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Suhen Pather (S)
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: Finding SID of current session

2003-12-02 Thread Prem Khanna J
George,

u can get it from v$mystat.

REgards,
Jp.

02-12-2003 16:44:25, George Leonard [EMAIL PROTECTED] wrote:

Hi there all.

How can I find the sid of the current session,

I got a pl/sql procedure that needs to do a select from v$session_event
but only want to do it for it's own session so I need to know this for
the where clause ?



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Prem Khanna J
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: Finding SID of current session

2003-12-02 Thread George Leonard
 V$mystat, to what would you join this to understand the
values/statistics, v$session_event?

George 
 
__
George Leonard
Oracle Database Administrator
Professional Services (Oracle Business Unit)
Dimension Data (Pty) Ltd
(Reg. No. 1987/006597/07)
Cell: (+27) 82 655 2466
Tel: (+27 11) 575 0573
Fax: (+27 11) 576 0573
E-mail:[EMAIL PROTECTED]
Web:   http://www.didata.co.za

 
You Have The Obligation to Inform One Honestly of the risk, 
And As a Person You Are Committed to Educate Yourself to the Total Risk
In Any Activity! 
Once Informed  Totally Aware of the Risk, 
Every Fool Has the Right to Kill or Injure Themselves as They See Fit!

-Original Message-
Prem Khanna J
Sent: 02 December 2003 09:59 AM
To: Multiple recipients of list ORACLE-L

George,

u can get it from v$mystat.

REgards,
Jp.

02-12-2003 16:44:25, George Leonard [EMAIL PROTECTED] wrote:

Hi there all.

How can I find the sid of the current session,

I got a pl/sql procedure that needs to do a select from v$session_event
but only want to do it for it's own session so I need to know this for
the where clause ?



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Prem Khanna J
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
“This e-mail is sent on the Terms and Conditions that can be accessed by Clicking on 
this link http://www.vodacom.net/legal/email.asp 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: George Leonard
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: Finding SID of current session

2003-12-02 Thread Joze Senegacnik
Title: RE: Finding SID of current session





You can use also this approach:


select * from v$session_event
where sid = (select sid from v$session where audsid = userenv('SESSIONID'))


Regards, Joze


-Original Message-
From: George Leonard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 02, 2003 8:44 AM
To: Multiple recipients of list ORACLE-L
Subject: Finding SID of current session



Hi there all.


How can I find the sid of the current session,


I got a pl/sql procedure that needs to do a select from v$session_event
but only want to do it for it's own session so I need to know this for
the where clause ?


George 

__
George Leonard
Oracle Database Administrator
Professional Services (Oracle Business Unit)
Dimension Data (Pty) Ltd
(Reg. No. 1987/006597/07)
Cell: (+27) 82 655 2466
Tel: (+27 11) 575 0573
Fax: (+27 11) 576 0573
E-mail:[EMAIL PROTECTED]
Web: http://www.didata.co.za



You Have The Obligation to Inform One Honestly of the risk, 
And As a Person You Are Committed to Educate Yourself to the Total Risk
In Any Activity! 
Once Informed  Totally Aware of the Risk, 
Every Fool Has the Right to Kill or Injure Themselves as They See Fit!


This e-mail is sent on the Terms and Conditions that can be accessed by Clicking on this link http://www.vodacom.net/legal/email.asp 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: George Leonard
 INET: [EMAIL PROTECTED]


Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).





Re: Finding SID of current session

2003-12-02 Thread AdamDonahue
I believe

select sid from v$session where audsid = USERENV( 'SESSIONID' );

is a universal way to determine one's current internal SID based on the 
sessionid returned by userenv.

Adam




George Leonard [EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
12/01/2003 11:44 PM
Please respond to
[EMAIL PROTECTED]


To
Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc

Subject
Finding SID of current session






Hi there all.

How can I find the sid of the current session,

I got a pl/sql procedure that needs to do a select from v$session_event
but only want to do it for it's own session so I need to know this for
the where clause ?

George 
 
__
George Leonard
Oracle Database Administrator
Professional Services (Oracle Business Unit)
Dimension Data (Pty) Ltd
(Reg. No. 1987/006597/07)
Cell: (+27) 82 655 2466
Tel: (+27 11) 575 0573
Fax: (+27 11) 576 0573
E-mail:[EMAIL PROTECTED]
Web:   http://www.didata.co.za

 
You Have The Obligation to Inform One Honestly of the risk, 
And As a Person You Are Committed to Educate Yourself to the Total Risk
In Any Activity! 
Once Informed  Totally Aware of the Risk, 
Every Fool Has the Right to Kill or Injure Themselves as They See Fit!

This e-mail is sent on the Terms and Conditions that can be accessed by 
Clicking on this link http://www.vodacom.net/legal/email.asp 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: George Leonard
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: Finding SID of current session

2003-12-02 Thread Jonathan Lewis

Universal, and works with 7.3.4 - which is still in common
use - but is deprecated in favour of:

select sid from v$session where audsid = 
sys_context('USERENV', 'SESSIONID' );

which still doesn't help if you have several SYS sessions
running, as the sessionID for SYS is always zero.

The v$mystat option is the newer 'universal' except there
is a preferred call to dbms_support.mysid (on the platforms
which have, and have installed, dbms_support (dbmssupp.sql) -
and the package only does a 
select sid from v$mystat where rownum = 1;
anyway.



Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person 
  who can answer the questions, but the 
  person who can question the answers -- T. Schick Jr


One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html


Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
UK___November


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


- Original Message - 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 8:09 PM


I believe

select sid from v$session where audsid = USERENV( 'SESSIONID' );

is a universal way to determine one's current internal SID based on the 
sessionid returned by userenv.

Adam


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jonathan Lewis
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).