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

Database Setup and Maintenance Overview

This section identifies considerations for setting up and maintaining WebLogic Portal databases.

For a discussion of database environment considerations for team development, see the Production Operations Guide.

For additional information on vendor-specific considerations and recommendations, see the chapter in this guide pertaining to your database vendor.

This chapter includes the following sections:

 


Encrypting Passwords

WebLogic Portal’s database creation scripts (create_db.cmd/sh) use the domain’s salt file when they call JDBCDataLoader.

Database passwords in the database properties files, such as database.properties and groupspace_database.properties, can be either plain text or encrypted. Use weblogic.security.Encrypt to obtain the encrypted passwords. The salt file used to encrypt and decrypt passwords is the domain’s DOMAIN_HOME/security/SerializedSystemIni.dat salt file.

For more about weblogic.security.Encrypt, see Using the WebLogic Server Java Utilities in the WebLogic Server documentation.

 


Choosing Internationalization and Localization Settings

The Localization Industry Standards Association (LISA) defines internationalization and localization as follows:

“Internationalization is the process of generalizing a product so that it can handle multiple languages and cultural conventions without the need for re-design. Internationalization takes place at the level of program design and document development.”

“Localization involves taking a product and making it linguistically and culturally appropriate to the target locale (country/region and language) where it will be used and sold.”

This section contains information on choosing language settings, character sets, and collation (sort) settings for your database. It includes the sections:

Changing the Language Settings in SQL Server

To use SQL Server with portal applications that are localized, you must modify the language settings in the <WLPORTAL_HOME>\portal\db\sql_server\admin\create_database.sql script before running it to create the database.

For example, to change the language setting from US English to Japanese, perform the following edits:

  1. Change the line reading:
  2. COLLATE SQL_Latin1_General_CP1_CS_AS

    to:

    COLLATE Japanese_CS_AS_KS_WS
  3. Change the line reading:
  4. exec sp_addlogin 'WEBLOGIC', 'WEBLOGIC', 'WEBLOGIC', 'us_english'

    to:

    exec sp_addlogin 'WEBLOGIC', 'WEBLOGIC', 'WEBLOGIC', 'japanese'
  5. Run the script (after making any additional required modifications).

For more information about language support in SQL Server, refer to the vendor documentation.

Supporting Unicode Languages in SQL Server

If you want to localize portal applications to support a unicode language, you can edit and run the <WLPORTAL_HOME>\portal\db\sql_server\admin\alter_use_unicode_columns.sql script to alter all columns of type TEXT, CHAR, and VARCHAR to use their unicode equivalents (NTEXT, NCHAR, and NVARCHAR, respectively).

WARNING: Changing these column data types has performance implications. Each column that is modified uses twice as much storage space as the original data type.
WARNING: Back up the database that contains the portal schema before running this script.

After running the script, you can use DBCC CHECKDB command to verify physical storage and table constraints.

Choosing Character Sets and Sort Orders

A database’s character set determines which languages can be represented in the database. A database’s collation (sort order) determines the rules by which characters are sorted and compared.

For a globalized WebLogic Portal application, choose the database’s character set and sort order before you set up the database. Changing an existing database’s character set and sort order can be a time- and resource-intensive task. Typically a change can be made only if the target character set is a subset of the source.

The following sections describe character set and sort order considerations for WebLogic Portal-supported databases. Refer to your vendor documentation for more information.

Oracle

For Oracle, you define the character set when you create the database. In globalized Oracle 9i and 10g databases, a commonly used character set is AL32UTF8.

You can retrieve information about an Oracle database’s character set and sort order by querying the SYS.NLS_DATABASE_PARAMETERS table.

SQL Server

For SQL Server, you can define both instance-level and database-level character sets and sort orders.

The default instance-level character set for SQL Server is determined by the locale setting for the Windows operating system. The following sample output from the sp_helpsort stored procedure shows a common instance level sort order:

Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 52 on Code Page 1252 for non-Unicode Data. 

The sample database creation script is <WLPORTAL_HOME>\portal\db\sql_server\admin\create_database.sql. It defines the WebLogic Portal database with the setting COLLATE SQL_Latin1_General_CP1_CS_AS.

This specifies a case-sensitive definition. Setting the database to be case-sensitive allows content management queries to function for SQL Server as they do for other databases. If content management search queries are not written for a case-sensitive environment, you may have unexpected results.

You can use the sp_helpdb dbname stored procedure to display a SQL Server database’s character set and sort order.

MySQL

For MySQL, you define the character set and set collate at database creation time. A common MySQL character set and collate are CHARACTER SET latin1 and COLLATE latin1_general_cs.

MySQL restricts key lengths to 1000 bytes when a UTF8 character set is used. If UTF8 is the desired character set, the CM_NODE.FULL_PATH and CM_PROPERTY.PROPERTY_NAME columns are restricted to a maximum size of VARCHAR(255), so by default database object creation errors will be thrown if the MySQL database character set is UTF8. Therefore, do not use the UTF8 character set with MySQL at this time.

