All Products
Search
Document Center

PolarDB:DBMS_APPLICATION_INFO

Last Updated:Mar 28, 2026

Records the module or transaction name being executed in the current database session, enabling administrators to track module performance and resource usage.

Subprograms

SubprogramDescription
READ_CLIENT_INFO procedureReads the value of the client_info field in the current session.
READ_MODULE procedureReads the module and action field values in the current session.
SET_ACTION procedureSets the name of the action being executed in the current module.
SET_CLIENT_INFO procedureSets the client_info field for the current session.
SET_MODULE procedureSets the name of the currently running module.

READ_CLIENT_INFO

Syntax

DBMS_APPLICATION_INFO.READ_CLIENT_INFO (
 client_info OUT VARCHAR2);

Parameters

ParameterDescription
client_infoReturns the client_info value last set by the SET_CLIENT_INFO stored procedure.

READ_MODULE

Syntax

DBMS_APPLICATION_INFO.READ_MODULE (
 module_name OUT VARCHAR2,
 action_name OUT VARCHAR2);

Parameters

ParameterDescription
module_nameReturns the module value last set by the SET_MODULE stored procedure.
action_nameReturns the action value last set by the SET_MODULE or SET_ACTION stored procedure.

SET_ACTION

Syntax

DBMS_APPLICATION_INFO.SET_ACTION (
 action_name IN VARCHAR2);

Parameters

ParameterDescription
action_nameThe name of the action being executed in the current module. When the current action ends, pass the next action name to call the stored procedure again, or pass NULL if there is no next action.
Note

Action names longer than 64 bytes are truncated.

SET_CLIENT_INFO

Syntax

DBMS_APPLICATION_INFO.SET_CLIENT_INFO (
 client_info IN VARCHAR2);

Parameters

ParameterDescription
client_infoThe client application information to record.

SET_MODULE

Syntax

DBMS_APPLICATION_INFO.SET_MODULE (
 module_name IN VARCHAR2,
 action_name IN VARCHAR2);

Parameters

ParameterDescription
module_nameThe name of the currently running module. When the current module ends, pass the next module name to call the stored procedure again, or pass NULL if there is no next module.
Note

Module names longer than 64 bytes are truncated.

action_nameThe name of the action being executed in the current module. Pass NULL to leave the action unspecified.
Note

Action names longer than 64 bytes are truncated.

Example

The following example sets client info, module, and action for a session, then reads the values back using polar_get_app_info and the READ procedures.

select pid,client_info,module,action from polar_get_app_info;

exec dbms_application_info.set_client_info('client2');
exec dbms_application_info.set_module('module2','action');
exec dbms_application_info.set_action('action2');

select pid,client_info,module,action from polar_get_app_info;

DECLARE
 _clinent TEXT;
 _mod_name TEXT;
 _act_name TEXT;
BEGIN
 dbms_application_info.read_client_info(_clinent);
 dbms_application_info.read_module(_mod_name,_act_name);
 raise notice 'client_info is : "%", module value is "%", action value is "%"', _clinent, _mod_name, _act_name;
END;