BEA Logo BEA WLCS Release 3.2

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLCS Doc Home   |   Deployment Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Setting Up Oracle for New Installations

 

To use an Oracle database with a WebLogic Commerce Server and WebLogic Personalization Server installation, complete the following tasks:

Note: In a clustered environment, you must complete all of the following tasks for each node in the cluster.

Step 1: Add Statements to the SQL Scripts

Step 2: Create Tablespaces for Oracle

Step 3: Install the Oracle Client Software

Step 4: Create Oracle User Accounts

Step 5: Create the Schema for Oracle

Step 6: Rebuild Indexes

Step 7: Configure Properties Files and Environment Variables for Oracle

Step 8: Set Up the Example Portal for Oracle (optional)

 


Step 1: Add Statements to the SQL Scripts

WebLogic Commerce Server and WebLogic Personalization Server provides SQL scripts to create tablespaces. The following scripts are missing SQL statements:

In each of the scripts, there are two sections: Variable definition and command execution. Currently in the Variable definition portion of each file, you see something similar to the following:

UNDEFINE DATA_PATHNAME 
UNDEFINE INDEX_PATHNAME

DEFINE DATA_PATHNAME=C:\ORACLE\ORADATA\PROD\ 
DEFINE INDEX_PATHNAME=D:\ORACLE\ORADATA\PROD\
REM DEFINE DATA_PATHNAME=/u01/oradata/PROD/
REM DEFINE INDEX_PATHNAME=/u11/ordata/PROD/

To Add Statements to the SQL Scripts

Do the following:

  1. In the Variable definition of the SQL file for your database version, add the following statements:

    UNDEFINE DATA_FILENAME
    UNDEFINE INDEX_FILENAME
    DEFINE DATA_FILENAME=WLCS_DATA01.DBF
    DEFINE INDEX_FILENAME=WLCS_INDEX01.DBF

  2. In the Command execution portion of the SQL file for your database version, replace the "CREATE TABLESPACE" command statements with the following:

    PROMPT
    PROMPT
    PROMPT CREATING TABLESPACE WLCS_DATA
    CREATE TABLESPACE WLCS_DATA DATAFILE
    '&&DATA_PATHNAME&&DATA_FILENAME' SIZE 100M
    ;
    PROMPT
    PROMPT
    PROMPT CREATING TABLESPACE WLCS_INDEX
    CREATE TABLESPACE WLCS_INDEX DATAFILE
    '&&INDEX_PATHNAME&&INDEX_FILENAME' SIZE 100M
    ;

 


Step 2: Create Tablespaces for Oracle

To separate its data from the Oracle data dictionary and from data that other applications use, WebLogic Commerce Server and WebLogic Personalization Server uses the following tablespaces:

For optimal performance, we recommend that you reduce I/O contentions by placing each tablespace on its own physical disk drive.

Creating WLCS_DATA and WLCS_INDEX

Note: In this document, $WL_COMMERCE_HOME refers to the directory into which you installed WebLogic Commerce Server and/or WebLogic Personalization Server and database-type refers to the type and version of RDBMS that you installed.

  1. On the server that hosts the Oracle database, start SQL*Plus and log in as SYSTEM (or another user with create-tablespace privileges). You must complete this procedure on the local host; you cannot successfully create tablespaces from a remote session.

  2. Make a backup copy of $WL_COMMERCE_HOME/db/database-type/create-tablespaces.sql

  3. In a text editor, open create-tablespaces.sql and modify the pathnames for the DATA_PATHNAME and INDEX_PATHNAME variables to match your own directory path structures. For example, on a UNIX workstation two disks are mounted as /usr1 and /usr2 and the Oracle SID is PROD. We recommend the following pathnames:
    DEFINE DATA_PATHNAME=/usr1/oracle/oradata/PROD
    DEFINE INDEX_PATHNAME=/usr2/oracle/oradata/PROD

  4. In the SQL*Plus session you started in step 1, enter the following command:
    @ $WL_COMMERCE_HOME/db/database-type/create-tablespaces.sql

 


Step 3: Install the Oracle Client Software

On the WebLogic Commerce Server and WebLogic Personalization Server host, use the Oracle installation program to install Oracle client software.

For information on the Oracle release that WebLogic Commerce Server and WebLogic Personalization Server supports for your platform type, refer to "Supported Platforms" in the Release Notes.

During the installation process, use the Oracle Net8 Assistant application to set up a new TNS service. The Net8 Assistant prompts you for the name or IP address of the computer that hosts the Oracle server software, the port number Oracle is listening on (usually 1521) and the SID name for the database. Test the connection with the database username and password that your database administrator assigned to you.

If you are using the WebLogic jDriver to connect to the Oracle database, refer to "Installing WebLogic jDriver for Oracle" on the WebLogic documentation site for information on setting up the appropriate jDriver.

 


Step 4: Create Oracle User Accounts

To simplify WebLogic Commerce Server and WebLogic Personalization Server administration, we recommend that you create a user account exclusively for the WebLogic Commerce Server and WebLogic Personalization Server schema. WebLogic Commerce Server and WebLogic Personalization Server include a script that creates a user account named WEBLOGIC and specifies a default tablespace for the account. Although you can modify the script to change the account name, we recommend that you do not; several other scripts assume that the account is named WEBLOGIC. If you change the account name, you must review each script for the use of the WEBLOGIC account name and modify it.

To create a user account:

  1. From the host on which you installed the Oracle client software, start SQL*Plus and log in as SYSTEM (or any user with create-user privileges).

  2. Enter the following command:
    @ $WL_COMMERCE_HOME/db/database-type/create-users.sql

 


Step 5: Create the Schema for Oracle

WebLogic Commerce Server and WebLogic Personalization Server includes a script, create-all-oracle.sql, that calls a series of other scripts to create the WebLogic Commerce Server and WebLogic Personalization Server schema and install sample data.

To run this script, do the following:

  1. On the Oracle client host, log in to the WEBLOGIC user account by entering the following command from SQL*Plus:
    connect WEBLOGIC/WEBLOGIC@ORACLE_SID

  2. Enter the following command:
    @ $WL_COMMERCE_HOME/db/database-type/create-all-oracle.sql

For a description of the tables, indexes, and constraints, see the following topics:

 


Step 6: Rebuild Indexes

The create-all-oracle.sql places the WebLogic Commerce Server and WebLogic Personalization Server index in the default tablespace (WLCS_DATA). To locate and rebuild the index; in the WLCS_INDEX tablespace, do the following:

  1. From the Oracle client host, log in to the WEBLOGIC user account by entering the following command from SQL*Plus:
    connect WEBLOGIC/WEBLOGIC@ORACLE_SID

  2. Enter the following command:
    @ $WL_COMMERCE_HOME/db/database-type/rebuild-wlcs-indexes.sql

 


Step 7: Configure Properties Files and Environment Variables for Oracle

To configure properties files and environment variables for Oracle, complete the following tasks:

Edit the weblogic.properties File

To edit this file, do the following:

  1. In a text editor, open $WL_COMMERCE_HOME/weblogic.properties.

  2. Deactivate the statement that begins with
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:cloudscape:Commerce;
    by prepending all of its lines (approximately 17) with a pound (#) character.

  3. Activate the statement that loads an Oracle driver by removing the pound (#) character from the beginning of each line. This statement contains the following text:

    #weblogic.jdbc.connectionPool.commercePool=\
    # url=jdbc:weblogic:oracle,\
    # driver=weblogic.jdbc.oci.Driver,\
    # loginDelaySecs=0,\
    # initialCapacity=10,\
    # maxCapacity=20,\
    # capacityIncrement=1,\
    # allowShrinking=true,\
    # shrinkPeriodMins=15,\
    # testConnsOnReserve=true,\
    # testTable=dual,\
    # refreshMinutes=5,\
    #

    props=user=@ORACLE_USER@;password=@ORACLE_PASSWORD@;server=@ORACLE_NET_SERVICE_NAME@,\
    # weblogic.t3.waitForConnection=true;\
    # weblogic.t3.waitSecondsForConnection=999999999999,\
    #
    weblogic.jts.waitSecondsForConnectionSecs=999999999999,\
    # verbose=false

  4. In the statement that loads the Oracle driver (illustrated in the previous step), replace the variables that are enclosed in the commercial at (@) characters (such as @ORACLE_USER@) with the values that describe your environment. For example, replace @ORACLE_USER@ with the user account name you create in Step 4: Create Oracle User Accounts.

  5. Save your modifications to $WL_COMMERCE_HOME/weblogic.properties.

Edit the weblogiccommerce.properties File

If you are using the RDBMS security realm, you must change the RDBMSRealm settings in the weblogiccommerce.properties file to match the database type that stores the user information. If you are using LDAP or some other security realm, you can ignore these settings.

For information on the Oracle release that WebLogic Commerce Server and WebLogic Personalization Server supports for your platform type, refer to "Supported Platforms" in the Release Notes.

For example, Listing 1-1 shows a weblogiccommerce.properties file that specifies the WebLogic jDriver.

To change these settings, you must do all of the following:

  1. Remove the comment tags from the lines that specify the database type you are using.

  2. Change any placeholders in the lines. For example, you must change the string @ORACLE_SERVER@ to the name of the Oracle server that hosts the WebLogic Commerce Server and WebLogic Personalization Server database.

  3. Deactivate any other lines in this section by adding comment tags the beginning of each line.

  4. Make sure that the value for commerce.usermgmt.RDBMSRealm.dbUrl matches the value for the commerce.jdbc.pool.url property (also located in weblogiccommerce.properties), which is used to establish JDBC connection pools.

    Also verify that the connection pool properties in weblogic.properties specify the same database type as these settings for the RDBMS realm.

    Listing 1-1 Settings for the RDBMS Realm


    # RDBMS Realm

    #------Oracle thin Driver---------#

    #commerce.usermgmt.RDBMSRealm.driver=oracle.jdbc.driver.OracleDriver
    #commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:oracle:thin:ENTERPRISE:1205:COMMERCE
    #commerce.usermgmt.RDBMSRealm.dbUser=@ORACLE_USER@
    #commerce.usermgmt.RDBMSRealm.dbPassword=@ORACLE_PASSWORD@

    #------WebLogic jDriver for Oracle 8.1.5---------#

    commerce.usermgmt.RDBMSRealm.driver=weblogic.jdbc.oci.Driver
    commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:weblogic:oracle
    commerce.usermgmt.RDBMSRealm.dbServer=bread
    commerce.usermgmt.RDBMSRealm.dbUser=WEBLOGIC
    commerce.usermgmt.RDBMSRealm.dbPassword=WEBLOGIC

    #--------------Cloudscape------------------#

    #commerce.usermgmt.RDBMSRealm.driver=COM.cloudscape.core.JDBCDriver
    #commerce.usermgmt.RDBMSRealm.dbUrl=jdbc:cloudscape:Commerce;create=true;autocommit=false
    #commerce.usermgmt.RDBMSRealm.dbUser=none
    #commerce.usermgmt.RDBMSRealm.dbPassword=none


Update Environment Variables for the Server

To update environment variables, do the following:

  1. In a text editor, open %WL_COMMERCE_HOME%\bin\win32\set-environment.bat (Windows) or
    $WL_COMMERCE_HOME/bin/unix/set-environment.sh (UNIX).

A subsequent section describes in detail each of the remaining steps.

  1. Set @ORACLE_HOME@.

  2. Specify the database.

  3. Set variables for Oracle drivers.

Set @ORACLE_HOME@

After opening set-environment, find the line WLCS_ORACLE_HOME=@ORACLE_HOME@ and substitute @ORACLE_HOME@ with the absolute pathnames of the directory in which you installed the Oracle client software.

For example, Listing 1-2 shows a Windows environment in which the Oracle client software is installed in D:\oracle.

Listing 1-2 Set @ORACLE_HOME@


@ECHO OFF
REM ##############################################################################

REM #      (c) 2000 BEA SYSTEMS INC. All rights reserved
REM #
REM # BEA Commerce Server variable setup script.
REM #
REM ##############################################################################

REM ----------- Set the following variables appropriately ----------- 
REM ----------- or define them as environment variables -----------
REM ----------- in your system properties and comment out -----------
REM ----------- the next 4 lines. -----------

SET WL_COMMERCE_HOME=D:\WebLogicCommerceServer3.2
SET JDK_HOME=D:\jdk1.3

SET WLCS_ORACLE_HOME=D:\oracle 

SET WEBLOGIC_HOME=D:\weblogic

REM -- Add WebLogic, CyberCash, and Taxware bin directories to the path --

SET PATH=%PATH%;%WEBLOGIC_HOME%\bin;%WL_COMMERCE_HOME%\eval\win32\CyberCash\bin;
%WL_COMMERCE_HOME%\eval\win32\Taxware\bin


The WLCS_ORACLE_HOME variable adds Oracle-client Java classes and libraries to the Java classpath and to the system path.

Specify the Database

Under the section titled
-------- Specify which database to use --------,
activate the line that sets the DATABASE variable to the database type that you are using and deactivate any other line. For example, Listing 1-3 shows a Windows environment that uses the WebLogic jDriver.

Listing 1-3 Specify the Database


REM ----------- Specify which database to use -----------

REM SET DATABASE=CLOUDSCAPE

REM DATABASE=ORACLE

SET DATABASE=ORACLE_OCI_815

if %DATABASE% EQU CLOUDSCAPE GOTO CLOUDSCAPE
if %DATABASE% EQU ORACLE GOTO ORACLE
if %DATABASE% EQU ORACLE_OCI_815 GOTO ORACLE_OCI_815

:CLOUDSCAPE

REM ----------- CLOUDSCAPE classes -----------
SET DB_CLASSPATH=%WEBLOGIC_HOME%\eval\cloudscape\lib\cloudscape.jar;%WEBLOGIC_HOME%\eval\cloudscape\lib\tools.jar;%WEBLOGIC_HOME%\eval\cloudscape\lib\client.jar

GOTO continue


Set Variables for Oracle Drivers

Make sure that the :ORACLE_OCI_815 section sets the DB_CLASSPATH variable to null by leaving the value empty.

Then verify that the second line correctly identifies the location of the WebLogic jDriver and Oracle client libraries.

The following example from a Windows installation sets the DB_CLASSPATH to null and adds the WebLogic jDriver and Oracle client libraries to the system path:

:ORACLE_OCI_815
REM ----------- ORACLE classes -----------
SET DB_CLASSPATH=
SET PATH=%PATH%;%WEBLOGIC_HOME%\bin\oci815_8;%WLCS_ORACLE_HOME%\bin

 


Step 8: Set Up the Example Portal for Oracle

If you want to use the WebLogic Personalization Server Example Portal with your Oracle database, do the following:

  1. From a command shell on the WebLogic Commerce Server and WebLogic Personalization Server host, enter the following command:
    %WL_COMMERCE_HOME%\StartCommerce.bat (Windows)
    $WL_COMMERCE_HOME/StartCommerce.sh (UNIX)

  2. Open another command shell and enter the following command:
    %WL_COMMERCE_HOME%\bin\loadrules.bat (Windows)
    $WL_COMMERCE_HOME/bin/loadrules.sh (UNIX)