Sybase

For Sybase, you define the character set and sort order when you create the Sybase instance. A commonly used Sybase character set and sort order definition is:

Character Set = 2, cp850 Code Page 850 (Multilingual) 
Sort Order = 50, bin_cp850 Binary ordering, for use with Code Page 850 (cp850).

You can use the sp_helpsort stored procedure to display information about an instance’s character set and sort order.

DB2

For DB2 databases, you can set character encoding for each database individually. The default character encoding is determined by the operating system.

A commonly used DB2 character encoding is UTF-8.

You can use the DB2 CODESET configuration parameter to determine a database’s codeset.

 


Performance Considerations

This section details factors to consider when optimizing database performance. It includes the sections:

Collocating the Database and WebLogic Portal

To prevent network latency issues, you should locate your database and your WebLogic Portal instances in the same data center. This recommendation is especially important when you use the Propagation Utility, to ensure that a large propagation process can complete successfully.

Using Caching to Reduce Database Access

The frequency of database access varies greatly depending on what functionality is used and how it is used. By reducing the frequency of database access, caching plays a large role in configuring the portal for optimum performance.

For the core portal framework, the portal taxonomy that all users share is loaded in memory during initialization, so database access is typically infrequent after initialization. If a user has customized the portal, a database read is necessary the first time they access it, to retrieve their customizations, user preferences, and so on.

Many other features of the product also use the database, including the content management store. If content is frequently accessed, caching is a good idea where possible; otherwise, database access is necessary to retrieve the content.

Caching Database Tables Using Database-Specific Settings

Some databases provide the ability to cache or pin database tables into memory. Choose a database caching implementation based on the WebLogic Portal components that are deployed for your application and how you deploy them.

The following summarizes the support provided by each database type for caching or pinning database tables. Depending on your environment, you might focus your caching strategy on small tables and frequently referenced tables.

Improving Concurrency Using Sybase Locking

A Sybase instance’s default locking mechanism is ALL PAGES. For concurrency, locking can also be defined for each table in a Sybase database.

The following WebLogic tables are defined with LOCK DATAROWS for Sybase. Other WebLogic Portal tables for Sybase are defined with LOCK DATAPAGES.

Based on your usage of WebLogic Portal components with a Sybase database, you may decide to modify additional tables to the setting LOCK DATAROWS.

Improving Content Search Response Time for Oracle

Content search within WebLogic Portal typically performs best when using the indexes associated with the content repository. In some situations the Oracle optimizer, based on database statistics, chooses to perform tablespace scans instead of using indexes to access the data. Often this results in a much slower response time than if an index was used.

To improve response time, verify that the optimizer_mode Oracle initialization parameter is set to choose.

In addition, to ensure that Oracle indexes are given greater preference over tablespace scans, you can modify the following two initialization parameters:

optimizer_index_cost_adj (range 0-100) 
optimizer_index_caching (range 0-100) 

Refer to your Oracle documentation for the more information about these settings, and the impact modifications may have on your installation.

Using Database Statistics for Table and Index Organization

Each DBMS has its own utility or commands for updating the database statistics used by its query optimizer. The statistics that you collect for your database often provide information on the organization of tables and indexes in your database. A DBA should schedule periodic jobs to maintain database statistics.

Data Manipulation Language (DML) operations (for example, DELETE, INSERT, UPDATE) executed in WebLogic Portal applications can affect table and index organization; this can affect database performance. Refer to your database vendor documentation for details on utilities that are available for table and index reorganization and for information on determining when a re-organization should occur.

Optimizing Table Data and Index Placement

The following sections describe special considerations, recommendations, and requirements for index placement, CLOB/BLOB/TEXT/IMAGE data storage, and behavior tracking:

Choosing Index Placement

For Oracle databases, use the rebuild_indexes.sql script to move indexes into their own tablespace, such as the WEBLOGIC_INDEX tablespace. Run this script manually after creating the WebLogic Portal database to move indexes into their own tablespace. For more information, see Configuring Oracle Databases.

For SQL Server and Sybase, the Data Definition Language (DDL) for non-clustered indexes is defined with ON WEBLOGIC_INDEX to place indexes into their own file group or segment. You must define the WEBLOGIC_INDEX file group or segment before running WebLogic Portal database creation or upgrade scripts. The provided sample create_database.sql scripts define WEBLOGIC_INDEX appropriately.

Choosing Data Storage for Tables with CLOB/BLOB/TEXT/IMAGE Data

This section describes recommendations and special considerations for tables that contain CLOB/BLOB (Oracle/DB2) or TEXT/IMAGE (Sybase/SQL Server) data.

As a general rule, for optimal performance with any of the supported WebLogic Portal database platforms, CLOB/BLOB/TEXT/IMAGE table data should be physically stored separately from other types of data. However, to simplify deployment and to allow for flexibility in your configuration, the default WebLogic Portal database schema is not deployed with separated data. To determine if your specific application is a candidate for separating CLOB/BLOB/TEXT/IMAGE storage, assess the following considerations in your environment:

