Qore OracleExtensions Module Reference
1.0
|
The OracleExtensions module provides functionality for advanced Oracle DBMS operations or tools.
To use this module, use "%requires OracleExtensions"
in your code.
All the public symbols in the module are defined in the OracleExtensions namespace.
OracleExtensions scope is:
To provide functionality of DBMS_APPLICATION_INFO package (exec grant required) for Datasource
and DatasourcePool
objects.
Application developers or DBAs can use this functionality together with Oracle Trace and the SQL trace facility to record names of executing modules or transactions in the database for later use when tracking the performance of various modules and debugging.
Values provided to OracleApplicationInfo are used in V$SESSION
or V$SQLAREA
views for DBA tasks.
Application info is composed of three components in following hierarchy of logical depencency:
Client
, the client info of the sessionModule
, the name of the module that is currently runningAction
, the name of the current action within the current Module
Relevant Classes:
OracleDatasource and OracleDatasourcePool are directly inherited from Qore::Datasource and Qore::DatasourcePool and all overriden methods keep their original properties: transaction handling, return data, optional arguments...
There is an optional argument in all OracleExtensions::OracleDatasource and OracleExtensions::OracleDatasourcePool constructors: userAutoInfo
, type code
.
This user code allows to specify function (or closure) to define automatic Application Info for method calls where there is no explicit info used.
The code above has some important characteristics:
V$SESSION
will hold audit's values in appropriate columns while the statement runsselect
method are the same as in Qore::DatasourceNext example explains how to use Automatic Application Info
This functionality can be used to show the progress of long operations by inserting rows in the V$SESSION_LONGOPS
view. For it to work effectively, you must know the total amount of work you are planning to do and how much work you have done so far.
Relevant Classes:
it will result in this line in V$SESSION_LONGOPS:
... | OPNAME | TARGET | TARGET_DESC | SOFAR | TOTALWORK | UNITS | ... | MESSAGE | ... |
... | running potatoes counting | {null} | FOOBAR table | 10 | 10 | potatoes | ... | running potatoes counting: FOOBAR table : 10 out of 10 potatoes done | ... |
The DBMS_OUTPUT
package wrappers (exec grant required) enable you to send messages from stored procedures, packages, and triggers. The package is especially useful for displaying PL/SQL debugging information.
Relevant Classes:
will print out: