BEA Logo BEA WLCS Release 3.1.1

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

 

   WLCS Doc Home   |   Installation Guide   |   Previous Topic   |   Next Topic   |   Contents

Database Configuration

 

This chapter describes several database configuration options with WebLogic Commerce Server and WebLogic Personalization Server.

The following sections are presented:

In this chapter, the environment variable WL_COMMERCE_HOME is used to indicate the directory in which you installed the WebLogic Commerce Server 3.1.1 and WebLogic Personalization Server 3.1.1 software.

 


Changing from Cloudscape to Oracle

When you install WebLogic Commerce Server and WebLogic Personalization Server, the default configuration points to the evaluation Cloudscape database that ships with the product. Although this is great for getting started, at some point you will want to upgrade to an enterprise relational database like Oracle. This topic provides the steps to accomplish that task. This topic assumes an Oracle8 database.

The first five steps walk you through setting up the Oracle software and schema:

Note: After you complete these steps, refer to The Credit Card Encryption/Decryption Prompt.

  1. Install the Oracle client software
    The Oracle client software needs to be installed on each server machine where you installed the WebLogic Commerce Server and WebLogic Personalization Server software. Do this by running the Oracle installer on the Oracle CD. You need to install only the client software.

  2. Create an account on the Database
    Ask your Oracle database administrator to create an account on the database that will be used exclusively by WebLogic Server and WebLogic Commerce Server. To simplify administration of the schema, you do not want to have tables in the schema other than those that WebLogic Server and WebLogic Commerce Server put there.

  3. Setup a new TNS service
    Using the Net8 Assistant application that was installed with Oracle, setup a new TNS service. To accomplish this, you will need to know the server machine name, the port number Oracle is running on (usually 1521) and the SID for the instance (ORCL by default). Test the connection with the database user name and password that your database administrator assigned to you.

  4. Verify that the Oracle user account is appropriate
    Now, check that the user account is appropriate for WebLogic Commerce Server. Log on to the Oracle database using SQLPlus. At the prompt, type SELECT TABLE_NAME FROM USER_TABLES; and press Enter. What will be returned is a list of tables owned by the user you have logged in as. Make sure that the user account isn't being used for another purpose. If there are many tables returned, then this user account is probably being used by another application or user.

  5. Build the Oracle schema
    You now should build the WebLogic Commerce Server schema and populate it with the default data set. Run the create-all-oracle.sql script in WL_COMMERCE_HOME/db/oracle. To do this, choose Open from the SQLPlus File menu, and navigate to the script. This will load the script into the buffer. Then, type @create-all-oracle

    You will probably see some error messages, such as "...table does not exist." However, these errors are expected and should be okay.

    The next steps point your WebLogic Commerce Server installation to the new Oracle database:

  6. Edit your weblogic.properties file
    You must edit your weblogic.properties file in the WL_COMMERCE_HOME directory. First comment out the statement that begins with:

    weblogic.jdbc.connectionPool.commercePool=url=jdbc:cloudscape

    Do this by prepending all lines of the statement (approximately 16 lines) with a `#' character.

    Next, find and uncomment all lines of the statement (approximately 15 lines) that loads the jDriver for Oracle 8.1.5. This statement contains the 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

    Next, replace the variables that are enclosed in the ampersand characters (such as @ORACLE_USER@) with the actual values.

  7. Edit your weblogiccommerce.properties file
    Next, you must edit your weblogiccommerce.properties file. In the RDBMS Realm section, you must identify the driver again. In the section that begins:

    commerce.usermgmt.RDBMSRealm.driver

    Uncomment the lines pertaining to the jDriver for Oracle 8.1.5 and comment out the lines pertaining to the Cloudscape driver. The jDriver lines are:

    #------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=@ORACLE_NET_SERVICE_NAME@
    #commerce.usermgmt.RDBMSRealm.dbUser=@ORACLE_USER@
    #commerce.usermgmt.RDBMSRealm.dbPassword=@ORACLE_PASSWORD@

    Again, replace the variables that are enclosed in the ampersand characters (such as @ORACLE_USER@) with the actual values.

  8. Update your environment variables
    Finally, you must update the environment variables for your server. Under the WL_COMMERCE_HOME\bin\win32 or WL_COMMERCE_HOME/bin/unix directory, locate the appropriate set-environment.bat (Windows) file or set-environment.sh (UNIX) file. Open it for editing. You must comment out the SET DATABASE=CLOUDSCAPE line by prepending it with REM. Uncomment the REM SET DATABASE=ORACLE_OCI_815 line by removing the REM from the front.

  9. Download the correct Oracle driver

    From the Oracle website, download the driver version that is relevant to your installation. The driver version must match both the Oracle version number and the JDK version number.

    After changing to an Oracle database, if you get an exception in the commercePool connection process, you most likely have the wrong version of the driver.

  10. Start WebLogic Commerce Server

    1. Change to the installation directory and start WebLogic Commerce Server by running StartCommerce.bat (StartCommerce.sh for UNIX). The default installation path is c:\WeblogicCommerceServer3.1\StartCommerce.bat or /WeblogicCommerceServer3.1/StartCommerce.sh.

      On Windows systems, another way to start the server is to use the Start menu. For example:

      Start-->Programs-->WebLogic Commerce Server 3.1-->Start Commerce Server

      WebLogic Commerce Server opens a console window.

    2. The console output includes a prompt for creating credit card encryption/decryption keys. Enter y at the prompt.

      For information about this prompt, see The Credit Card Encryption/Decryption Prompt.

  11. Run the loadrules script
    If you want to run the example portal, invoke the loadrules script while WebLogic Commerce Server is running. The script can be found in:

    WL_COMMERCE_HOME\bin\win32\loadrules.bat (Windows)

    WL_COMMERCE_HOME/bin/unix/loadrules.sh (UNIX)

When the loadrules script successfully completes, it returns the following message to standard output, where WL_COMMERCE_HOME is the directory into which you installed WebLogic Commerce Server:

loaded : AcmeRules, WL_COMMERCE_HOME/rulesheets/acme.xml

 


Using the Backup Copy of the Database

If the Cloudscape version of the Commerce database becomes corrupted, you can use the backup database copy that was created for you. The backup is located in the following directory:

WL_COMMERCE_HOME/db/data/CommerceBackup (UNIX)

WL_COMMERCE_HOME\db\data\CommerceBackup (Windows)

The backup Cloudscape database contains the initial set of sample data that was loaded when you either:

Using the backup copy of the database is simply a convenience feature and saves you the step of recreating the database by running the create-all-cloudscape.bat (Windows) or create-all-cloudscape.sh (UNIX) script.

 


Recreating the Database

This section explains how to recreate the sample Cloudscape database or Oracle database.

Recreating the Cloudscape Database

Note: If you recreate a database, refer to The Credit Card Encryption/Decryption Prompt.

You might need to recreate the default Cloudscape database if your Cloudscape database becomes corrupted or to reset the data in the tables. To recreate the database, run create-all-cloudscape.bat (Windows) or create-all-cloudscape.sh (UNIX) in the WL_COMMERCE_HOME/db/cloudscape directory.

Recreating the Oracle Database

Note: If you recreate a database, refer to The Credit Card Encryption/Decryption Prompt.

You might need to recreate the Oracle database if your Oracle database becomes corrupted or to reset the data in the tables. To recreate the database, run create-all-oracle.sql in the WL_COMMERCE_HOME\db\oracle directory.

In order to run the example portal, the final step when you create the database is to run loadrules.bat (found in the WL_COMMERCE_HOME\bin folder) while the WLCS server is running.

 


The Credit Card Encryption/Decryption Prompt

After you configure WebLogic Commerce Server to use an Oracle database or recreate a database, the next time you start the server, the console output displays the following prompt:

###########################################################

Credit card encryption/decryption keys were not found.

Should new keys be created?

WARNING: DATA ENCRYPTED WITH ANY PREVIOUS KEY WILL BE LOST.
IF YOU THINK KEYS ARE PRESENT IN THE DATABASE STOP
THE SERVER (USING CTRL-C) AND VERIFY THE DATABASE
USING THE CONFIGURATION INFORMATION SPECIFIED IN
THE "Properties required for the Security Service"
SECTION OF THE WEBLOGICCOMMERCE.PROPERTIES FILE.

###########################################################

If yes enter 'y' or <CTRL-C> to stop the server

If your database contains no customer profile data, enter y. WebLogic Commerce Server generates a key for you. For more information about credit card encryption/decryption, see "Credit Card Security Service" in Order Processing Package.

If your database does contain customer profile data, enter CTRL-C, and contact Customer Support. For information on contacting Customer Support, see "Contacting BEA Customer Support" in the Release Notes.