Connecting to Oracle

Many DX users have trouble connecting to their Oracle databases.   This is because Oracle gives the user a wide variety of connection techniques, and DX cannot determine on its own which method works at a particular site.  Here are some tips for making the DX to Oracle connection work.
 
  1. The environment variable ORACLE_HOME must be set before starting DX or any DBPak application.   If you do not know the value for this variable, ask your Oracle DBA.
  2. You may have to set the environment variable ORACLE_SID if you are connecting to your default database rather than a named database.
  3. You will have to know the Oracle server name to tell DX
  4. You will have to know a valid user name to tell DX.
  5. You may need a valid password.

Determining the Server Name

Oracle provides a wide variety of ways to connect applications to databases.  The DX server name should be set to the connection string you would use to connect to your database.  The quickest way to determine what to tell DX is to examine how you run the Oracle SQLPLUS utility.  If you begin SQLPLUS by typing then you should use the server name DBNAME.   The DBNAME can be any valid Oracle connection string.  For most users, this is simply an Oracle Names name for the database.  For some it is a SQLNET V.1 connection string (T:hostname:sid).  If you don't know the Oracle Names name for the database there are several places you can look for a definition file which will list all the valid names.  The location varies depending on the OS and how the site is set up, but it is most likely to be in If you start sqlplus without the @DBNAME construct, like this then you should use the server name 'default' and you must set the ORACLE_SID environment variable to the SID of your database.   If you don't know the SID you can guess it by looking at the names of the Oracle processes. You should usually find at least 4 processes, which look like The last part of the name (ONY2 in this case) is the SID.  Note: The default connection method only works if the application and the database are running on the same machine.
 

Determining your User Name

Many Oracle sites use Oracle login names when connecting to the database.  DX users are encouraged to install the sample database, which creates a user dbpak with the password dbpakdemo.  If you have done this, then your DBA can tell you a valid login name and password.   Often, the default system password is left unchanged (SYSTEM/MANAGER).

Some sites use the operating system login information as your Oracle login name.   This is refered to as the OPS$ method.  If you want to connect this way, set your DX/DBPak user name to 'OPS$'.  In this case you do not have to give a password because the assumption is that your operating system login provided all the credential checks for you.
 

SQL-NET V1

Older Oracle installations may still only be using SQL-NET V.1.  In this case, XmNserverName must be set to the full connection string, either P:sid or T:host:sid.  P:sid indicates a local machine connection directly to the Oracle
server identified by sid over a pipe.  T:host:sid indicates a TCP connection to a (possibly) remote server.  If you are having problems making a connection in this way, there are two things to check.
 

SQL-NET V2

Most sites are now using SQL-NET V2.  This allows you to connect to a database by just providing a name.  The host and port number to use to connect are found in the tnsnames.ora file mentioned above.  On the remote host, the listener.ora file sets up the service to receive connection requests. Here are some examples:
 

Sample listener.ora file for Oracle host.
Sample tnsnames.ora
 

How to spot which kind of SQL-NET you use

Before running DX, you should test your connections with sqlplus. In these examples, the Oracle database SID is CUSTOMER, it is running on the host dbhost, the login is worker, and the password is joesentme.

sqlplus worker/joesentme@ARGO (sqlnet v2)

sqlplus worker/joesentme@T:dbhost:CUSTOMER (sqlnet v1)

sqlplus worker/joesentme@P:CUSTOMER (two-task linking)

sqlplus worker/joesentme (works only if done on dbhost and ORACLE_SID is set to CUSTOMER)
 

Other Points

 
BACK HOME Send Email