Re: Select Current Session ID ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Wed, 13 Feb 2008 10:24:13 -0800 (PST)
Message-ID: <9548eb5e-55aa-402a-9d8a-279424e3ff2b@s13g2000prd.googlegroups.com>


On Feb 11, 8:27 pm, DA Morgan <damor..._at_psoug.org> wrote:
> fitzjarr..._at_cox.net wrote:
> > On Feb 11, 7:08 am, Cassiano <cassianorol..._at_gmail.com> wrote:
> >> Hi
>
> >> How I can select *my* current session id (from v$session?) in sqlplus?
>
> >> Thanks
>
> > Apart from using the v$mystat view (available in 9i and later
> > releases)
>
> > select sid
> > from v$session
> > where audsid = sys_context('USERENV', 'SESSIONID');
>
> > Presuming  you have access to the V$SESSION view.
>
> > David Fitzjarrell
>
> Bad presumption ... most DBAs won't give access to any dynamic
> performance view to a developer or end-user.
> --
> Daniel A. Morgan
> Oracle Ace Director & Instructor
> University of Washington
> damor..._at_x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -
>
> - Show quoted text -

I do not know about not allowing developers at v$ views. We want our developers to be able to see and track down application locking issues so we have set up a database role which has select on v$session, v $process, v$lock, v$sql, and a few others to support this. We also provides scripts to display the lock wait list and a couple of other tasks.

After all who wants a call at 2 AM to be asked if a production job is lock waited when a simple query ran by operations or the a developer would have answered the question?

However, I agree that you should not wholesale hand out v$ view select privileges.

We have also used vendor products that required access to specific v$ views and in one case Oracle base tables.

IMHO -- Mark D Powell -- Received on Wed Feb 13 2008 - 12:24:13 CST

Original text of this message