Database Administration Guide

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using MySQL

This chapter describes the steps necessary to use a MySQL 5.0 database with WebLogic Portal, and includes the following sections:

Review this entire chapter and any release notes before proceeding. The tasks described in this chapter should be performed by a database administrator.

 


Configuring MySQL Databases

Before proceeding, read Overview of Enterprise-Quality Database Configuration for WebLogic Portal.

WARNING: The MySQL JDBC driver is not fully XA compatible, therefore WebLogic Portal does not support using the com.mysql.jdbc.jdbc2.optional.MysqlXADataSource. Data sources that require XA and those that are XA capable should use the com.myself.jdbc.Driver with the global-transactions-protocol LoggingLastResource instead.

The database creation scripts install domain-specific tables. You should work with a database administrator to modify the sample scripts, and to create the database users and tablespaces needed for your environment.

Multiple database users are required if you have multiple domains, or to run multiple environments using the same MySQL instance (for example, if you want to run development and system test from a single MySQL installation). GroupSpace requires a separate database user, as do any additional content management repositories.

To configure a MySQL database:

  1. Back up your database environment before installing any new database objects. See your database documentation for details.
  2. Review the provided sample scripts, located in the WL_HOME/portal/db/mysql/admin directory. See Table 6-1, Database Scripts and Usage Notes, on page 6-7 and the comments in the scripts for additional information.
  3. Copy and modify the sample scripts appropriately for your environment to create each of the following database schemas:
    1. Follow the steps in Configuring the Main WebLogic Portal Database to create the main WebLogic Portal user and database objects.
    2. If you want to use GroupSpace, follow the steps in Configuring the GroupSpace Database to create the GroupSpace user and database objects.
    3. If you want to create a separate behavior tracking database, follow the steps in Manually Creating a Separate Database and Database Objects for Behavior Tracking.

 


Configuring the Main WebLogic Portal Database

Perform the following steps to configure the main WebLogic Portal database:

  1. Copy the create_database.sql script and modify it appropriately for your environment. See Table 6-1, Database Scripts and Usage Notes, on page 6-7 and the comments in the script for additional information. For more information on character sets, see Choosing Character Sets and Sort Orders.
  2. Run the modified create_database.sql script as a user with user account creation privileges (normally the root user). For example, from mysql:
  3. mysql -uroot --password=password <create_database.sql 

Follow the remaining steps only if you want to create database objects manually rather than using the Configuration Wizard. To perform the remaining steps using the Configuration Wizard, see Creating WebLogic Configurations Using the Configuration Wizard.

  1. Open your domain's database.properties file for edit.
  2. Set database=mysql.
  3. Update the following settings (by replacing the @ symbols and the text between the symbols with the correct values) for your main WebLogic Portal database:
  4. mysql.user=@DB_USER@
    mysql.password=@DB_PASSWORD@
    mysql.url=jdbc:bea:mysql://@DB_HOST@:@DB_PORT@;SID=@DB_NAME@
  5. Create the database objects.
    1. Navigate to the BEA_HOME\user_projects\domains\myPortalDomain directory.
    2. Enter one of the commands:
      • On Windows, double-click create_db.cmd.
      • On UNIX, run create_db.sh.
      • If any error messages are displayed, check the create_db.log file for additional information.

        Note: After running create_db script, you need to update the database administrator password. See Note About Creating or Refreshing Database Objects for detailed information.
  6. Replace the JDBC data sources in your domain (except for appsGroupSpaceDataSource), which point to PointBase by default, with data sources that point to MySQL. You can configure them using the WebLogic Server Administration Console or choose from the samples provided and update them for your database environment. Sample jdbc.xml definition files for MySQL are available in the WL_HOME\portal\db\jdbc\mysql directory. Follow the instructions in the WL_HOME\portal\db\jdbc\README.txt file.
  7. Note: Do this while WebLogic Server is stopped.

 


Configuring the GroupSpace Database

Perform the following steps to configure the GroupSpace database:

To configure the GroupSpace database, follow these steps:

  1. Copy the create_database.sql script and modify it appropriately for your environment. See Table 6-1, Database Scripts and Usage Notes, on page 6-7 and the comments in the script for additional information.
  2. Run the modified create_database.sql script as a user with user account creation privileges (normally the root user). For example, from mysql:
  3. mysql -uroot --password=password <create_database.sql 

