Connecting Instant Client or Instant Client Light to an Oracle Database
Use one of the following methods to specify the database connection information for the instant client application:
-
For OCI and OCCI programs, use the following connection string format:
host[:port][/service_name][:server][/instance_name]
-
Set the
TNS_ADMIN
environment variable to specify the location of thetnsnames.ora
file and specify a service name from that file. -
Set the
TNS_ADMIN
and theTWO_TASK
environment variables to specify a service name from thetnsnames.ora
file.Note:
You do not need to specify theORACLE_HOME
variable.
After checking the environment variable, you can use any of the following methods to specify Oracle Database connection information for client applications: