mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Update overview and merge php.ini option notes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290566 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9bd249fceb
commit
d739883917
2 changed files with 243 additions and 104 deletions
|
@ -11,11 +11,13 @@
|
|||
<preface xml:id="intro.oci8">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
These functions allow you to access Oracle 11G, Oracle 10, Oracle 9,
|
||||
Oracle 8 and Oracle 7 databases using the Oracle Call Interface (OCI).
|
||||
They support binding of PHP variables to Oracle placeholders, have full
|
||||
LOB, FILE and ROWID support, and allow you to use user-supplied
|
||||
defined variables.
|
||||
These functions allow you to access Oracle Database 11g, 10g, 9i
|
||||
and 8i. They support SQL and PL/SQL statements. Basic features
|
||||
include transaction control, binding of PHP variables to Oracle
|
||||
placeholders, and support for large object (LOB) types and
|
||||
collections. Oracle's scalability features such as Database
|
||||
Resident Connection Pooling (DRCP) and result caching are also
|
||||
supported.
|
||||
</para>
|
||||
</preface>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -17,46 +17,58 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>oci8.privileged_connect</entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>oci8.connection_class</entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>Available since PHP 5.3 (PECL OCI8 1.3).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.default_prefetch</entry>
|
||||
<entry>"100"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.events</entry>
|
||||
<entry>Off</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.3 (PECL OCI8 1.3).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.max_persistent</entry>
|
||||
<entry>"-1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.old_oci_close_semantics</entry>
|
||||
<entry>Off</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.persistent_timeout</entry>
|
||||
<entry>"-1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.ping_interval</entry>
|
||||
<entry>"60"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.privileged_connect</entry>
|
||||
<entry>Off</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.statement_cache_size</entry>
|
||||
<entry>"20"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.default_prefetch</entry>
|
||||
<entry>"10"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>oci8.old_oci_close_semantics</entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.1.2.</entry>
|
||||
<entry>Available since PHP 5.1.2 (PECL OCI8 1.1).</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
@ -67,15 +79,108 @@
|
|||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="ini.oci8.privileged-connect">
|
||||
<varlistentry xml:id="ini.oci8.connection.class">
|
||||
<term>
|
||||
<parameter>oci8.privileged_connect</parameter>
|
||||
<parameter>oci8.connection_class</parameter>
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This user defined text is used by Oracle 11g Database
|
||||
Resident Connection Pooling (DRCP) connections to
|
||||
sub-partition the connection pool. It allows OCI8 persistent
|
||||
connections from an application to reuse database sessions
|
||||
from a previous PHP script, giving better scalability. When
|
||||
an application uses a database pooled process previously used
|
||||
with a different connection class, the session settings such
|
||||
as the default Oracle date format are reset. This prevents
|
||||
accidental sharing of information between different
|
||||
applications.
|
||||
</para>
|
||||
<para>
|
||||
The value can be set at runtime
|
||||
with <function>ini_set</function> prior to connecting.
|
||||
</para>
|
||||
<para>
|
||||
To use DRCP, OCI8 must be linked with Oracle 11g libraries
|
||||
and the database must be Oracle 11g. The connection pool
|
||||
must be enabled in the database,
|
||||
the <literal>oci8.connection_class</literal> should be set to
|
||||
the same string for all web servers running the same
|
||||
application, and the OCI8 connection string must specify to
|
||||
use a pooled server.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.default-prefetch">
|
||||
<term>
|
||||
<parameter>oci8.default_prefetch</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option sets the default number of extra rows that will
|
||||
be fetched and cached automatically whenever a low-level
|
||||
request for data from the database is made. Setting a value
|
||||
of <literal>0</literal> turns off prefetching.
|
||||
</para>
|
||||
<para>
|
||||
The prefetch value does not alter the number of rows that
|
||||
functions like <function>oci_fetch_array</function> return to
|
||||
the user; the prefetching and caching of rows is handled
|
||||
internally in OCI8.
|
||||
</para>
|
||||
<para>
|
||||
The value can be set per-statement
|
||||
with <function>oci_set_prefetch</function> prior to statement
|
||||
execution.
|
||||
</para>
|
||||
<para>
|
||||
In PHP 5.3 (PECL OCI8 1.3.4) the default value was increased
|
||||
from <literal>10</literal> to <literal>100</literal>.
|
||||
</para>
|
||||
<para>
|
||||
In PHP 5.3.2 (PECL OCI8 1.4) the minimum value settable was
|
||||
reduced from <literal>1</literal> to <literal>0</literal>,
|
||||
allowing prefetching to be turned off.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
A larger prefetch can result in improved performance, at the
|
||||
cost of some increased memory usage. For queries that return
|
||||
large amounts of data, the performance benefit can be
|
||||
significant.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.events">
|
||||
<term>
|
||||
<parameter>oci8.events</parameter>
|
||||
<type>boolean</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option enables privileged connections using external credentials
|
||||
(<constant>OCI_SYSOPER</constant>, <constant>OCI_SYSDBA</constant>).
|
||||
Using <literal>On</literal> allows PHP to be notified of
|
||||
database Fast Application Notification (FAN) events.
|
||||
</para>
|
||||
<para>
|
||||
Without FAN, when a database instance or machine node fails
|
||||
unexpectedly, PHP applications may be blocked waiting for a
|
||||
database response until a TCP timeout expires. With FAN
|
||||
events, PHP applications are quickly notified of failures
|
||||
that affect their established database connections. The OCI8
|
||||
extension will clean up unusable connections in the
|
||||
persistent connection cache.
|
||||
</para>
|
||||
<para>
|
||||
When using <literal>On</literal>, the database must also be
|
||||
configured to post FAN events.
|
||||
</para>
|
||||
<para>
|
||||
FAN support is available when OCI8 is linked with Oracle
|
||||
10gR2 (or later) libraries and connected to Oracle Database
|
||||
10gR2 (or later).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -86,84 +191,12 @@
|
|||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The maximum number of persistent OCI8 connections per process.
|
||||
Setting this option to -1 means that there is no limit.
|
||||
The maximum number of persistent OCI8 connections per PHP
|
||||
process. Setting this option to -1 means that there is no
|
||||
limit.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.persistent-timeout">
|
||||
<term>
|
||||
<parameter>oci8.persistent_timeout</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The maximum length of time (in seconds) that a given process is
|
||||
allowed to maintain an idle persistent connection.
|
||||
Setting this option to -1 means that idle persistent connections will
|
||||
be maintained forever.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.ping-interval">
|
||||
<term>
|
||||
<parameter>oci8.ping_interval</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The length of time (in seconds) that must pass before issuing a ping
|
||||
during <function>oci_pconnect</function>. When set to 0, persistent
|
||||
connections will be pinged every time they are reused. To disable
|
||||
pings completely, set this option to -1.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Disabling pings will cause <function>oci_pconnect</function> calls to operate at the
|
||||
highest efficiency, but may cause PHP to not detect faulty connections,
|
||||
such as those caused by network partitions, or if the Oracle server has
|
||||
gone down since PHP connected, until later in the script. Consult the
|
||||
<function>oci_pconnect</function> documentation for more information.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.statement-cache-size">
|
||||
<term>
|
||||
<parameter>oci8.statement_cache_size</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option enables statement caching, and specifies how many
|
||||
statements to cache. To disable statement caching just set this option to 0.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
A larger cache can result in improved performance, at the cost of
|
||||
increased memory usage.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.default-prefetch">
|
||||
<term>
|
||||
<parameter>oci8.default_prefetch</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option enables statement prefetching and sets the default number
|
||||
of rows that will be fetched automatically after statement execution.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
A larger prefetch can result in improved performance, at the cost of
|
||||
increased memory usage.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.old-oci-close-semantics">
|
||||
<term>
|
||||
<parameter>oci8.old_oci_close_semantics</parameter>
|
||||
|
@ -177,11 +210,115 @@
|
|||
closed until the end of the script. This is for backward
|
||||
compatibility only. If you find that you need to enable this
|
||||
setting, you are <emphasis>strongly encouraged</emphasis> to
|
||||
remove the <function>oci_close</function> calls from your
|
||||
adjust the <function>oci_close</function> calls in your
|
||||
application instead of enabling this option.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.persistent-timeout">
|
||||
<term>
|
||||
<parameter>oci8.persistent_timeout</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The maximum number of seconds that a PHP process is allowed
|
||||
to keep an idle persistent connection open. Setting this
|
||||
option to -1 means that idle persistent connections will be
|
||||
retained until the PHP process terminates or the connection
|
||||
is explicitly closed with <function>oci_close</function>.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
In PHP, the expiry of idle resources is not alarm-based. It
|
||||
occurs when PHP finishes processing a script and checks the
|
||||
last-used timestamp of resources. Hence there is a paradox
|
||||
that idle connections can only be closed when there is some
|
||||
activity (though not necessarily OCI8 related) in the PHP
|
||||
process. The introduction of Database Resident Connection
|
||||
Pooling (DRCP) in Oracle 11g resolves the memory and
|
||||
resource issues that <literal>oci8.max_persistent</literal>
|
||||
and <literal>oci8.persistent_timeout</literal> previously
|
||||
attempted to overcome.
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<simpara>
|
||||
In PHP 5.3 (PECL OCI8 1.3), persistent connections can be
|
||||
closed with <function>oci_close</function>.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.ping-interval">
|
||||
<term>
|
||||
<parameter>oci8.ping_interval</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The number of seconds that must pass before issuing a ping
|
||||
during <function>oci_pconnect</function>. A ping ensures
|
||||
that the database connection is valid. When set to 0,
|
||||
persistent connections will be pinged every
|
||||
time <function>oci_pconnect</function> is called. To disable
|
||||
pings completely, set this option to -1.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Disabling pings allows <function>oci_pconnect</function> to
|
||||
operate at the highest efficiency, but PHP may not be able
|
||||
to detect unusable connections, such as caused by network
|
||||
dropout, or if the Oracle database has gone down since PHP
|
||||
connected, until the connection is used later in the
|
||||
script. Consult the
|
||||
<function>oci_pconnect</function> documentation for more information.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.privileged-connect">
|
||||
<term>
|
||||
<parameter>oci8.privileged_connect</parameter>
|
||||
<type>boolean</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option enables privileged connections using external credentials
|
||||
<constant>OCI_SYSOPER</constant> or <constant>OCI_SYSDBA</constant>.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Seting this <literal>On</literal> can allow scripts on web
|
||||
servers running with the appropriate OS user privileges to
|
||||
connect as privileged database users without requiring a
|
||||
database password. This can be a security risk.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.oci8.statement-cache-size">
|
||||
<term>
|
||||
<parameter>oci8.statement_cache_size</parameter>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option enables statement caching, and specifies how many
|
||||
statements to cache. To disable statement caching just set
|
||||
this option to 0.
|
||||
</para>
|
||||
<para>
|
||||
Set this value to the size of the working set of statements
|
||||
used by your application. Setting too small a value can cause
|
||||
statements to be flushed from the cache before they are
|
||||
reused.
|
||||
</para>
|
||||
<para>
|
||||
This option is of most use with persistent connections.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue