Oracle OCI Easy Connect String (EZCONNECT)

When connecting to Oracle using the OCI Driver, the quickest way to connect to an Oracle database is to use an EZCONNECT string. This method will work with all operating systems.

The Oracle ODBC package depends on the OCI drivers — so you need to set them up first. Follow the procedure in: Oracle OCI Driver Setup.

An EZCONNECT string can be used in the Translator by the db.connect{} API function to connect to your Oracle database. The EZCONNECT string will have the format:

username/password@[//]host[:port][/service_name][:server][/instance_name]

Note: Items in square brackets are [optional] — do not set the last two items [:server][/instance_name] unless your DBA advises you to use them.

Parameter

Description

Parameter

Description

host

This name of the Oracle database server

This must be a valid DNS name or IP address for the Oracle database server.

port (optional)

If the port is not included then it defaults to 1521.

service name

The service name (or database service name) is the “logical database name” that Oracle uses to access a database – it is equivalent to the database name in other database systems.

If you are using Oracle 11g or later you can omit the service name and the default will be used — however we strongly recommend including the server name for clarity.

username

Login user name for the Oracle server.

If the username and password are left blank then integrated security is used — this requires kerberos. You should speak to your DBA (database administrator) and/or your system/network administrator about if you have questions (about setting up permissions for) integrated users.

password

Password for the user

Example EZCONNECT: FredSmith/secret-password@Oracle-Server:3351/Test-DB

  • username: FredSmith

  • password: secret-password

  • host: Oracle-Server

  • port: 3351

  • service name: Test-DB