Tuesday, August 21, 2012

How to Create JDBC Connection Pools and Data Resources By SID and Service Name in Oracle WebLogic Server 10.3.5

We known the difference between Oracle Database SID and ServiceName. In short, SID = the unique name of your Oracle Database instance; ServiceName = the alias name to your Oracle Database instance. You can use either of them to create  JDBC Connection Pools and Data Resources in Oracle WebLogic Server 10.3.5. Most product user guides do not cover one of them. You need to figure out by yourself if  your TNSNAMES does not define SID or SERVICE_NAME you need.

My operating environment is
  • Microsoft Windows Server 2008
  • Oracle WebLogic Server 10.3.5
  • Oracle Database 11.2.0.2g
For instructions on how to start and stop your Oracle WebLogic Server, see Starting and Stopping Servers: Quick Reference at http://download.oracle.com/docs/cd/E14571_01/wls.htm.
 
Connect Oracle Database using SID
1. Launch the Oracle WebLogic Server Administration Console
2. Log in using the user name /password configured, by default weblogic/welcome1
3. On the left panel, under Domain Structure, expand Services, click JDBC, and then
choose Data Sources.
4. To create a new JDBC Data Source click New at the bottom of the right panel. Settings for a new JDBC Data Source appears in the right panel of the page.
    In the Name field, type YourDataSource.
    In the JNDI Name field, type jdbc/YourDataSource.
    In the Database Type drop-down list, choose Oracle
    In the Database Driver drop-down list, choose the appropriate driver:
              Oracle’s Driver (Thin XA) for Instance Connections; Versions: 9.0.1; 9.2.0; 10, 11.
5. Click Next. Connection Properties appears on the Create a New JDBC Data Source panel. Use
it to define the connection properties.
    In the Database Name field, your Oracle Database SID
    In the Host Name field, type the name or the IP address of the database server (for example: localhost)
    In the Port field, type the port on the database server that is used to connect to the
database (for example: 1521, the default for Oracle).
    In the Database User Name field, type the database account user name you want
to use to create database connections (for example: root).
    In the Password field, type a password for your database account to use to create database connections.
    In the Confirm Password field, re-type the password to confirm it.
6. Click Next.
The Settings for YourDataSource page appears in the right panel.
7. Click the Connection Pool tab, click Test Configuration, and then click Next.
Select Targets appears on the Create a New JDBC Data Source page in the right panel. Here you select one or more targets to deploy the new JDBC data source.
8. In the Servers check list, select one or more target servers and click Finish.

Connect Oracle Database using SERVICE_NAME
Follow the same steps excepts the following different settings:
4. In the Database Driver drop-down list, choose the appropriate driver:
    Oracle’s Driver (Thin XA) for Service Connections; Versions: 9.0.1; 9.2.0; 10, 11.
5. In the Database Name field, your Oracle Database SERVICE_NAME

No comments:

Post a Comment

How Does the Server Certificate SSL Work?

The Secure Socket Layer (SSL) is the standard security transportation protocol for establishing an encrypted communication between the clie...