This site requires JavaScript to be enabled

Connect to Oracle Databases using SQL Developer

919 views

In the Oracle RAC environment, databases may be moved between the server clusters. To prevent end users from having to update their settings after each move, it is advised that you use OID through a JDBC connection string to connect to an Oracle Database. 

JDBC Step-by-Step Guide

To connect using a JDBC string, modify the following string template to fit your credentials and desired database.

jdbc:oracle:thin:@ldap://oid.rowan.edu:1639/INSTANCENAME,cn=OracleContext,dc=rowan,dc=edu
  1. Replace INSTANCENAME in the string above with the desired database name. 
    1. For a list of database instance names, please view the RAC Status Page
  2. In SQL Developer, create a new connection. You can do so by clicking the green plus sign, typically in the upper left portion of the application window. 
  3. Specify a name for your connection. You may want to follow the convention of INSTANCE - USERNAME, as analysts may access the same instance/environment using service accounts. 
  4. Under "Connection Type," choose Advanced. You will then be presented with a text field where you can paste in your custom JDBC URL. 
  5. Test to confirm your string is properly formatted, then Save.

Example of SQL Developer Advanced configuration screen with JDBC URL provided.

The above graphic shows settings for a connection titled "PROD" connecting to the "PROD" database instance, using the username "scott" and the password "tiger".

LDAP Step-by-Step Guide

  1. Create a file called ldap.ora in a chosen directory, preferably the user's home directory (i.e. C:\users\[network ID]), but you could also use any other directory of your choice.

    In the ldap.ora file, add these entries. The content of ldap.ora will be the same for every database instance:

    DIRECTORY_SERVERS = (oid.rowan.edu:1639)
    DEFAULT_ADMIN_CONTEXT = "dc=rowan,dc=edu"
    DIRECTORY_SERVER_TYPE = OID
     
  2. In Windows Search, search for "Advanced system settings", and choose "View advanced system settings"



  3. Cick "Environment Variables" button at the bottom, right of the dialog



  4. Add a new environment variable - TNS_ADMIN that points to the directory containing the file ldap.ora



  5. Once you've done that, start up SQL Developer, then use the LDAP Server drop-down to pick our LDAP server (it will be the only one: oid.rowan.edu:1639), the context drop-down below it will then auto-populate with the correct entry (dc=rowan,dc=edu).



  6. Click the Load button just to the right of the DB Service drop-down, and all the databases show up in the DB Service drop-down. Find your database instance in the list, and double-click the entry to select it.



  7. Click the Save button to save your new connection settings