![]() |
![]() |
|
|
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 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:
UNDEFINE DATA_FILENAME
UNDEFINE INDEX_FILENAME
DEFINE DATA_FILENAME=WLCS_DATA01.DBF
DEFINE INDEX_FILENAME=WLCS_INDEX01.DBF
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.
DEFINE DATA_PATHNAME=/usr1/oracle/oradata/PROD
DEFINE INDEX_PATHNAME=/usr2/oracle/oradata/PROD
@ $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:
@ $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:
connect WEBLOGIC/WEBLOGIC@ORACLE_SID
@ $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:
connect WEBLOGIC/WEBLOGIC@ORACLE_SID
@ $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:
weblogic.jdbc.connectionPool.commercePool=\
url=jdbc:cloudscape:Commerce;
by prepending all of its lines (approximately 17) with a pound (#) character.
#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
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:
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:
$WL_COMMERCE_HOME/bin/unix/set-environment.sh (UNIX).
A subsequent section describes in detail each of the remaining steps.
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:
%WL_COMMERCE_HOME%\StartCommerce.bat (Windows)
$WL_COMMERCE_HOME/StartCommerce.sh (UNIX)
%WL_COMMERCE_HOME%\bin\loadrules.bat (Windows)
$WL_COMMERCE_HOME/bin/loadrules.sh (UNIX)
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|