PHP 手册
后退 |  | 前进

# PDO_OCI DSN

(no version information, might be only in CVS)

PDO_OCI DSN -- Connecting to Oracle databases

## 说明

The PDO_OCI Data Source Name (DSN) is composed of the following elements:

DSN prefix

  The DSN prefix is `oci:`. If you are connecting to a database defined in `tnsnames.ora`, append the name of the database to the DSN prefix and your DSN is complete.

`dbname` (Oracle Instant Client)

  The URI for the Oracle Instant Client connection takes the form of `dbname=//hostname:port-number/database`.

## 范例

例子 1. PDO_OCI DSN examples

The following examples show a PDO_OCI DSN for connecting to Oracle databases:

    oci:mydb
    oci:dbname=//localhost:1521/mydb

后退 | 起点 | 前进
Oracle Functions (PDO_OCI) | 上一级 | Oracle 函数（已废弃）