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 -> Re: Session ID

Re: Session ID

From: Peter Rak <prak_at_vsz.sk>
Date: 1997/11/12
Message-ID: <34697EEA.DECAEB52@vsz.sk>#1/1

Pepe Galindo wrote:

> 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.

v$session.audsid

> 2. How can a normal user (not dba) know that numbers?

select userenv('sessionid') from dual;

> 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 Wed Nov 12 1997 - 00:00:00 CST

Original text of this message

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