If you want to change your storage allocations, see your vendor documentation for specific details on changing settings for CLOB/BLOB/TEXT/IMAGE data.

The following additional columns contain CLOB/BLOB or TEXT/IMAGE data types; you can experiment with storage changes to determine the effect on performance.

Choosing Behavior Tracking Data Placement

Behavior tracking enables you to develop, manage, and measure personalized portal applications. By recording events, you can customize portal applications and track visitor behavior.

Due to the large number of rows that can be written to the BT_EVENT table when behavior tracking is enabled, you might want to use a separate database (or tablespace and schema, depending upon your DBMS) to store behavior tracking data.

For each database other than PointBase, see the chapter in this guide pertaining to your database vendor for information on creating a separate database for behavior tracking events.

 


Sizing Considerations

This section describes the considerations for database, page, block, and data type sizing.

Database Sizing

Sizing for your WebLogic Portal database(s) depends on many factors, including the following:

The following sections describe some WebLogic Portal database tables that you should monitor closely for growth.

Monitoring Behavior Tracking Tables

The BT_EVENT table can grow significantly if behavior tracking is enabled.

Monitoring Personalization Tables

The following database tables store personalization data; monitor them for data growth.

Monitoring Portal Framework and WSRP Tables

The following tables involve the Portal Framework and Web Services for Remote Portlets (WSRP) and can potentially be high volume tables; monitor them for data growth.

Monitoring Content Management Database Tables

The following database tables store content management (CM) data; monitor them for data growth.

Monitoring Community Database Tables

The following database tables store Community data; you should monitor them for data growth. If you are using multiple Communities or have a large numbers of users, you can expect these tables to consume more space than the basic Portal Framework customization tables.

Setting Page and Block Sizes

For Oracle and SQL Server databases, an 8K page/block size is the default.

For DB2 databases, an 8K buffer pool is defined for the WebLogic Portal tables and indexes that require this larger pool size (higher than the 4K default).

For Sybase databases, an 8K page size is required for several WebLogic Portal tables and indexes. For Sybase the default page size is 2K, and Sybase does not allow rows to span pages. If your Sybase instance uses 2k or 4k pages, create a new Sybase instance with an 8K page size. Sybase provides a migration utility to migrate data between servers of different page sizes.

Note: See the chapter in this guide pertaining to your database vendor for additional details on database-specific considerations.

Setting BLOB/CLOB Data Type Size Limits

When you create database tables for DB2 and PointBase databases, the maximum BLOB/CLOB size varies by column. You can edit the appropriate database creation script to change this value.

In general, you should be aware of any size restrictions that might apply to your database. Restrictions can vary from one database version to another; refer to your vendor documentation for more information.

 


Performing Database Backup and Recovery

Use the same procedures for backup and recovery of WebLogic Portal databases as you use for other database data.

The following are general recommendations for backup and recovery:

Perform periodic test restores to ensure that your backups are sound.

 


Propagating Portal Environments

You use the WebLogic Portal Propagation Utility to move portal metadata from one portal environment to another. You should be aware of the usage of this utility, and back up your databases prior to propagation.

By design, when you move a portal environment, not all database data is propagated. For example, user and group data is not propagated.

For more information about the Propagation Utility, and what database data is propagated, see the Production Operations Guide. This guide also describes database environment considerations for team development.

 


Commerce JDBC Configuration Settings

You must use a non-XA data source configuration such as portalDataSourceNeverXA-jdbc.xml if you are using commerce functionality.

Remove the jndi-name weblogic.jdbc.jts.commercePool from the portalDataSource-jdbc.xml file and add it to the portalDataSourceNeverXA-jdbc.xml file.

 


Support for Asynchronous Proliferation Requires XA

JMS and JMS database tables are created automatically by WebLogic Server if they do not already exist in the database to store proliferation information. The Portal Resource Proliferation Mode setting determines how updates to portal resources (pages, books, portlets) are cascaded - or proliferated - to desktops and user-customized instances. You can set the mode to Asynchronous, Synchronous, or Off in the WebLogic Portal Administration Console.

When proliferation is performed asynchronously (the default) a JMS queue is used, which requires an XA driver. In this case, the portalDataSourceAlwaysXA-xml data source is used. This means that your database environment must be configured to support XA.

 


Note About Creating or Refreshing Database Objects

If you run the create_db.cmd (or create_db.sh) command to create or refresh WebLogic Portal database objects, the administrator password for the weblogic user defaults to weblogic. To set the database password for the administrator user in the database, do the following:

  1. Stop WebLogic Server.
  2. Delete the contents of the directory DOMAIN_HOME/servers/yourServer/data/ldap.
  3. Run the script DOMAIN_HOME/security/SQLAuthenticator.sql against the database to insert the appropriate database groups, users and passwords into the database security tables.

  Back to Top       Previous  Next