Database Reference
In-Depth Information
(CONNECT_DATA =
(SERsVICE_NAME = TEN.oradbpro.com)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = basic)
(RETRIES = 36)
(DELAY = 5)
)
)
)
The preceding Net service name definition instructs Oracle Net to do the following:
•
Enable session failover (or rather reconnection to a surviving instance). As long as
FAILOVER_MODE
is present, it is not necessary to explicitly request reconnection by
adding
(FAILOVER=ON)
to the
DESCRIPTION
section.
Attempt to automatically and transparently re-run
SELECT
statements that were in
progress at the time the database connection was disrupted.
Wait five seconds before each attempt to reconnect (
DELAY
).
Retry connection reestablishment at most 36 times, such that a connection must be
reestablished within three minutes. After expiration of the reconnection interval (
DELAY
times
RETRIES
), Oracle Net signals the error “ORA-03113: end-of-file on communication
channel” to the client, if the reason of the disconnection was a node or instance failure.
If the session was disconnected and the reconnection interval expires, the error
“ORA-00028: your session has been killed” is reported. If a session attempts to run SQL
statements after one of these errors, it incurs the error “ORA-03114: not connected to
ORACLE”. At this point, it might attempt to start a new database session without the
assistance of TAF.
In a RAC environment, one would usually add the directive
(LOAD_BALANCE=ON)
to the
DESCRIPTION
section. Even without this, sessions are distributed across available RAC instances.
Please refer to the
Oracle Database Net Services Reference
manual for further details on local
naming parameters (
tnsnames.ora
) related to TAF as well as load balancing.
ALTER SYSTEM DISCONNECT SESSION
TAF takes effect when node failure or instance failure occurs. The latter may be simulated with
SHUTDOWN ABORT
. It is undocumented that TAF may also take effect when database sessions are
disconnected explicitly. The syntax for this is as follows:
ALTER SYSTEM DISCONNECT SESSION '
sid
,
serial#
' [POST_TRANSACTION] [IMMEDIATE];
The parameters
sid
and
serial#
correspond to the columns by the same name in
V$SESSION
.
The keyword
POST_TRANSACTION
requests disconnection after the next
COMMIT
or
ROLLBACK
by the
client. The keyword
IMMEDIATE
requests immediate termination of the database session irrespec-
tive of open transactions. At least one of these two keywords must be present. In the absence of a
transaction,
POST_TRANSACTION
has the same effect as
IMMEDIATE
in terms of timing of the