Creating WLDF Tables in the Database

6-2 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server An example configuration for a file-based store is shown in Example 6–1 . Example 6–1 Sample Configuration for File-based Diagnostic Archive in config.xml domain -- Other domain configuration elements -- server namemyservername server-diagnostic-config diagnostic-store-dirdatastorediagnosticsdiagnostic-store-dir diagnostic-data-archive-typeFileStoreArchive diagnostic-data-archive-type server-diagnostic-config server -- Other server configurations in this domain -- domain

6.3 Configuring a JDBC-Based Store

To use a JDBC store, the appropriate tables must exist in a database, and JDBC must be configured to connect to that database. For information on how to configure JDBC using the Administration Console, see Configure database connectivity in Oracle WebLogic Server Administration Console Help. For additional information about JDBC configuration, see Configuring and Managing JDBC for Oracle WebLogic Server.

6.3.1 Creating WLDF Tables in the Database

If they do not already exist, you must create the database tables used by WLDF to store data in a JDBC-based store. Two tables are required: ■ The wls_events table stores data generated from WLDF Instrumentation events. ■ The wls_hvst table stores data generated from the WLDF Harvester component. The SQL Data Definition Language DDL used to create tables may differ for different databases, depending on the SQL variation supported by the database. Example 6–2 shows the DDL that you can use to create WLDF tables in Apache Derby. Example 6–2 DDL Definition of the WLDF Tables for Apache Derby -- WLDF Instrumentation and Harvester archive DDLs using Derby AUTOCOMMIT OFF; -- DDL for creating wls_events table for instrumentation events DROP TABLE wls_events; CREATE TABLE wls_events RECORDID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY START WITH 1, INCREMENT BY 1, TIMESTAMP BIGINT default NULL, CONTEXTID varchar128 default NULL, TXID varchar32 default NULL, USERID varchar32 default NULL, TYPE varchar64 default NULL, DOMAIN varchar64 default NULL, SERVER varchar64 default NULL, SCOPE varchar64 default NULL, MODULE varchar64 default NULL, Configuring Diagnostic Archives 6-3 MONITOR varchar64 default NULL, FILENAME varchar64 default NULL, LINENUM INTEGER default NULL, CLASSNAME varchar250 default NULL, METHODNAME varchar64 default NULL, METHODDSC varchar4000 default NULL, ARGUMENTS clob100000 default NULL, RETVAL varchar4000 default NULL, PAYLOAD blob100000, CTXPAYLOAD VARCHAR4000, DYES BIGINT default NULL, THREADNAME varchar128 default NULL ; -- DDL for creating wls_events table for instrumentation events DROP TABLE wls_hvst; CREATE TABLE wls_hvst RECORDID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY START WITH 1, INCREMENT BY 1, TIMESTAMP BIGINT default NULL, DOMAIN varchar64 default NULL, SERVER varchar64 default NULL, TYPE varchar64 default NULL, NAME varchar250 default NULL, ATTRNAME varchar64 default NULL, ATTRTYPE INTEGER default NULL, ATTRVALUE VARCHAR4000 ; COMMIT; Consult the documentation for your database or your database administrator for specific instructions for creating these tables for your database.

6.3.2 Configuring JDBC Resources for WLDF