Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Session ID

Session ID

From: Pepe Galindo <ppgg_at_lcc.uma.es>
Date: 1997/11/11
Message-ID: <Pine.GSO.3.96.971111160814.4720F-100000@sol10>#1/1

Hello people!

I have some questions. I hope somebody answer me. I will be grateful if he answerd me by e-mail too. Thanks.

  1. What number/s identify a Oracle session.
  2. How can a normal user (not dba) know that numbers? If it is impossible then: How can I construct a PL/SQL procedure to do that?

I think that to identify a session are necessary 2 numbers: SID and SERIAL# from table V$SESSION.

How can a user know that numbers?
V$SESSION is a dba table. Then I can construct a PL/SQL procedure with SYS as owner:

PROCEDURE SESSIONID (SID     OUT NUMBER,
                     SERIAL# OUT NUMBER) IS
  Usuario ALL_TABLES.OWNER%TYPE;
BEGIN
  SELECT USER INTO Usuario FROM DUAL;
  SELECT SID,SERIAL# INTO SID,SERIAL# FROM V$SESSION     WHERE USERNAME=Usuario AND STATUS='ACTIVE'; END SESSIONID; One problem arise when exist two 'ACTIVE' sessions with the same USERNAME. Then the oracle error is:
ORA-01422: exact fetch returns more than requested number of rows

How can I access to V$SESSION table to read this two values for a only one session??

The last question: Do somebody know a oracle news in spanish language?

Thank you very much.
ppgg_at_lcc.uma.es Received on Tue Nov 11 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US