php-doc-en/reference/oci8/functions/oci-pconnect.xml
Antony Dovgal dd1d80818c make use of the new entities
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@195295 c90b9560-bf6c-de11-be94-00142212c4b1
2005-09-06 20:41:30 +00:00

108 lines
4.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<refentry id="function.oci-pconnect">
<refnamediv>
<refname>oci_pconnect</refname>
<refpurpose>Connect to an Oracle database using a persistent connection</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>oci_pconnect</methodname>
<methodparam><type>string</type><parameter>username</parameter></methodparam>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>db</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>session_mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>oci_pconnect</function> creates a persistent connection
to an Oracle server and logs on. Persistent connections are cached
and re-used between requests, resulting in reduced overhead on each
page load; a typical PHP application will have a single persistent
connection open against an Oracle server per Apache child process
(or PHP FastCGI/CGI process). See the <link
linkend="features.persistent-connections">Persistent Database
Connections</link> section for more information.
</para>
<note>
<simpara>
Starting with version 1.1 of the oci8 extension, the lifetime and
maximum amount of persistent Oracle connections can be tuned by setting
the following configuration values: <link
linkend="ini.oci8.persistent_timeout">oci8.persistent_timeout</link>,
<link linkend="ini.oci8.ping_interval">oci8.ping_interval</link> and
<link linkend="ini.oci8.max_persistent">oci8.max_persistent</link>.
</simpara>
</note>
<para>
The optional third parameter can either contain
the name of the local Oracle instance or the name of the entry in
<filename>tnsnames.ora</filename>. If the third parameter is not specified,
PHP uses environment variables <literal>ORACLE_SID</literal> and
<literal>TWO_TASK</literal> to determine the name of local Oracle
instance and location of <filename>tnsnames.ora</filename> accordingly.
</para>
<para>
Parameter <parameter>session_mode</parameter> is available since version
1.1 and accepts the following values: <constant>OCI_DEFAULT</constant>,
<constant>OCI_SYSOPER</constant> and <constant>OCI_SYSDBA</constant>.
If either <constant>OCI_SYSOPER</constant> or
<constant>OCI_SYSDBA</constant> were specified,
<function>oci_connect</function> will try to establish privileged
connection using external credentials. Privileged connections are
disabled by default. To enable them you need to set <link
linkend="ini.oci8.privileged_connect">oci8.privileged_connect</link>
to On.
</para>
<note>
<simpara>
If you're using PHP with Oracle Instant Client, you can use easy connect
naming method described here:
<ulink url="&url.oracle.oic.connect;">&url.oracle.oic.connect;</ulink>.
Basically this means you can specify "//db_host[:port]/database_name"
as database name. But if you want to use the old way of naming you
<emphasis>must</emphasis> set either <constant>ORACLE_HOME</constant> or
<constant>TNS_ADMIN</constant>.
</simpara>
</note>
&oci.charset;
<para>
<function>oci_pconnect</function> returns connection identifier or
&false; on error.
</para>
<note>
<para>
In PHP versions before 5.0.0 you must use <function>ociplogon</function> instead.
This name still can be used, it was left as alias of
<function>oci_pconnect</function> for downwards compatability.
This, however, is deprecated and not recommended.
</para>
</note>
<para>
See also <function>oci_connect</function> and
<function>oci_new_connect</function>.
</para>
</refsect1>
</refentry>
<!-- 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:"../../../../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
-->