The CLEAR_CONTEXT procedure clears the application context in the specified namespace.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_SESSION.CLEAR_CONTEXT(
namespace VARCHAR2,
client_identifier VARCHAR2
attribute VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
| namespace | The namespace of the application context to be cleared. This is a required parameter.
|
| client_identifier | The client identifier. This is an optional parameter applicable to global contexts. For other types of contexts, it is optional. The maximum length of the identifier is 64 bytes. NULL is a valid value for client_identifier, which helps distinguish it from contexts set using SET_CONTEXT with the parameters (namespace, attribute, value, username, NULL). |
| attribute | The attribute in the specified namespace to be cleared. This is an optional parameter. The default value is NULL. If you specify attribute as NULL, the (namespace, attribute, value) of the namespace will be cleared from the session. If you do not specify attribute, all context information with the namespace and client_identifier parameters will be cleared. |
Considerations
The CLEAR_CONTEXT procedure must be called directly or indirectly by a trusted package.
Any changes to the context value made by the CLEAR_CONTEXT procedure take effect immediately. Subsequent calls to SYS_CONTEXT will return the updated value.
Examples
BEGIN
DBMS_SESSION.CLEAR_CONTEXT('emp_context');
END;
