Describes the procedures to enable and disable query offload for an elastic
pool leader or an elastic pool member. This package also provides
procedures to enable and manage ProxySQL for statement
routing.
Adds a new mapping entry on the target Autonomous Database
instance corresponding to the mapping entry for a schema object
on the router Autonomous Database instance.
Removes an existing mapping entry for a schema
object from the router Autonomous Database instance.
ACCEPT_MAPPING Procedure Run this procedure on a ProxySQL target instance to add a new mapping entry corresponding to the mapping entry for an object on in the routing table on the router Autonomous Database instance.
ADD_MAPPING Procedure Run this procedure on a router Autonomous Database instance to add a new mapping in the routing table.
DISABLE_READ_ONLY_OFFLOAD Procedure This procedure disables query offload for an Autonomous Database elastic pool leader or for an elastic pool member.
ENABLE_READ_ONLY_OFFLOAD Procedure This procedure enables query offload for an Autonomous Database elastic pool leader or for an elastic pool member.
ENABLE_ROUTING Procedure Run this procedure on an Autonomous Database instance to designate the instance as a router instance and to enable automatic statement routing.
REJECT_MAPPING Procedure Run on a target Autonomous Database instance to remove an existing mapping entry from the acceptance table.
REMOVE_MAPPING Procedure Run this procedure on the router Autonomous Database instance to remove an existing mapping entry for an object from the routing table.
Run this procedure on a ProxySQL target instance to add a new mapping entry
corresponding to the mapping entry for an object on in the routing table on the router Autonomous Database instance.
Syntax
DBMS_PROXY_SQL.ACCEPT_MAPPING (
object_owner IN VARCHAR2,
router_database_ocid IN VARCHAR2);
Parameters
Parameter
Description
object_owner
Specifies the object owner.
This parameter is mandatory.
router_database_ocid
Specifies the OCID of the router Autonomous Database instance.
The router_database_ocid value must be supplied in uppercase.
You must run this procedure on the target Autonomous Database instance.
To run this procedure you must be logged in as the ADMIN user or have the
EXECUTE privilege on DBMS_PROXY_SQL package.
Each mapping entry in the routing table on the router Autonomous Database instance must have a corresponding entry on the respective target Autonomous Database instance.
This
procedure enables query offload for an Autonomous Database elastic pool leader or for an elastic pool member.
Syntax
DBMS_PROXY_SQL.ENABLE_READ_ONLY_OFFLOAD(
module_name IN CLOB,
action_name IN CLOB);
Parameters
Parameter
Description
module_name
Specifies a list of module names as a comma-separated list. The
list specifies the modules where queries are considered for
offload (where a session's module name matches a value in the
list).
The default value for this parameter is NULL,
which means that a session's module name can be any value and
the session is considered for offloading.
action_name
Specifies a list of action names as a
comma-separated list. The list specifies the action names where
queries are considered for offloading (where a session's action
name matches a value in the list).
The default value for this parameter is NULL,
which means that a session's action name can be any value and
the session is considered for offloading
Usage Notes
If both module_name and action_name are
specified, a session's module name must match a value in the list of module
names and it's action name must match a value in the list of action names
for the session to be considered for offload.
When query offload is enabled for a session you can find the name of the
Refreshable Clone to which queries are offloaded. For example:
SELECT sys_context('userenv', 'con_name') from dual;
If queries are not being offloaded to a Refreshable Clone, this
query shows the name of the elastic pool leader (or the name of the elastic
pool member).
The views DBA_PROXY_SQL_ACTIONS and
DBA_PROXY_SQL_MODULES display the list of modules or
actions that are configured for query offload. You must query these views
from a session that is not enabled for query offload.
When you offload queries from a list of sessions that you
specify by module or action name, the module name and action name set with
DBMS_APPLICATION_INFO are case sensitive. DBMS_PROXY_SQL.ENABLE_READ_ONLY_OFFLOAD
adheres to this case sensitive behavior. For example, when a session has a
lowercase module name, or mixed case module name, the case must match in the
parameter values when you enable query offload with DBMS_PROXY_SQL.ENABLE_READ_ONLY_OFFLOAD and
you include the module_name or action_name
parameters.
You can check the module name and action name for the current
session using DBMS_APPLICATION_INFO.READ_MODULE: