php-doc-en/reference/oci8/fan.xml
Christopher Jones 5a3f0c18ac Add basic parameter entries to core DTrace probes.
Add bulk of OCI8 DTrace section.
    Add OCI8 2.0 oci_get_implicit_resultset and examples.
    Remove OCI8 back references to pre-5.0 aliases.
    Update OCI8 LIMIT-equivalent example with new Oracle 12c syntax.
    Move OCI8 FAN to separate section.
    Remove some OCI8 <emphasis> again, since it incorrectly bolds part of the product names.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331842 c90b9560-bf6c-de11-be94-00142212c4b1
2013-10-15 00:16:11 +00:00

121 lines
3.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 331735 $ -->
<chapter xml:id="oci8.fan" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>OCI8 Fast Application Notification (FAN) Support</title>
<section>
<para>
FAN support gives fast connection failover, an Oracle Database high availability
feature. This allows PHP OCI8 scripts to be notified when a
database machine or database instance becomes unavailable. Without
FAN, OCI8 can hang until a TCP timeout occurs and an error is
returned, which might be several minutes. Enabling FAN in OCI8 can
allow applications to detect errors and re-connect to an available
database instance without the web user being aware of an outage.
</para>
<para>
FAN support is available when the Oracle client libraries that PHP
links with and the Oracle Database are either version 10gR2 or later.
</para>
<para>
FAN benefits users of Oracle's clustering technology (RAC) because
connections to surviving database instances can be immediately
made. Users of Oracle's Data Guard with a broker will see the FAN
events generated when the standby database goes online. Standalone
databases will send FAN events when the database restarts.
</para>
<para>
For active connections, when a machine or database instance becomes
unavailable, a connection failure error will be returned by the
OCI8 extension function currently being called. On a subsequent
PHP script re-connect, a connection to a surviving database
instance will be established. The OCI8 extension also
transparently cleans up any idle connections affected by a database
machine or instance failure so PHP connect calls will establish a
fresh connection without the script being aware of any service
disruption.
</para>
<para>
When <link linkend="ini.oci8.events">oci8.events</link>
is <literal>On</literal>, it is suggested to
set <link linkend="ini.oci8.ping-interval">oci8.ping_interval</link>
to -1 to disable pinging, since enabling FAN events provide
pro-active connection management of idle connections made invalid
by a service disruption.
</para>
<para>
To enable FAN support in PHP OCI8, build PHP OCI8 with Oracle 10gR2 or later
libraries and then follow these steps:
</para>
<para>
<itemizedlist>
<listitem>
<simpara>
As a privileged database administrator, use a program like
SQL*Plus to enable the database service to post FAN events, for
example:
</simpara>
<para>
<informalexample>
<screen>
<![CDATA[
SQL> execute dbms_service.modify_service(
SERVICE_NAME => 'sales',
AQ_HA_NOTIFICATIONS => TRUE);
]]>
</screen>
</informalexample>
</para>
</listitem>
<listitem>
<simpara>
Edit php.ini and add
</simpara>
<para>
<informalexample>
<screen>
<![CDATA[
oci8.events = On
]]>
</screen>
</informalexample>
</para>
</listitem>
<listitem>
<simpara>
If the application does not already handle OCI8 error
conditions, modify it to detect failures and take appropriate
action. This may include re-connecting and re-executing
statements.
</simpara>
</listitem>
<listitem>
<simpara>
Run the application, connecting to Oracle Database 10gR2 or later.
</simpara>
</listitem>
</itemizedlist>
</para>
</section>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->