Database Administration Guide
Using an Oracle Database
This section describes the steps necessary to use an Oracle database with WebLogic Portal 8.1, and includes information on the following subjects:
Review this entire chapter and any release notes before proceeding. Typically, the steps described in this chapter should be performed by an Oracle system administrator or a database administrator.
Understanding Database Configuration for WebLogic Platform
Typically, you use the WebLogic Configuration Wizard to configure and connect to the database that you will use to support WebLogic Platform. For more information about how to use the WebLogic Configuration Wizard, see http://download.oracle.com/docs/cd/E13196_01/platform/docs81/confgwiz/index.html.
When using the Configuration Wizard to configure databases for use with WebLogic Platform, use the following steps.
- Create your vendor database(s). If you want to use behavior event tracking in a production environment, consider using a separate database for behavior event tracking.
Note: If you are creating a separate database for behavior event tracking, see Creating a Database for Behavior Tracking Events on page 3-8.
- Prepare the database for use with WebLogic Platform. BEA provides several sample initialization scripts that need to be modified and run on the vendor database before using the database with WebLogic Platform.
- After the database is configured, use the Configuration Wizard to create and load appropriate database objects and set JDBC driver settings at domain creation time.
Manually Configuring Databases
In some cases, you may wish to manually configure the database or manually modify your existing settings. For example, manual configuration should be used in the following cases:
- If your desired database was not configured via the WebLogic Configuration Wizard.
- If after running the Configuration Wizard you decided to have your domain point to a different database.
- If you would like to refresh your database with the base configuration data that comes with the product. (Note: All the database creation scripts first drop all database objects and recreate them, which means all data added since your original installation will be lost. Upon completion of the database creation scripts only the base configuration data that is needed for the product will exist.)
- When you want to create only a subset of Portal database objects, for example to create only Behavior Tracking database objects for a particular database.
Use the following steps when you need to manually configure a database.
- Create your vendor database(s), see page 3-3. If you want to use behavior event tracking in a production environment, consider using a separate database for behavior event tracking.
- Prepare the database for use with WebLogic Platform, see page 3-3. BEA provides several sample initialization scripts that need to be modified and run on the vendor database before using the database with WebLogic Platform.
- Create database objects, see page 3-5. This creates proprietary database objects that are used by WebLogic. This is done by editing the database properties file provided by BEA.
- Configure the JDBC settings for your database using WebLogic Console Server, see page 3-6.
Configuring an Oracle Database
Before following the steps outlined in this chapter, you need to have already defined the Oracle databases you need.
Note the following when defining your Oracle instance and databases.
- Install the Oracle client software on the WebLogic Platform host.
- Configure a Local Net Service to access the target Oracle database.
- Be sure that Oracle environment variables are defined, and that the Oracle bin directory is included in the
$PATH
variable.
- Verify that you can connect to the target Oracle database via SQLPlus.
Note: If you plan to use the Configuration Wizard to create the database objects for a new domain, you do not need to install the Oracle Client.
- Prepare the Oracle Database.
Notes: Multiple databases are required if you have multiple domains, or to run multiple environments using the same SQL Server instance (for example, if you want to run development and system test from a single SQL Server installation).
Be sure to back up your database(s) before installing any new database objects. See your database documentation for details.
- Edit the SAMPLE scripts provided in: <WL_HOME>/portal/db/oracle/817/admin to suit your environment.
The database creation scripts will install domain-specific tables for each. It is recommended that you work with a database administrator to adjust the SAMPLE
scripts, and to create the database schema owner users and tablespaces needed for your environment.
- Review the Description and Usage Notes for each script.
Script Name
|
Description
|
create_tablespaces.sql
|
Creates data and index tablespaces.
Usage Notes: Edits are required to modify the pathnames for the DATA_PATHNAME and INDEX_PATHNAME variables to match your local directory path structures. For example, on a UNIX system, if two disks are mounted as /usr1 and /usr2 and the Oracle SID is PROD, use the following pathnames:
DEFINE DATA_PATHNAME=/usr1/oradata/PROD
DEFINE INDEX_PATHNAME=/usr2/oradata/PROD
Edits are also required if you want to change the tablespace names. The following defaults are used:
|
create_users.sql
|
Creates a WEBLOGIC schema owner user, establishes the users password, default and temporary tablespaces and grants privileges to that user.
Usage Notes: Edits are required to change the schema owner user name, password and tablespace names. The following defaults are used:
|
rebuild_indexes.sql
|
Rebuilds WEBLOGIC (schema user) indexes to move them from the WEBLOGIC_DATA tablespace to the WEBLOGIC_INDEX tablespace.
|
statistics.sql
|
Runs analyze_schema to compute database statistics needed for the Oracle optimizer. Analyze schema should be run whenever any significant changes in database data occur. Your database administrator will typically schedule analyze_schema to run periodically in your environment.
|
install_report.sql
|
Builds an informational installation report about the database objects created in the schema.
|
db_size.sql
|
Builds a report showing free space in database tablespaces.
|
bt_create_tablespaces.sql
|
Creates the tablespace for behavior event tracking.
Usage Notes: Edits are required to modify the pathnames for the EVT_DATA_PATHNAME and INDEX_PATHNAME variables to match your local directory path structures.
|
bt_create_users.sql
|
Creates a behavior event tracking user, establishes the user's password, default and temporary tablespaces and grants privileges to that user.
Usage Notes: Edits are required to change the schema owner user name, password and tablespace names. Edits are required to change file sizes and device names.
The following defaults are used:
|
- To run these scripts from a shell, change directories to:
WL_HOME/portal/db/oracle/817/admin
- Start SQL*Plus as the system user. For example:
sqlplus system/manager@MYDB
- From SQL*Plus, execute the create_tablespaces.sql script. using the @ sign. For example:
@create_tablespaces.sql
- From SQL*Plus, execute the create_users.sql script using the @ sign. For example,
@create_users.sql
Creating Database Objects
To create WebLogic Platform database objects, use the following steps:
- Use the following command to verify that you can connect to the target database server with a valid user ID and password:
sqlplus
user_ID
/
password
@
DB_SID
- Open your domains db_settings.properties file for edit and comment out the database settings for PointBase.
- Uncomment the database settings for your new target database and update the following settings for your database:
server=
dblogin=
password=
- Initialize the database with the new settings.
- For Windows, navigate to the
<BEA_HOME>\user_projects\domains\portalDomain
directory, and double-click on the create_db.cmd
file.
- For UNIX, navigate to the
<BEA_HOME>\user_projects\domains\portalDomain
directory, run create_db.sh
.
- Verify the results in the
db.log
file.
Note: If you are using the sample domain, run the create_db.cmd/sh file from the following directory: <BEA_HOME>\weblogic81\samples\domains\portal
.
Configure Your Domain's JDBC Driver Settings
Note: These settings do not allow support for XA functionality. For instructions on enabling XA, consult About XA.
- Start the WebLogic Server for your domain.
- Login to the WebLogic Server Console.
- Configure your new connection pools.
- Go to Services -> JDBC -> Connection Pools.
- Click Configure a new Connection Pool.
- Select the appropriate Database Type and Non-XA Database Driver from the drop down list boxes and click Continue.
- Choose a name for the new Connection Pool (For example: cgPoolN) and fill in the blanks for your vendor database. Click Continue.
- Test your connection to verify that you can successfully connect to your database.
- Create and deploy your new Connection Pool.
- Update your data sources.
- From Services -> JDBC -> Data Sources, click on each data source and switch each to the newly created connection pool. Be sure to apply each change.
- Verify that each Data Source is changed by clicking on Data Sources and then verifying that Pool Name has been set to the new Connection Pool for each.
- From Services -> JMS -> Stores -> cgJMSStore, switch cgJMSStore to use the new Connection Pool.
- Stop your domain's WebLogic Server, then restart it.
- In WebLogic Server Console, delete the original cgPool connection pool.
- Go to Services -> JDBC -> Connection Pools.
- Right-click on the cgPool connection pool and select Delete.
- Move indexes to the WEBLOGIC_INDEX tablespace by executing rebuild_indexes.sql from SQLPLUS. This should be done while WebLogic Server is not running, and is recommended for performance.
Creating a Database for Behavior Tracking Events
You may want to store behavior tracking events in a different location than other WebLogic Portal database objects for increased performance. For more information about behavior tracking, see http://download.oracle.com/docs/cd/E13218_01/wlp/docs81/adminportal/help/SA_BehavTrackServ.html.
Note: By default, behavior tracking database objects are created in the same database as other WebLogic Portal database objects. You only need to following these steps if you are configuring a separate database for behavior tracking events.
- From SQL*Plus, execute the bt_create_tablespaces.sql script. using the @ sign. For example:
@bt_create_tablespaces.sql
- From SQL*Plus, execute the bt_create_users.sql script using the @ sign. For example,
@bt_create_users.sql
- Open your domain's
db_settings.properties
file for edit.
- Within the db_settings.properties file, uncomment the database settings for your new target database and update the following settings for your database:
server=<SERVER_NAME>
dblogin=WEBLOGIC_EVENT
password=WEBLOGIC_EVENT
- Within the db_settings.properties file, find the p13n_modules, portal_modules and netuix_modules lines at the top of the file.
- Copy these 3 lines and comment out the original settings by adding a # sign.
- Replace the original settings as follows:
- Replace
p13n_modules=p13n au bt ds
with p13n_modules=bt
.
- Replace
portal_modules=cm wlcs wps collaboration sample_cm
with portal_modules=
- Replace
netuix_modules=pf
with netuix_modules=
.
When you are finished, the section should look like this:
#p13n_modules=p13n au bt ds
#portal_modules=cm wlcs wps collaboration sample_cm
#netuix_modules=pf
p13n_modules=bt
portal_modules=
netuix_modules=
- Save the changes to the
db_settings.properties
file.
- Initialize the database with the new settings.
- For Windows, navigate to the
\\bea\user_projects\domains\portalDomain
directory, and double-click on the create_db.cmd file.
- For UNIX, navigate to the
\\bea\user_projects\domains\portalDomain
directory, run create_db.sh.
- Verify the results in the db.log file.
Note: If you are using the sample domain, run the create_db.cmd/sh file from the following directory: \\bea\weblogic81\samples\domains\portal
.