Table of Contents
This chapter briefly introduces the DBMS_APPLICATION_INFO package, and describes how to use the procedures of the package.
This section describes the procedures provided by the DBMS_DBMS_APPLICATION_INFO package, in alphabetical order.
Reads the client_info value of the current session.
Details about the READ_CLIENT_INFO procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.READ_CLIENT_INFO ( client_info OUT VARCHAR2 );
Parameter
Parameter | Description |
---|---|
client_info | The value of client info read from the session. |
Example
DECLARE client_info VARCHAR2(64); BEGIN DBMS_APPLICATION_INFO.READ_CLIENT_INFO(client_info); DBMS_OUTPUT.PUT_LINE(client_info); END; /
Reads information about modules and actions of the current session.
Details about the READ_MODULE procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.READ_MODULE ( module_name OUT VARCHAR2, action_name OUT VARCHAR2 )
Parameter
Parameter | Description |
---|---|
module_name | The value of the module of the current session. |
action_name | The value of the action of the current session. |
Example
DECLARE module_name VARCHAR(64); action_name VARCHAR(64); BEGIN DBMS_APPLICATION_INFO.READ_MODULE(module_name, action_name); DBMS_OUTPUT.PUT_LINE(module_name); DBMS_OUTPUT.PUT_LINE(action_name); END; /
Specifies the action name of the current session.
Details about the SET_ACTION procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.SET_ACTION ( action_name IN VARCHAR2 )
Parameter
Parameter | Description |
---|---|
action_name | The action name to be stored in the session. Names longer than 64 bytes are truncated. |
Example
CREATE TABLE NEW_DATA_TBL(DATA NUMBER) / BEGIN DBMS_APPLICATION_INFO.SET_ACTION('데이터 추가'); INSERT INTO NEW_DATA_TBL VALUES(1); INSERT INTO NEW_DATA_TBL VALUES(2); COMMIT; DBMS_APPLICATION_INFO.SET_ACTION(NULL); END; /
Specifies client information for the current session.
Details about the SET_CLIENT_INFO procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.SET_CLIENT_INFO ( client_info IN VARCHAR2 );
Parameter
Parameter | Description |
---|---|
client_info | The value of client_info to be stored in the current session. Information longer than 64 bytes is truncated. |
Example
BEGIN DBMS_APPLICATION_INFO.SET_CLIENT_INFO('my_client_info'); END; / SELECT sid, client_info FROM V$SESSION WHERE client_info = 'my_client_info';
Specifies the module name for the current session.
Details about the SET_MODULE procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.SET_MODULE ( module_name IN VARCHAR2, action_name IN VARCHAR2 );
Parameter
Parameter | Description |
---|---|
module_name | The module name to be stored in the session. Names longer than 64 bytes are truncated. |
action_name | The action name to be stored in the session. Names longer than 64 bytes are truncated. |
Example
CREATE TABLE NEW_DATA_TBL(DATA NUMBER) / BEGIN DBMS_APPLICATION_INFO.SET_MODULE('Adding data', 'Inserting new data'); INSERT INTO NEW_DATA_TBL VALUES(1); INSERT INTO NEW_DATA_TBL VALUES(2); COMMIT; DBMS_APPLICATION_INFO.SET_MODULE(NULL, NULL); END; /
Modifies a value in the SYS._VT_SESSION_LONGOPS view.
Details about the SET_SESSION_LONGOPS procedure are as follows:
Prototype
DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS ( id IN OUT PLS_INTEGER, op_name IN VARCHAR DEFAULT NULL, sofar IN NUMBER DEFAULT 0, totalwork IN NUMBER DEFAULT 0, target_desc IN VARCHAR2 DEFAULT 'unknown target', units IN VARCHAR2 DEFAULT NULL );
Parameter
Parameter | Description |
---|---|
id | The ID of longops to be used. If -1 is specified, a new ID is allocated. |
op_name | The opname column value to be stored in SYS._VT_SESSION_LONGOPS. Information that exceeds 128 bytes is ignored. |
sofar | The sofar column value to be stored in SYS._VT_SESSION_LONGOPS. |
totalwork | The totalwork column value to be stored in SYS._VT_SESSION_LONGOPS. |
target_desc | The target_desc column value to be stored in SYS._VT_SESSION_LONGOPS. Information that exceeds 128 bytes is ignored. |
units | The units column value to be stored in SYS._VT_SESSION_LONGOPS. Information that exceeds 128 bytes is ignored. |
Example
DECLARE idx PLS_INTERGER := -1; BEGIN DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS(idx); END; / SELECT * FROM SYS._VT_SESSION_LONGOPS;