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
- ReplaceINSTANCENAME in the string above with the desired database name.
- For a list of database instance names, please view theRAC Status Page.
- In SQL Developer,createa new connection. You can do so by clicking the green plus sign, typically in the upper left portion of the application window.
- Specify a namefor your connection. You may want to follow the convention of INSTANCE - USERNAME, as analysts may access the same instance/environment using service accounts.
- Under "Connection Type," chooseAdvanced. You will then be presented with a text field where you can paste in your custom JDBC URL.
- Testto confirm your string is properly formatted, thenSave.
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
- Createa file calledldap.orain a chosen directory, preferably the user's home directory (i.e. C:\users\[network ID]), but you could alsouse any other directory of your choice.
In theldap.orafile, add these entries. The content ofldap.orawill be the same for every database instance:
DIRECTORY_SERVERS = (oid.rowan.edu:
1639
)
DEFAULT_ADMIN_CONTEXT =
"dc=rowan,dc=edu"
DIRECTORY_SERVER_TYPE = OID
- In Windows Search, search for "Advanced system settings", and choose "View advanced system settings"
- Cick "Environment Variables" button at the bottom, right of the dialog
- Add a new environment variable -TNS_ADMINthat points to the directory containing the fileldap.ora
- 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).
- Click theLoadbutton just to the right of theDB Servicedrop-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.
- Click the Save button to save your new connection settings