![]() |
![]() |
|
|
Configuring WebLogic Portal for Oracle Databases
WebLogic Portal includes a set of scripts that create Oracle tables and other data objects for use in any WebLogic Portal environment. Depending on the database environment that you are defining, you can choose to load sample data that supports the reference applications.
Usually, a development environment loads the sample data and a staging or production environment does not. In some cases, you may need to modify the default scripts so that they load non-operational sample data (such as data for the product catalog).
This section covers two types of Oracle configurations:
Configuring for jDriver
Step 1: Install the Oracle Client Software
Install the Oracle Client software on the same host as WebLogic Portal. Configure the Oracle Net Service Name to specify the target Oracle database. Then test the connection with the database user name and password that your database administrator assigned to you.
For information on the Oracle releases that WebLogic Portal supports for your platform type, refer to Supported Platforms in the Installation Guide.
Step 2: Create WebLogic Portal Tablespaces and a Schema-Owner User Account
To separate its data from the Oracle data dictionary and from data that other applications use, WebLogic Portal uses the following tablespaces:
A script named create_tablespaces.sql creates the WLCS_DATA and WLCS_INDEX tablespaces. It locates both table data and indexes in the WLCS_DATA tablespace. If possible, each tablespace should be placed on a separate physical disk drive. In Step 6: Rebuild Indexes, you move the indexes to the WLCS_INDEX tablespace.
By default, the schema-owner user account for WebLogic Portal is named WEBLOGIC and the tablespace is WLCS_DATA with a temporary tablespace named TEMP. The sample script named create_users.sql creates the WEBLOGIC user with default tablespaces and grants the WEBLOGIC user appropriate database permissions.
If you need to locate multiple instances of the WebLogic Portal schema on a single database, you must use a different schema-owner user account for each instance. For example, if you need to locate development and test database schemas on the same database instance, you could create two schema owner user accounts named WL_DEV and WL_TEST.
Creating WLCS_DATA and WLCS_INDEX
Note: In this document, PORTAL_HOME refers to the directory into which you installed WebLogic Portal.
To create the WLCS_DATA and WLCS_INDEX tablespaces, do the following (usually, a Database Administrator must complete these tasks):
sqlplus username/password@net_service_name
where username is system or a user with privileges to create tablespaces,
password is the system (or other users) password, and
net_service_name is the Net Service name that you defined for the Oracle database.
@create_tablespaces.sql
Output from executing create_tablespaces.sql will be written to a file named CREATE_TABLESPACES.LOG. Verify the results of running create_tablespaces.sql before you continue.
@create_users.sql
Output from executing create_users.sql will be written to a file named CREATE_USERS.LOG. Verify the results of running create_users.sql before you continue.
Determining the Size of the WebLogic Portal Tablespaces
Monitoring the growth and usage of database resources and data files is a critical task that a Database Administrator must do on a regular basis. By default, the WLCS_DATA and WLCS_INDEX tablespaces are 100 Megabytes each. Any of the following factors might require you to adjust these default sizes:
To determine the amount of disk space that you need in your production environment, a Database Administrator can analyze the usage of the database tables in the development environment. Based on the number of users, groups, personalization data and data from other services, the Database Administrator can project estimates for disk space requirements.
Step 3: Configure Properties and Environment Variables for Oracle
When you install WebLogic Portal, it is configured to support a Cloudscape demonstration database. This section describes how to modify the default Cloudscape properties to support an Oracle database.
To configure properties files and environment variables for Oracle, complete the following tasks in the order indicated below:
Start the WebLogic Server Administration Console
To configure a WebLogic Portal server to support Oracle, start the server and access the WebLogic Server Administration Console for the server's domain.
For example, you want to configure myServer (which listens on port 7501). Start myServer on your local host and then enter the following URL in a browser:
http://[host]:[port]/console
For more information on starting the WebLogic Server Administration Console, refer to "WebLogic Server Administration Console" in the WebLogic Portal Architectural Overview.
Configure JDBC Connection Pools for Oracle
Connection pools provide ready-to-use pools of connections to your RDBMS. The application server creates the pools during server startup, thus eliminating the overhead of your enterprise application having to establish database connections for each transaction. For more information about connection pools, refer to "Overview of Connection Pools" in the WebLogic Server Programming WebLogic JDBC guide.
This section contains the following subsections:
Configure commercePool for Oracle Databases
To configure commercePool for Oracle, do the following:
The WebLogic Server Administration Console keeps this password in an encrypted format.
Configure dataSyncPool for Oracle Databases
Configure a JDBC connection pool named dataSyncPool by doing the following:
The WebLogic Server Administration Console keeps this password in an encrypted format.
Update Settings for the RDBMS Security Realm
If you are using the RDBMS security realm, you must change the RDBMSRealm settings 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.
To change these settings, do the following:
Note: If you named your RDBMS realm something other than wlcsRealm, click the realm that you created.
Figure 9-1 Modify Values on the Database Tab (jDriver Example)
The WebLogic Portal Administration Tools keeps this password in an encrypted format.
user=@ORACLE_USER@<Enter>
weblogic.t3.waitForConnection=true<Enter>
weblogic.t3.waitSecondsForConnection=999999999999,weblogic.jts.waitSecondsForConnectionSecs=999999999999,verbose=false<Enter>
server=@ORACLE_NET_SERVICE_NAME@
where <Enter> denotes that you must press the Enter key after you type the line of text,
@ORACLE_USER@ is the name of the Oracle user account (WEBLOGIC by default) and
@ORACLE_NET_SERVICE_NAME@ is the name of the Oracle net service..
Configure the JDBC Helper Service
The JDBC Helper Service enables services to explicitly establish a database connection and to coordinate the processing of CLOB data. To configure the JDBC Helper service for Oracle, do the following for each deployed application that uses JDBC services:
Note: Since the data synchronization framework uses the Personalization enterprise application, you will need to use the following procedure for the Personalization application as well as all other deployed applications.
Note: For information on setting the JDBC Helper Service for Sybase, DB2, and SQL Server 7, see step 2.4 of the section "Update Settings for the JDBC Helper Service" in the <PORTAL_HOME>/db/readme.html file. No Delegate Class Name is required for Cloudscape databases.
Configure the JDBC Helper Service when Migrating an Application
When migrating an application, including Petflow or the Avitek demonstration, the Service Configuration folder is not automatically created and therefore cannot be used to set up the Helper Service. To set up the Helper Service when migrating an application, do the following:
Note: This procedure configures the JDBC Helper Service for the jDriver for Oracle, it will not create a Service Configuration folder in the console.
<ApplicationConfiguration Name="<YourAppName>" Targets="<yourappServername>"
URI="META-INF/application-config.xml"/>
<ApplicationConfiguration>
<JdbcHelper
JdbcHelperDelegate="com.bea.p13n.util.jdbc.internal.OracleJDriverJdbcHelperDelegate"
MaxRetries="-1"
MaxWaitTime="-1"
Name="JdbcHelper"
/>
</ApplicationConfiguration>
Stop the Server
Stop the server to complete the remainder of Step 3: Configure Properties and Environment Variables for Oracle.
For information on stopping the server, refer to Shutting Down a Server.
Update Environment Variables for the Server
To update environment variables, do the following:
The WLCS_ORACLE_HOME variable adds Oracle-client Java classes and libraries to the Java classpath and to the system path.
Listing 9-1 Set @ORACLE_HOME@
SET PORTAL_HOME=c:\bea\Portal4.0
SET JDK_HOME=c:\bea\jdk1.3
SET WLCS_ORACLE_HOME=C:\oracle\ora81
SET BEA_HOME=c:\bea
SET WEBLOGIC_HOME=c:\bea\wlserver6.1
To specify the database driver, under the section titled
-------- Specify which database to use --------, do one of the following:
Listing 9-2 Specify WebLogic jDriver
REM ----------- Specify which Database Driver to use -----------
REM SET DATABASE=CLOUDSCAPE
...
SET DATABASE=ORACLE_OCI
Step 4: Create the Database Schema for Oracle
WebLogic Portal includes a script, create_all.bat (create_all.sh for UNIX), that calls a series of other scripts to create the WebLogic Portal schema and install sample data. You can modify the script to create the database without loading sample data.
This step includes the following tasks:
Note: If you use the Event and Behavior Tracking Service, you must use a separate set of scripts to create the Event and Behavior Tracking schema objects. For more information, refer to "Scripts" under "Persisting Behavior Tracking Data" in the Guide to Events and Behavior Tracking.
Set Variables in create_all and databaseload.properties
To set variables in create_all, do the following:
REM To be set by user
set SAMPLEDATA=Y
set USER_ID=myUser
set PASSWORD=myPassword
set SERVER=myServer
REM End of set by user
Note: USER_ID and PASSWORD are case sensitive. You must use the same case in databaseload.properties as you used when you created the database user (for example, WEBLOGIC, not weblogic).
To set up databaseload.properties, do the following:
#------Cloudscape--------------------------------#
#jdbcdriver=COM.cloudscape.core.JDBCDriver
#connection=jdbc:cloudscape:Commerce
#dblogin=none
#dbpassword=none
#------Oracle OCI jDriver------------------------#
jdbcdriver=weblogic.jdbc.oci.Driver
connection=jdbc:weblogic:oracle:@ORACLE_NET_SERVICE_NAME@
dblogin=@ORACLE_USER@
dbpassword=@ORACLE_PASSWORD@
Note: You cannot use the Oracle driver when loading sample data via create_all. Instead, use jDriver for this step and in set-environment use SET DATABASE=ORACLE_OCI while running create_all. Refer to the Release Notes for more information.
Run create_all
Caution: Before it creates tables, create_all.bat runs SQL statements that drop any existing WebLogic Portal tables. If you run create_all.bat for a database that already contains WebLogic Portal data, you will lose any WebLogic Portal data that is in the database.
To create the WebLogic Portal schema, do the following:
The script logs its actions in several log files, which it locates in the PORTAL_HOME/db directory.
For a description of the tables, indexes, and constraints, see the following topics:
Step 5: Load Sample Data
You can load additional sample data that demonstrates ad placeholders and other Campaign services.
Note: You must load sample data in order to run the WebLogic Portal sample applications with Oracle. If you did not want to run the sample applications, then you can skip this step.
If you do not load the sample data and then try to bring up the portal tools (http://host:7501/portalTools/index.jsp) after starting the server, the following error message appears in the console:
<Error> <Webflow> <Error while parsing uri /portalTools/application, path null, query string namespace=admin_main - Webflow XML does not exist, is not loaded properly, or you do not have a configuration-error-page defined.Exception[com.bea.p13n.appflow.exception.ConfigurationException: The configuration-error-page node was not found in the webflow xml file. for webapp [tools], namespace [admin_main]. While trying to display CONFIGURATION ERROR: [Exception[com.bea.p13n.appflow.exception.ConfigurationException: Bad Namespace - namespace [admin_main] is not available for webflow execution. Make sure the [admin_main.wf] file is deployed in webapp [tools].]],]
To load sample data, do the following:
The loadSampleData script does the following:
Step 6: Rebuild Indexes
The create_all script places the WebLogic Portal indexes in the default tablespace (WLCS_DATA). To locate and rebuild the indexes in the WLCS_INDEX tablespace, do the following:
sqlplus username/password@net_service_name
where username is the name of the Oracle user account (WEBLOGIC by default),
password is the password for the Oracle user account, and
net_service_name is the Net Service name that you defined for the Oracle database.
Configuring for Thin Driver
Thin Driver is certified with the Service Pack 2 Installation.
Step 1: Install the Oracle Client Software
Install the Oracle Client software on the same host as WebLogic Portal. Configure the Oracle Net Service Name to specify the target Oracle database. Then test the connection with the database username and password that your database administrator assigned to you.
For information on the Oracle releases that WebLogic Portal supports for your platform type, refer to Supported Platforms in the Installation Guide.
Step 2: Create WebLogic Portal Tablespaces and a Schema-Owner User Account
To separate its data from the Oracle data dictionary and from data that other applications use, WebLogic Portal uses the following tablespaces:
A script named create_tablespaces.sql creates the WLCS_DATA and WLCS_INDEX tablespaces. It locates both table data and indexes in the WLCS_DATA tablespace. If possible, each tablespace should be placed on a separate physical disk drive. In Step 6: Rebuild Indexes, you move the indexes to the WLCS_INDEX tablespace.
By default, the schema-owner user account for WebLogic Portal is named WEBLOGIC and the tablespace is WLCS_DATA with a temporary tablespace named TEMP. The sample script named create_users.sql creates the WEBLOGIC user with default tablespaces and grants the WEBLOGIC user appropriate database permissions.
If you need to locate multiple instances of the WebLogic Portal schema on a single database, you must use a different schema-owner user account for each instance. For example, if you need to locate development and test database schemas on the same database instance, you could create two schema owner user accounts named WL_DEV and WL_TEST.
Creating WLCS_DATA and WLCS_INDEX
Note: In this document, PORTAL_HOME refers to the directory into which you installed WebLogic Portal.
To create the WLCS_DATA and WLCS_INDEX tablespaces, do the following (usually, a Database Administrator must complete these tasks):
sqlplus username/password@net_service_name
where username is system or a user with privileges to create tablespaces,
password is the system (or other users) password, and
net_service_name is the Net Service name that you defined for the Oracle database.
@create_tablespaces.sql
Output from executing create_tablespaces.sql will be written to a file named CREATE_TABLESPACES.LOG. Verify the results of running create_tablespaces.sql before you continue.
@create_users.sql
Output from executing create_users.sql will be written to a file named CREATE_USERS.LOG. Verify the results of running create_users.sql before you continue.
Determining the Size of the WebLogic Portal Tablespaces
Monitoring the growth and usage of database resources and data files is a critical task that a Database Administrator must do on a regular basis. By default, the WLCS_DATA and WLCS_INDEX tablespaces are 100 Megabytes each. Any of the following factors might require you to adjust these default sizes:
To determine the amount of disk space that you need in your production environment, a Database Administrator can analyze the usage of the database tables in the development environment. Based on the number of users, groups, personalization data and data from other services, the Database Administrator can project estimates for disk space requirements.
Step 3: Configure Properties and Environment Variables for Oracle
When you install WebLogic Portal, it is configured to support a Cloudscape demonstration database. This section describes how to modify the default Cloudscape properties to support an Oracle database.
To configure properties files and environment variables for Oracle, complete the following tasks in the order indicated below:
Start the WebLogic Server Administration Console
To configure a WebLogic Portal server to support Oracle, start the server and access the WebLogic Server Administration Console for the server's domain.
For example, you want to configure myServer (which listens on port 7501). Start myServer on your local host and then enter the following URL in a browser:
http://[host]:[port]/console
For more information on starting the WebLogic Server Administration Console, refer to "WebLogic Server Administration Console" in the WebLogic Portal Architectural Overview.
Configure JDBC Connection Pools for Oracle
Connection pools provide ready-to-use pools of connections to your RDBMS. The application server creates the pools during server startup, thus eliminating the overhead of your enterprise application having to establish database connections for each transaction. For more information about connection pools, refer to "Overview of Connection Pools" in the WebLogic Server Programming WebLogic JDBC guide.
This section contains the following subsections:
Configure commercePool for Oracle Databases
To configure commercePool for Oracle, do the following:
The WebLogic Server Administration Console keeps this password in an encrypted format.
Configure dataSyncPool for Oracle Databases
Configure a JDBC connection pool named dataSyncPool by doing the following:
The WebLogic Server Administration Console keeps this password in an encrypted format.
Update Settings for the RDBMS Security Realm
If you are using the RDBMS security realm, you must change the RDBMSRealm settings 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.
To change these settings, do the following:
Note: If you named your RDBMS realm something other than wlcsRealm, click the realm that you created.
The WebLogic Portal Administration Tools keeps this password in an encrypted format.
user=@ORACLE_USER@<Enter>
weblogic.t3.waitForConnection=true<Enter>
weblogic.t3.waitSecondsForConnection=999999999999,weblogic.jts.waitSecondsForConnectionSecs=999999999999,verbose=false<Enter>
where <Enter> denotes that you must press the Enter key after you type the line of text, @ORACLE_USER@ is the name of the Oracle user account (WEBLOGIC by default)
Configure the JDBC Helper Service
The JDBC Helper Service enables services to explicitly establish a database connection and to coordinate the processing of CLOB data. To configure the JDBC Helper service for Oracle, do the following for each deployed application that uses JDBC services:
Note: Since the data synchronization framework uses the Personalization enterprise application, you will need to use the following procedure for the Personalization application as well as all other deployed applications.
Note: For information on setting the JDBC Helper Service for Sybase, DB2, and SQL Server 7, see step 2.4 of the section "Update Settings for the JDBC Helper Service" in the <PORTAL_HOME>/db/readme.html file. No Delegate Class Name is required for Cloudscape databases.
Configure the JDBC Helper Service when Migrating an Application
When migrating an application, including Petflow or the Avitek demonstration, the Service Configuration folder is not automatically created and therefore cannot be used to set up the Helper Service. To set up the Helper Service when migrating an application, do the following:
Note: This procedure configures the JDBC Helper Service for the jDriver for Oracle, it will not create a Service Configuration folder in the console.
<ApplicationConfiguration Name="<YourAppName>" Targets="<yourappServername>"
URI="META-INF/application-config.xml"/>
<ApplicationConfiguration>
<JdbcHelper
JdbcHelperDelegate="com.bea.p13n.util.jdbc.internal.OracleThinJdbcHelperDelegate"
MaxRetries="-1"
MaxWaitTime="-1"
Name="JdbcHelper"
/>
</ApplicationConfiguration>
Stop the Server
Stop the server to complete the remainder of Step 3: Configure Properties and Environment Variables for Oracle.
For information on stopping the server, refer to Shutting Down a Server.
Update Environment Variables for the Server
To update environment variables, do the following:
The WLCS_ORACLE_HOME variable adds Oracle-client Java classes and libraries to the Java classpath and to the system path.
Listing 9-3 Set @ORACLE_HOME@
SET PORTAL_HOME=c:\bea\Portal4.0
SET JDK_HOME=c:\bea\jdk1.3
SET WLCS_ORACLE_HOME=C:\oracle\ora81
SET BEA_HOME=c:\bea
SET WEBLOGIC_HOME=c:\bea\wlserver6.1
To specify the database driver, under the section titled
-------- Specify which database to use --------, do one of the following:
Listing 9-4 Specify WebLogic Thin Driver
REM ----------- Specify which Database Driver to use -----------
REM SET DATABASE=CLOUDSCAPE
...
SET DATABASE=ORACLE_THIN
Step 4: Create the Database Schema for Oracle
WebLogic Portal includes a script, create_all.bat (create_all.sh for UNIX), that calls a series of other scripts to create the WebLogic Portal schema and install sample data. You can modify the script to create the database without loading sample data.
This step includes the following tasks:
Note: If you use the Event and Behavior Tracking Service, you must use a separate set of scripts to create the Event and Behavior Tracking schema objects. For more information, refer to "Scripts" under "Persisting Behavior Tracking Data" in the Guide to Events and Behavior Tracking.
Set Variables in create_all and databaseload.properties
To set variables in create_all, do the following:
REM To be set by user
set SAMPLEDATA=Y
set USER_ID=myUser
set PASSWORD=myPassword
set SERVER=myServer
REM End of set by user
Note: USER_ID and PASSWORD are case sensitive. You must use the same case in databaseload.properties as you used when you created the database user (for example, WEBLOGIC, not weblogic).
To set up databaseload.properties, do the following:
#------Cloudscape--------------------------------#
#jdbcdriver=COM.cloudscape.core.JDBCDriver
#connection=jdbc:cloudscape:Commerce
#dblogin=none
#dbpassword=none
Note: You must use jDriver to run create_all and loadSampledata and switch back the Thin Driver. (See the Release Notes document for more information. )
#------Oracle OCI jDriver------------------------#
jdbcdriver=oracle.jdbc.driver.OracleDriver
connection=jdbc:oracle:thin:@@ORACLE_SERVER@:@ORACLE_PORT@ORACLE_SID@
dblogin=@ORACLE_USER@
dbpassword=@ORACLE_PASSWORD@
Note: You cannot use the Oracle Thin driver when loading sample data via create_all. Instead, use jDriver for this step and in set-environment use SET DATABASE=ORACLE_OCI while running create_all. Refer to the Release Notes for more information.
Run create_all
Caution: Before it creates tables, create_all.bat runs SQL statements that drop any existing WebLogic Portal tables. If you run create_all.bat for a database that already contains WebLogic Portal data, you will lose any WebLogic Portal data that is in the database.
To create the WebLogic Portal schema, do the following:
The script logs its actions in several log files, which it locates in the PORTAL_HOME/db directory.
For a description of the tables, indexes, and constraints, see the following topics:
Step 5: Load Sample Data
You can load additional sample data that demonstrates ad placeholders and other Campaign services.
Note: You must load sample data in order to run the WebLogic Portal sample applications with Oracle. If you did not want to run the sample applications, then you can skip this step.
If you do not load the sample data and then try to bring up the portal tools (http://host:7501/portalTools/index.jsp) after starting the server, the following error message appears in the console:
<Error> <Webflow> <Error while parsing uri /portalTools/application, path null, query string namespace=admin_main - Webflow XML does not exist, is not loaded properly, or you do not have a configuration-error-page defined.Exception[com.bea.p13n.appflow.exception.ConfigurationException: The configuration-error-page node was not found in the webflow xml file. for webapp [tools], namespace [admin_main]. While trying to display CONFIGURATION ERROR: [Exception[com.bea.p13n.appflow.exception.ConfigurationException: Bad Namespace - namespace [admin_main] is not available for webflow execution. Make sure the [admin_main.wf] file is deployed in webapp [tools].]],]
To load sample data, do the following:
The loadSampleData script does the following:
Step 6: Rebuild Indexes
The create_all script places the WebLogic Portal indexes in the default tablespace (WLCS_DATA). To locate and rebuild the indexes in the WLCS_INDEX tablespace, do the following:
sqlplus username/password@net_service_name
where username is the name of the Oracle user account (WEBLOGIC by default),
password is the password for the Oracle user account, and
net_service_name is the Net Service name that you defined for the Oracle database.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|