Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> what is a "module" in the context of DBMS_APPLICATION_INFO.SET_MODULE?
sun_certified
post Jul 20 2008, 03:13 AM
Post #1


Newbie
*

Group: Members
Posts: 4
Joined: 1-July 08
Member No.: 27,447



hi forum,

first off, thanks to HAL9000, LittleWheat and SteveC for helping me out on my last post. much appreciated.

my question today refers to these statements in the oracle documentation for DBMS_APPLICATION_INFO [emphasis mine]:

QUOTE
"Application developers can use the DBMS_APPLICATION_INFO package with Oracle Trace and the SQL trace facility to record names of executing _modules_ ... "

QUOTE
"..Your applications should set the name of the module and name of the action automatically each time a user enters that _module_ ..."

i assume that the use of the word "module" there is used in the general sql sense (referring to an object that contains sql statements, routines or procedures). or does the word "module" have a different meaning in oracle?

i'm a little unsure because of the following use of DBMS_APPLICATION_INFO.SET_MODULE in a procedure named "foo". "foo" is a small part of a large application whose overall purpose is to transfer information between various systems:

CODE
  CREATE or replace PROCEDURE foo (
  name VARCHAR2,
  salary NUMBER,
  manager NUMBER,
  title VARCHAR2,
  commission NUMBER,
  department NUMBER) AS

  session_id NUMBER := ...;

  BEGIN
     DBMS_APPLICATION_INFO.SET_MODULE(
       module_name => 'TRANSFER',
       action_name => 'session_id');  
       ...
  END;

i want to understand the pl/sql to as detailed a level as i can; because i'm writing some java code that calls "foo" and other "modules" in the application. but unfortunately, the original pl/sql coder is long gone. (btw - if its not already obvious - i'm not a pl/sql coder by profession. i'm a java man ;) ).

i think i know what's going on. but going by the examples in DBMS_APPLICATION_INFO, the intent of the original coder's use of DBMS_APPLICATION_INFO.SET_MODULE would have been clearer to me if his code did something like:

CODE
     ...
     DBMS_APPLICATION_INFO.SET_MODULE(
       module_name => 'foo',
       action_name => 'does something to foo data');  
      ...

so, my questions are:

1. what does "module" refer to in the context of DBMS_APPLICATION_INFO.SET_MODULE?

2. why do you think the original pl/sql coder did "module_name => 'TRANSFER'" & "action_name => 'session_id'" instead of "module_name => 'foo'" & "action_name => 'does something to foo data'"?

thanks in advance for your help.
Go to the top of the page
 
+Quote Post
SteveC
post Jul 20 2008, 04:13 AM
Post #2


Advanced Member
***

Group: Members
Posts: 2,835
Joined: 11-March 08
Member No.: 18,933



"The module name could be the name of a form in an Oracle Forms application, or the name of the code segment in an Oracle Precompilers application. The action name should usually be the name or description of the current transaction within a module."

Transferring a session ID looks like a valid operation - valid in the sense that you may have a need to know about a session ID in more than place. Using the above, the Forms built-in new_form would call a new form (module) and the user would then have two open forms, each of which can navigated to (not being modal).
Go to the top of the page
 
+Quote Post
sun_certified
post Jul 20 2008, 04:51 AM
Post #3


Newbie
*

Group: Members
Posts: 4
Joined: 1-July 08
Member No.: 27,447



QUOTE (SteveC @ Jul 20 2008, 10:14 AM) *
"The module name could be the name of a form in an Oracle Forms application, or the name of the code segment in an Oracle Precompilers application. The action name should usually be the name or description of the current transaction within a module."

Transferring a session ID looks like a valid operation - valid in the sense that you may have a need to know about a session ID in more than place. Using the above, the Forms built-in new_form would call a new form (module) and the user would then have two open forms, each of which can navigated to (not being modal).


thanks again, SteveC. i know nothing about oracle forms or precompilers applications. but, i gather from your answer that in the context of oracle, an oracle form is considered a "module" and also the code segment in an Oracle Precompilers application is considered a "module" because - i gather - they both fit the criteria i noted in my first post ("...an object that contains sql statements, routines or procedures"). is that what you're saying?

many thanks
Go to the top of the page
 
+Quote Post
HAL9000
post Jul 20 2008, 07:29 AM
Post #4


Advanced Member
***

Group: Members
Posts: 879
Joined: 25-September 07
Member No.: 12,336



The module name can be any "module" currently registered in V$SESSION.

The module name can be "SQL*Plus", or the name of an external executable.

http://www.dba-oracle.com/plsql/t_plsql_dbms_package.htm

CODE
SQL> SELECT module,
  2         action,
  3         client_info
  4  FROM   v$session
  5  WHERE  username = 'TEST';

MODULE             ACTION           CLIENT_INFO
------------------ ---------------- -------------------------
add_order          complete         Run via job

SELECT sid, serial#,
            client_identifier, service_name, action, module
       FROM V$SESSION

       SID SERIAL# CLIENT_IDENTIFIER    SERVICE_NAME  ACTION       MODULE
---------- ------- -------------------- ------------- ------------ -----------
       145      34 george:127.0.0.1     ACCT          INSERT MONTH PAYROLL
       146      32 johnny:127.0.0.2     ACCT          CANCEL CHECK BILLPAY
       147      54 suzy:127.0.0.3       HR                         MODVACATION
       156      64 lisa:127.0.0.4       HR            INSERT HIST  ADDEMPLOYEE
Go to the top of the page
 
+Quote Post
sun_certified
post Jul 20 2008, 07:45 AM
Post #5


Newbie
*

Group: Members
Posts: 4
Joined: 1-July 08
Member No.: 27,447



this book (Oracle PL/SQL by Example: Interactive Workbook) has the most unambiguous (the most straight-to-the-point) answer to my question #1:

1. what does "module" refer to in the context of DBMS_APPLICATION_INFO.SET_MODULE?

QUOTE
A PL/SQL module is any complete logical unit of work. There are four types of PL/SQL modules: (1) anonymous blocks that are run with a text script...(2) procedures, (3) functions, and (4) packages.

which is a paraphrase of, "..an object that contains sql statements, routines or procedures...".

thanks to all who replied.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 31st July 2014 - 06:26 AM