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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Missing entry in V$SESSION.PROGRAM

Re: Missing entry in V$SESSION.PROGRAM

From: Daniel Clamage <dclamageNOSPAM_at_telerama.com>
Date: 10 Sep 1998 18:03:18 -0400
Message-ID: <01bddcdb$4c4c76b0$6029c9cd@saturn>


Package dbms_application_info only supports reading/writing module, action and client_info columns of v$session, and module/action of v$sqlarea.

  procedure set_module(module_name varchar2, action_name varchar2); Sets both module and action name in one shot.   procedure set_action(action_name varchar2); Sets just action name.
  procedure set_client_info(client_info varchar2); Sets client info portion.

Then there are the corresponding read procedures.

I set module upon entry to a packaged main application. I set action upon entry to every procedure used by such an application. I encapsulated this, and using PL/SQL tables as a stack, track entry and exit (upon exit of a subroutine resetting action to the calling context's name, stored on my "stack"; and exiting an application, do the same for module).

I'm running Oracle 8.0.3 (logged onto NT Server as Administrator and connected to Oracle as sys) and this is what I get from v$session; select osuser, program, module, action, client_info from v$session
where osuser='Administrator';

OSUSER PROGRAM MODULE

--------------- -------------------- -------------
Administrator   C:\WINNT\Profiles\Ad SQL*Plus
                ministrator\Desktop\
                SQLPlus8.lnk

and nothing for action or client_info (as expected). Note that program and module are set for me. You can query this view to read program, or better yet encapsulate it with a stored procedure. --
- Dan Clamage
http://www.telerama.com/~dclamage
If you haven't crashed the Server,
you haven't been trying hard enough.

Michael Reiche Jakobsen <mrj_at_schilling.dk> wrote in article <01bddccc$2236d5a0$1d0a010a_at_pc65-w95>...
> Hello,
>
> A lot of people have asked how to get entries in the V$SESSION.PROGRAM
> column. And always the answer have been: Look at the
DBMS_APPLICATION_INFO
> package. But this only give access to the V$SESSION.CLIENT_INFO column.
> This might do it for some. But since oracle's own binaries, and
> Visual-Basic sessions via ODBC, can report the name of program, there
must
> be a way to get my C-programs (using OCI) to do the same thing. I have
been
> looking through my OCI-reference, and seen no calls to implement this.
>
> Is the answer to this question such a big secret, or has anyone found a
> way?
>
>
> Michael Reiche Jakobsen
>
>
Received on Thu Sep 10 1998 - 17:03:18 CDT

Original text of this message

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