Follow the remaining steps only if you want to create database objects manually rather than using the Configuration Wizard. To perform the remaining steps using the Configuration Wizard, see Creating WebLogic Configurations Using the Configuration Wizard.

  1. Open your domain's groupspace_database.properties file for edit.
  2. Set database=mysql.
  3. Update the following settings (by replacing the @ symbols and the text between the symbols with the correct values) for your GroupSpace database:
  4. mysql.user=@DB_USER@
    mysql.password=@DB_PASSWORD@
    mysql.url=jdbc:bea:mysql://@DB_HOST@:@DB_PORT@;SID=@DB_NAME@
  5. Create the database objects.
    1. Navigate to the BEA_HOME\user_projects\domains\myPortalDomain directory.
    2. Enter one of the commands:
      • On Windows:
      • create_db.cmd -database.properties=groupspace_database.properties
      • On UNIX:
      • create_db.sh -database.properties=groupspace_database.properties

        If any error messages are displayed, check the create_db_groupspace.log file for additional information.

        Note: After running create_db script, you need to update the database administrator password. See Note About Creating or Refreshing Database Objects for detailed information.
  6. Replace the appsGroupSpaceDataSource JDBC data source (which points to PointBase by default) with a data source that points to MySQL. Use the WebLogic Server Administration Console or update the sample jdbc.xml definition file provided for MySQL in the WL_HOME\portal\db\jdbc\directory. Follow the instructions in the WL_HOME\portal\db\jdbc\README.txt file.

 


Manually Creating a Separate Database and Database Objects for Behavior Tracking

For improved performance, you might want to store behavior tracking events in a different location from other WebLogic Portal database objects. For more information about behavior tracking, see Setting Up Events and Behavior Tracking in the Interaction Management Guide.

Note: By default, behavior tracking database objects are created in the same database as other WebLogic Portal database objects. You need to perform these steps only if you are configuring a separate database for behavior tracking events.

To create a separate database for behavior tracking:

  1. Modify the bt_create_database.sql file for your environment, as indicated in the instructions contained in the scripts and in Table 6-1, Database Scripts and Usage Notes, on page 6-7.
  2. Run bt_create_database.sql as a user with system administrator privileges. For example, from osql:
  3. mysql -uroot --password=password <bt_create_database.sql
  4. Navigate to the appropriate database directory based on your environment: WL_HOME\portal\db\mysql
  5. Connect as the user WEBLOGIC_EVENT and run the following scripts:
    • bt_create_tables.sql
    • bt_create_fkeys.sql
    • bt_create_indexes.sql
    • bt_create_triggers.sql
  6. Run the following scripts from the path WL_HOME\portal\db\data\required:
    • bt_insert_system_data.sql
    • bt9_insert_system_data.sql
  7. Use the WebLogic Server Administration Console to configure a non-XA JDBC data source to access your behavior tracking database. Associate the JNDI name p13n.trackingDataSource with that data source and then remove p13n.trackingDataSource from p13nDataSource.

 


Database Scripts and Usage Notes

Table 6-1 describes the scripts that enable you to configure the MySQL database and create WebLogic Portal objects in that database.

Table 6-1 Database Scripts and Usage Notes 
Script Name
Description
create_database.sql
Creates a database. You must create a main WebLogic Portal database. If you want to use GroupSpace, you must also create that database. You must also create a database for any additional content management repositories.
Make a copy of this script and edit it to replace <<WEBLOGIC>> with the appropriate database name, database owner user, and password for each database you create.
Typical names for the main WebLogic Portal database are:
  • Database name: WEBLOGIC
  • Database owner user: WEBLOGIC
  • Password: WEBLOGIC
When you run the script with these values, it creates the WEBLOGIC database and the WEBLOGIC database owner user, and grants privileges to the WEBLOGIC user in order to create database objects.

Note: To use GroupSpace, you must create an additional database.

Typical names for the GroupSpace repository database are:
  • Database name: WEBLOGIC_GROUPSPACE
  • Database owner user: WEBLOGIC_GROUPSPACE
  • Password: WEBLOGIC_GROUPSPACE

Note: If you decide to create an additional content management repository, you must create a database with different user names for it. For additional information, see the Content Management Guide.

bt_create_database.sql
Creates the WEBLOGIC_EVENT database and WEBLOGIC_EVENT database owner user login, and grants the privileges to the WEBLOGIC_EVENT user necessary for creating database objects.
Following are the default names:
  • Database name: WEBLOGIC_EVENT
  • Database owner user: WEBLOGIC_EVENT
  • Password: WEBLOGIC_EVENT


  Back to Top       Previous  Next