The SET_ACTION procedure is used to set the name of the current operation in the current module.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_APPLICATION_INFO.SET_ACTION (
action_name IN VARCHAR2);
Parameters
The action_name parameter specifies the name of the current operation in the current module. When the current operation terminates, this procedure is called to set the name of the next operation, or NULL if there is no next operation. If the name exceeds 32 bytes, it will be truncated.
Considerations
The operation name should be a text description of the current operation being executed. You should set the operation name before each transaction starts. After a transaction is completed, set the transaction name to NULL to ensure that subsequent transactions are recorded correctly. If the transaction name is not set to NULL, subsequent transactions may use the name from the previous transaction.
Examples
CREATE or replace PROCEDURE addemployee(
ename VARCHAR2,
esalary NUMBER,
emanager NUMBER,
etitle VARCHAR2,
ecommission NUMBER,
edepartment NUMBER) AS
BEGIN
DBMS_APPLICATION_INFO.SET_ACTION(
action_name => 'count the employee');
SELECT COUNT(*) FROM emp;
DBMS_APPLICATION_INFO.SET_ACTION(null);
END;
