Database Reference
In-Depth Information
This allows the tester to interrupt an in-flight fetch loop. Without these settings, you would
need to select from a large table to allow enough time to interrupt the SELECT statement.
Back to the demonstration with dbb.pl . I opted to point out some side-effects of session
reestablishment that are often overlooked and not explicitly documented. On page 13-15, the
Oracle Database Net Services Administrators Guide 10g Release 2 states this:
Server side program variables, such as PL/SQL package states, are lost during failures; TAF
cannot recover them. They can be initialized by making a call from the failover callback.
As the following demonstration illustrates, there is a whole lot more that TAF does not restore.
￿E fects of SET ROLE statements (or DBMS_SESSION.SET_ROLE ), such that a reestablished session
may have fewer privileges than the original session
￿
Effects of enabling secure application roles
￿E fects of ALTER SESSION statements, such as enabling SQL trace or adjusting NLS settings
The client identifier ( V$SESSION.CLIENT_IDENTIFIER )
￿
￿
The module and action for application instrumentation (see Chapter 24)
In fact, TAF cannot restore anything beyond the session itself and the previous cursor position
of SELECT statements—keep in mind that the latter is not guaranteed to work. 3 Doctor ORACLE
prescribes callback functions as a remedy for this situation. A callback function is a subroutine
that the client registers by calling an OCI function (or JDBC method if programming in Java).
OCI then assumes the task of executing the client's callback function when certain events occur.
TAF callbacks may be registered for the following events:
￿
Commencement of session failover
￿
Unsuccessful failover attempt; the client may indicate that OCI should continue retrying
￿
Completed successful session reestablishment
￿
Unsuccessful failover; no retry possible
The details are documented in Oracle Call Interface Programmer's Guide 10g Release 2 and
Oracle Database JDBC Developer's Guide and Reference 10g Release 2 . For programming languages
that do not provide an interface to OCI callback functions (this includes the Perl DBI module),
it is possible to detect session failover by checking for certain errors such as “ORA-25408: can
not safely replay call”.
Following is a demonstration of a successful session reestablishment and a restarted SELECT
statement. To point out that statements were run using dbb.pl and not SQL*Plus, the prompt
DBB> is used. The Perl program dbb.pl is started in much the same way as SQL*Plus by passing
a connect string.
$ dbb.pl app_user/secret@taftest.oradbpro.com
3.
SELECT failover may fail with the error “ORA-25401: can not continue fetches”.
 
Search WWH ::




Custom Search