Oracle7 Server Tuning | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Your applications should set the name of the module and name of the action automatically each time a user enters that module. 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.
CREATE PROCEDURE add_employee(
name VARCHAR2(20),
salary NUMBER(7,2),
manager NUMBER,
title VARCHAR2(9),
commission NUMBER(7,2),
department NUMBER(2)) AS
BEGIN
DBMS_APPLICATION_INFO.SET_MODULE(
module_name => 'add_employee',
action_name => 'insert into emp');
INSERT INTO emp
(ename, empno, sal, mgr, job, hiredate, comm, deptno)
VALUES (name, next.emp_seq, manager, title, SYSDATE,
commission, department);
DBMS_APPLICATION_INFO.SET_MODULE('','');
END;
DBMS_APPLICATION_INFO.SET_MODULE(
module_name IN VARCHAR2,
action_name IN VARCHAR2)
CREATE OR REPLACE PROCEDURE bal_tran (amt IN NUMBER(7,2)) AS
BEGIN
-- balance transfer transaction
DBMS_APPLICATION_INFO.SET_ACTION(
action_name => 'transfer from chk to sav');
UPDATE chk SET bal = bal + :amt
WHERE acct# = :acct;
UPDATE sav SET bal = bal - :amt
WHERE acct# = :acct;
COMMIT;
DBMS_APPLICATION_INFO.SET_ACTION('');
END;
Set the transaction name to null after the transaction completes so that subsequent transactions are logged correctly. If you do not set the transaction name to null, subsequent transactions may be logged with the previous transaction's name.
DBMS_APPLICATION_INFO.SET_ACTION(action_name IN VARCHAR2)
DBMS_APPLICATION_INFO.SET_CLIENT_INFO(client_info IN VARCHAR2)
SELECT sql_text, disk_reads, module, action
FROM v$sqlarea
WHERE module = 'add_employee';
SQL_TEXT DISK_READS MODULE ACTION
------------------- ---------- ------------------ ----------------
INSERT INTO emp 1 add_employee insert into emp
(ename, empno, sal,
mgr, job, hiredate,
comm, deptno)
VALUES
(name,
next.emp_seq,
manager, title,
SYSDATE, commission,
department)
1 row selected.
DBMS_APPLICATION_INFO.READ_MODULE(
module_name OUT VARCHAR2,
action_name OUT VARCHAR2)
Parameter |
Description |
module_name
|
The last value that the module name was set to by calling SET_MODULE.
|
action_name
|
The last value that the action name was set to by calling SET_ACTION or SET_MODULE
|
DBMS_APPLICATION_INFO.READ_CLIENT_INFO(client_info OUT VARCHAR2)
Parameter |
Description |
client_info
|
The last client information value supplied to the SET_CLIENT_INFO procedure.
|
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |