PlsqlDatabaseConnectString

Specifies the connect information to an Oracle database.

Syntax: PlsqlDatabaseConnectString [string] [ServiceNameFormat/SIDFormat/TNSFormat/NetServiceNameFormat]

where [string] can be one of the following, based on the second argument

ServiceNameFormat: HOST:PORT:SERVICE_NAME format where
HOST is the hostname running the database
PORT is the port number the TNS listener is listening
SERVICE_NAME is the database service name
SIDFormat: HOST:PORT:SID format - where:
HOST is the hostname running the database
PORT is the port number the TNS listener is listening
SID is the database sid

TNSFormat: A valid TNS alias which resolves using Net utilities like tnsping and SQL*Plus. Make sure the PlsqlDatabaseConnectString parameter value has a corresponding entry in the $ORACLE_HOME/network/admin/tnsnames.ora file to avoid the Oracle error message ORA-12154: TNS:could not resolve the connect identifier specified.

NetServiceNameFormat: A valid net service name that resolves to a connect descriptor. A connect descriptor is a specially formatted description of the destination for a network connection. A connect descriptor contains destination service and network route information.

If the format argument is not specified, then mod_plsql assumes that 'string' is either in the HOST:PORT:SID format or resolvable by Net8. The differentiation between the two is made by the presence of colon in the specified string.

It is recommended that newer DAD's do not use the SIDFormat syntax. This exists only for backward compatibility reasons. Please use the new two argument format for newly created DADs.

Default:
[none]

Examples:

  • PlsqlDatabaseConnectString myhost.com:1521:myhost.iasdb.inst ServiceNameFormat
  • PlsqlDatabaseConnectString myhost.com:1521:iasdb SIDFormat
  • PlsqlDatabaseConnectString mytns_entry TNSFormat
  • PlsqlDatabaseConnectString cn=oracle,cn=iasdb NetServiceNameFormat
  • PlsqlDatabaseConnectString (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=myhost.com)(Port= 1521))(CONNECT_DATA=(SID=iasdb))) TNSFormat
  • PlsqlDatabaseConnectString myhost_tns
  • PlsqlDatabaseConnectString myhost.com:1521:iasdb

Tips for PlsqlDatabaseConnectString

If the database is running in the same Oracle Home, or the environment variable TWO_TASKis set (called LOCAL on Windows), this parameter need not be specified

If the database is running in a separate Oracle Home, then this parameter is mandatory

If you have problems connecting to the database

  • Check username and password information in the DAD
  • Make sure that you can run tnsping [string] and run something like sqlplus DADUsername/DADPassword@[string]
  • Make sure the environment variable TNS_ADMIN is configured properly
  • Check if the HOST:PORT:SERVICE_NAME format makes the connection go through
  • Make sure that the TNS listener and database are up and running
  • Make sure you can ping the HOST from this machine

From a mod_plsql perspective, TNSFormat and NetServiceNameFormat are synonymous and denote connect descriptors that are resolved by Net. The TNSFormat is provided as a convenience so that end-users use this to signify that the name resolution will happen through the local tnsnames.ora. For situations where the resolution is through an LDAP lookup as configured in sqlnet.ora, it is recommended that the format specifier of NetServiceNameFormat be used.

If your database supports High Availability (e.g. RAC database), it is highly recommended that you use the NetServiceNameFormat such that the resolution for the net service name is through LDAP. This will allow you to add or remove RAC nodes accessible via mod_plsql by just changing OID with the new/deleted node information. In such situations, hard-coding database listener host:port information in dads.conf or in the local tnsnames.ora is not a good idea.

In older versions, this configuration parameter was called connect_string