Skip Headers
Oracle® Fusion Middleware Administrator's Guide for Oracle SOA Suite and Oracle Business Process Management Suite
11g Release 1 (11.1.1.6.3)

Part Number E10226-16
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

9 Managing Database Growth

This chapter describes how to manage the growth of data in your database with both the purge scripts for deleting large numbers of SOA composite application instances and database table partitioning for enabling schema tables to be range-partitioned on time intervals.

This chapter includes the following topics:

Note:

Table partitioning is an advanced database task and must only be performed by an experienced database administrator (DBA).

For information about troubleshooting database growth issues, see Section B.6.4, "Extending Tablespaces to Avoid Problems at Runtime" and Section B.6.5, "Resolving Database Growth Issues Caused by a High Volume of Transactions."

For more information about database growth management strategies, see the white paper available at the following URL:

http://www.oracle.com/technetwork/middleware/soasuite/overview/index.html

9.1 Introduction to Managing Database Growth

When the amount of data in the Oracle SOA Suite database grows very large, maintaining the database can become difficult. To address this challenge, two methods for managing database growth are provided:

9.1.1 Deleting Large Numbers of Instances with the Purge Script

You can use the purge script for instance and rejected message deletion. The purge script is located in the MW_HOME/SOA_ORACLE_HOME/rcu/integration/soainfra/sql/soa_purge directory.

The purge script is adequate for most Oracle SOA Suite installations. You can consider using table partitioning when the schemas grow so large that the purge script does not meet your performance needs.

For more information about the purge script, see Section 9.3, "Deleting Large Numbers of Instances with the Purge Scripts."

9.1.2 Partitioning the Component Database Tables

Oracle SOA Suite has been instrumented with partition keys that enable DBAs to take advantage of Oracle RDBMS partitioning features and capabilities. This action enables the schema tables to be range-partitioned on time intervals. This is useful when you must reduce the database maintenance window of large tables. (Though not discussed in this chapter, this also provides for the possibility of archiving partitioned data.)

The task of partitioning the Oracle SOA Suite tables must be performed by an experienced DBA. Since partitioning tables is considered a core DBA skill, this chapter does not provide detailed, step-by-step instructions on how to partition tables. Rather, it provides the DBA with the knowledge and understanding of Oracle SOA Suite schemas and their associated scripts. With this knowledge, the DBA can customize any partitioning strategy for their environment, and incorporate any tuning parameters in response to the performance of their database. Tuning is never a one-size-fits-all proposition or a one-off configuration change. Rather, it is an iterative process of monitoring and tuning.

The partitioning schemes discussed in this chapter can only be used with Oracle SOA Suite 11g Release 1 (11.1.1.4 or greater).

The following components are associated with their own database schemas:

  • Oracle BPEL Process Manager

  • Oracle Mediator

  • Human workflow

  • Oracle B2B

  • SOA Infrastructure

  • Oracle BPM Suite

For more information about table partitioning, see the Oracle database administration documentation library located at the following URL:

http://www.oracle.com/technetwork/indexes/documentation/index.html

Notes:

  • A hash subpartition is an option the DBA may want to explore, especially for tables with large object (LOB) segments. This can assist with high water (HW) enqueue contention.

  • A global hash index on primary keys that are monotonically increasing (like CIKEY) may relieve block contention.

9.1.2.1 Referential Integrity and Equipartioning

For performance reasons, the Oracle BPEL Process Manager, Oracle Mediator, human workflow, Oracle B2B, SOA Infrastructure, and Oracle BPM Suite schemas have no foreign key constraints to enforce integrity. This fact discounts the use of the 11g RDBMS feature known as referential partitioning. This feature provides significant benefits because it equipartitions master and detail tables across foreign key constraints. Equipartioning means that the associated dependent table rows are in a database partition with the same partition key interval as their master table rows.

One benefit of this feature is that the state (for example, completed, faulted, and so on) of each detail row in the equipartition can be inferred from its associated master table row.

Although the 11g RDBMS referential partitioning feature cannot be used, similar behavior can be mimicked to achieve some of the same benefits. The Oracle BPEL Process Manager, Oracle Mediator, human workflow, Oracle B2B, SOA Infrastructure, and Oracle BPM Suite components ensure that the partition key of every detail table row is the same as the partition key of its master table row (that is, the date (timestamp) that is the partition key is pushed down). To then complete the setup, the DBA must ensure that the master and detail tables are range-partitioned on the same intervals. Some examples are provided in subsequent sections of this chapter.

Note:

You may decide that referential integrity of aged partitions is not a concern for your site. For example, the site may have ample disk space, allowing data to significantly age, or there may be no apparent, adverse impact of allowing unreferenced data to be stored in the dependent tables.

9.1.2.2 Introduction to Partition Key Selection

The following factors were considered when selecting the schema partition keys:

  • Convey or imply state (for example, completed) for referential integrity

  • Allow range partitioning on time intervals for maintenance operations

  • Be static to avoid row movement that may lead to unreferenced data

  • Be static to avoid row movement when table maintenance operations are performed

  • Provide performance benefits for console queries through partition pruning

9.2 Developing a Purging and Partitioning Methodology

This section summarizes the main points into an action plan that you can follow to purge and partition the dehydration store. Purging is an essential part of any plan and should be performed when data is consuming too much space or you have some other reason for removing the data.

There are three main strategies for reducing the size of the schemas:

In the first two cases, the same purge script is used, although if you are partitioning, you must edit the purge script to comment out your partitioned tables.

The purge script uses standard SQL DELETE statements to remove rows from the BPEL tables. For most sites, this is sufficient. However, some sites accumulate so much data that the purge script takes too long to run. In this case, partitioning becomes the better solution. The trade off is that partitioning involves significantly more database maintenance. Moreover, partitioning is an advanced technique and requires a knowledgeable and skilled DBA. By contrast, running the purge script is straightforward and does not require significant DBA knowledge.

Try to profile the input messages, database growth rate, and how much data is purged in the purge process. If the input rate and purge rate match, then regular purging is sufficient. Otherwise, consider partitioning.

If you use partitioning, Oracle recommends that you add disk space and eventually drop the partition. However, this creates additional requirements for managing disk capacity, deciding on the correct partition size, and so on. Do not use partitioning and then rely on the purge script to reclaim disk space.

9.3 Deleting Large Numbers of Instances with the Purge Scripts

Deleting thousands of instances with the Delete With Options button on the Instances page of a SOA composite application in Oracle Enterprise Manager Fusion Middleware Control takes time and may result in a transaction timeout. Instead, use the purge scripts for deleting instances. Note the following details about the purge scripts:

The following sections provide examples of how to use the script:

Notes:

  • If you use the purge_soainfra_oracle.sql PL/SQL script provided in releases before 11g Release 1 (11.1.1.4), note that this script is only supported on Oracle databases. There is no purge script support on the Microsoft SQL Server or IBM DB2 database, either with the purge_soainfra_oracle.sql purge script or with the newer purge script provided with release 11g Release 1 (11.1.1.4 or later). Only Oracle databases are supported.

  • The purge_soainfra_oracle.sql PL/SQL purge script provided in pre-11.1.1.4 releases has been deprecated. If you are an existing user of this script, you can continue to use it against your database in 11g Release 1 (11.1.1.4 or later). However, starting with 11g Release 1 (11.1.1.4), this script is no longer shipped. Oracle recommends that you use the purge script provided with 11g Release 1 (11.1.1.4 or later).

  • When upgrading from 11g Release 1 (11.1.1.3) to 11g Release 1 (11.1.1.4) or later, ensure that you run the purge setup scripts from the 11.1.1.4 or later location, respectively, as this contains the latest purge details. For more information about upgrade, see Oracle Fusion Middleware Upgrade Guide for Oracle SOA Suite, WebCenter, and ADF.

9.3.1 Looped Purge Script

The master purge script includes a looping construct that allows for a batched purge. You can also provide this script with a max_runtime parameter that stops looping after the value for this parameter is exceeded.

The master script drives the purge of SOA database tables. You can use the delete_instances procedure to purge SOA database tables.

Note:

Set max_runtime to a higher value if there are many instances to purge. In this case, you should expect to wait for a longer time before the script exits. Alternatively, use a smaller batch size if you want the purge script to exit sooner.

9.3.1.1 delete_instances Procedure

Use the delete_instances procedure to delete instances. Example 9-1 shows the syntax.

Example 9-1 delete_instances Procedure Syntax

procedure delete_instances (
                   min_creation_date in timestamp,
                   max_creation_date in timestamp,
                   batch_size in integer,
                   max_runtime in integer,
                   retention_period in timestamp,
                   purge_partitioned_component in boolean
                   composite_name in varchar2
                   composite_revision in varchar2
                   soa_partition_name in varchar2
                   );

Table 9-1 describes the script parameters.

Table 9-1 delete_instances Procedure Parameter Descriptions

Parameter Description

min_creation_date

Beginning creation date for the composite instances.

max_creation_date

Ending creation date for the composite instances.

batch_size

Batch size used to loop the purge. The default value is 20000.

max_runtime

Expiration at which the purge script exits the loop. The default value is 60. This value is specified in minutes.

retention_period

Retention period is only used by the BPEL process service engine (in addition to using the creation time parameter). This functionality is not extended to other components.

This parameter checks for and deletes records in the cube_instance table. The value for this parameter must be greater then or equal to max_creation_date. The default value is null.

Specify a retention period if you want to retain the composite instances based on the modify_date of the BPEL instances (cube_instance).

In this example, the modify_date of the BPEL instances table, which can be different than the composite created_date, is used as a second level of filtering:

min_creation_date = 1st June 2011 
      max_creation_date = 30  June 2011
      retention_period = 1st July 2011

This deletes all composite instances in which the creation_time of the composite is between 1st June 2011 and 30 June 2011 and the modify_date of the cube_instance is less than 1st July 2011

purge_partitioned_component

Users can invoke the same purge to delete partitioned data. The default value is false.

composite_name

The name of the SOA composite application. This parameter, along with the composite_revision and soa_partition_name parameters, enables you to purge the instances of a specific SOA composite application. For more information, see Section 9.3.5, "Purging the Instances of a Specific SOA Composite Application."

composite_revision

The revision number of the SOA composite application.

soa_partition_name

The partition in which the SOA composite application is included.


Note:

If you do not provide a value for retention_period, the value for this property defaults to the value of max_creation_date (this is, if retention_period equals null, then retention_period = max_creation_date). This consequence also applies to the script parameters described in Section 9.3.2, "Looped Purge in Parallel Script with dbms_scheduler."

9.3.2 Looped Purge in Parallel Script with dbms_scheduler

This script is functionally the same as the looped purge script described in Section 9.3.1, "Looped Purge Script." However, this script uses the dbms_scheduler package to spawn multiple purge jobs, with each job working on subset data.

You can use the following procedure to purge SOA database tables.

Note:

If you have a multiple CPU host, use of the parallel script can be beneficial. However, Oracle recommends that you enable the parallel script only during off hours. In addition, when purging data during off hours, Oracle recommends that you drop indexes before purging large amounts of data and then add the indexes back in. This speeds up the purge process, and also keeps indexes from becoming unbalanced.

9.3.2.1 delete_instances Procedure in Parallel

Use the delete_instances procedure in parallel to delete instances. Example 9-2 shows the syntax.

Example 9-2 delete_instances Procedure in Parallel Syntax

PROCEDURE delete_instances_in_parallel (
                   min_creation_date in timestamp,
                   max_creation_date in timestamp,
                   batch_size in integer,
                   max_runtime in integer,
                   retention_period in integer,
                   DOP in integer
                   max_count integer,
                   purge_partitioned_component in boolean)
                   composite_name in varchar2
                   composite_revision in varchar2
                   soa_partition_name in varchar2

Table 9-2 describes the script parameters.

Table 9-2 delete_instances in Parallel Procedure Parameter Descriptions

Parameter Description

min_creation_date

Beginning creation date for the composite instances.

max_creation_date

Ending creation date for the composite instances.

batch_size

Batch size used to loop the purge. The default value is 20000.

max_runtime

Expiration time at which the purge script exits the loop. The default value is 60. This value is specified in minutes.

retention_period

Retention period is only used by the BPEL process service engine (in addition to using the creation time parameter). The default value is null. For more information about this parameter, see Table 9-1.

DOP

Defines the number of parallel jobs to schedule. The default value is 4.

max_count

Defines the number of rows processed (not the number of rows deleted). A big temp table is created and then jobs are scheduled to purge based on the data. This is the maximum purge row count to use; it defaults to one million. The default value is 1000000.

purge_partitioned_component

Users can invoke the same purge to delete partitioned data. The default value is false.

composite_name

The name of the SOA composite application. This parameter, along with the composite_revision and soa_partition_name parameters, enables you to purge the instances of a specific SOA composite application. For more information, see Section 9.3.5, "Purging the Instances of a Specific SOA Composite Application."

composite_revision

The revision number of the SOA composite application.

soa_partition_name

The partition in which the SOA composite application is included.


9.3.3 Purge States

Instances in the following states are purged with the purge scripts:

  • Completed successfully

  • Faulted

  • Terminated by user

  • Stale

  • Unknown (instance tracking is disabled)

Purging of the following instance states is not supported:

  • Instances pending recovery at the BPEL process service engine level or SOA composite application level

  • Running instances

To purge these instances, you must first move them to one of the instance states supported by the purge scripts.

9.3.4 Resequenced Message Purge States for Oracle Mediator

The purge scripts include purge commands to purge the information persisted in the Oracle Mediator resequencer tables (mediator_group_status and mediator_resequencer_message). The following information is purged from the resequencer tables when you run the purge scripts:

  • Completed and aborted messages for all resequencer types

  • Timed out messages for standard resequencers

  • Groups in a ready state for best effort and FIFO (first in/first out) resequencers (these are the only groups that can be purged)

To allow fault recovery and message processing to be completed, the purge scripts do not purge all resequenced message information. In addition, standard resequencer groups store information that should not be purged. The following are not purged when you run the purge scripts:

  • Faulted messages for all resequencer types

  • Running messages for all resequencer types

  • Group information for standard resequencers

  • Groups in a state other than ready for best effort and FIFO resequencers

Note:

The purge scripts for the Oracle Mediator resequencer purge messages first and then move on to groups. If there are messages for a group in the mediator_resequencer_message table, the group cannot be deleted.

The above describes processing for both looped and parallel processing of the purge scripts, and regardless of whether instance tracking is enabled or disabled. Before any sequence groups are purged, a check is performed to verify that all messages associated with the group are processed.

Below is a list of group state codes used in the resequencer tables:

  • 0: Ready

  • 1: Locked

  • 2: Error

  • 4: Timed out

  • 6: Group error

Below is a list of message state codes used in the resequencer tables:

  • 0: Ready

  • 1: Locked

  • 2: Completed

  • 3: Error

  • 4: Timed out (this is ignored)

  • 5: Aborted

9.3.5 Purging the Instances of a Specific SOA Composite Application

You can purge the instances of a specific SOA composite application and leave the instances of other composites unpurged. This action enables you to purge certain flows more frequently than others due to high volume or retention period characteristics.

The purge scripts include an option for purging based on COMPOSITE_DN. Purging based on COMPOSITE_DN is supported with the parameters COMPOSITE_NAME and COMPOSITE_REVISION.

The purge logic is based on flows (ECIDs) and not COMPOSITE_IDs. Therefore, apart from the intended COMPOSITE_DNs, other composites sharing the same ECID may get deleted. The following scenarios may occur:

  • A composite instance is closed, but the flow is still open:

    In a scenario in which composite A calls composite B, the purge intends to delete instances of composite A. However, there may be a case in which an instance of composite A is closed, but the corresponding composite B instance is still open. Therefore, because the overall flow is still in an open state, the composite A instance (even though closed) is not purged.

  • The composite instance is closed and the flow is also closed:

    Composite A again calls composite B. The purge intends to delete instances of composite A. Therefore, in a case in which composite A is closed and composite B is also closed, because the overall flow is closed, both composite instances A and B are purged.

These scenarios maintain the consistency of the flow.

For information about the COMPOSITE_NAME and COMPOSITE_REVISION parameters, see Section 9.3.1, "Looped Purge Script" and Section 9.3.2, "Looped Purge in Parallel Script with dbms_scheduler."

9.3.6 Executing the Purge Scripts

This section describes how to execute the purge scripts.

To execute the purge scripts:

  1. In SQL*Plus, connect to the database AS SYSDBA:

    CONNECT SYS AS SYSDBA
    
  2. Execute the following SQL commands:

    GRANT EXECUTE ON DBMS_LOCK to USER;
    GRANT CREATE ANY JOB TO USER;
    

    where USER is the soainfra account to execute the scripts. These privileges are required to run the scripts.

  3. Load the purge scripts by executing the main purge script in the MW_HOME/SOA_ORACLE_HOME/rcu/integration/soainfra/sql/soa_purge directory.

    For a parallel purge, the debug logs from the jobs spawned by a parallel purge are logged into files created in the directory named SOA_PURGE_DIR. This directory must be accessible to the Oracle database.

  4. Create SOA_PURGE_DIR and grant write permissions to the soainfra user.

    mkdir -p /tmp/purgelog
    CREATE OR REPLACE DIRECTORY SOA_PURGE_DIR AS 'SERVER_DIRECTORY'
    

    where SERVER_DIRECTORY is the name of the directory to create (for example, '/tmp/purgelog/'). Note the required single quotes around the directory path.

  5. If you want to execute the scripts in debug mode, run common/debug_on.sql and set serverout to on in SQL*Plus. This step is optional.

    SET SERVEROUTPUT ON
    

    The logs from the spawned jobs are logged into the directory created in Step 4 (separate files per job). The rest of the logs are displayed on stdout (or the spool file, if configured).

    There are two options for purging:

    • Looped purge

    • Parallel purge

  6. Execute the purge scripts as shown below. Examples are provided for both options.

    1. For looped purge:

      DECLARE
      
         MAX_CREATION_DATE timestamp;
         MIN_CREATION_DATE timestamp;
         batch_size integer;
         max_runtime integer;
         retention_period timestamp;
      
        BEGIN
      
         MIN_CREATION_DATE := to_timestamp('2010-01-01','YYYY-MM-DD');
         MAX_CREATION_DATE := to_timestamp('2010-01-31','YYYY-MM-DD');
          max_runtime := 60;
          retention_period := to_timestamp('2010-01-31','YYYY-MM-DD');
         batch_size := 10000;
           soa.delete_instances(
           min_creation_date => MIN_CREATION_DATE,
           max_creation_date => MAX_CREATION_DATE,
           batch_size => batch_size,
           max_runtime => max_runtime,
           retention_period => retention_period,
           purge_partitioned_component => false);
        END;
        /
      
    2. For parallel purge:

      DECLARE
      
         max_creation_date timestamp;
         min_creation_date timestamp;
         retention_period timestamp;
        BEGIN
      
         min_creation_date := to_timestamp('2010-01-01','YYYY-MM-DD');
         max_creation_date := to_timestamp('2010-01-31','YYYY-MM-DD');
         retention_period := to_timestamp('2010-01-31','YYYY-MM-DD');
      
          soa.delete_instances_in_parallel(
           min_creation_date => min_creation_date,
           max_creation_date => max_creation_date,
           batch_size => 10000,
           max_runtime => 60,
           retention_period => retention_period,
           DOP => 3,
           max_count => 1000000,
           purge_partitioned_component => false);
      
       END;
      

9.4 Partitioning Component Tables

The runtime and schema code for the following components has been modified to store the flow creation date column with their transactional tables.

The CPST_CREATED_DATE column contains the flow creation date time populated by the instance tracking code. This is available as the normalized message property oracle.integration.platform.instance.CommonConstants.COMPOSITE_INSTANCE_CREATED_TIME.

All SOA components are partitioned on the same partition key. These partitioned components use the same time range and partition ID.

Note:

Before performing complete or partial partitioning, run the purge scripts.

9.4.1 Configuring Partitions

Partitioning is not configured by default; it is a postinstallation step that must be performed manually. Once you decide to implement partitioning of the database, you must perform some initial configuration tasks only once:

  • Using the information in this chapter, decide which groups you want to partition.

  • For each of those groups, decide which tables you want to partition, remembering that there are some mandatory tables in each group that must be partitioned.

  • For each group, decide on the partition interval.

  • Create the partition scripts to partition the Oracle SOA Suite schemas. No scripts are supplied; each DBA is responsible for creating the partition scripts appropriate for their environment.

  • Edit the purge script and remove references to any tables that you partitioned.

9.4.2 Introduction to the Verification Script

A verification script is provided for a DBA to identify when to drop a partition and its equipartitioned dependent table. The verification script also identifies if there are active, long running instances. You can then move these instances to a different partition, and then drop the original partition.

Note:

The verification script does not drop any partitions; it just ensures that partitions are eligible to be dropped.

9.4.3 Component Tables

This section describes partitioning constraints and lists the component tables, the groups to which they belong, and their partition key.

9.4.3.1 Partitioning Constraints

Note the following table partitioning constraints:

  • You have the choice of the following approach to partitioning:

    • Complete partitioning: All tables of a service component/service engine are partitioned.

    • No partitioning: No tables of a service component/service engine are partitioned.

    • Partial partitioning: Restrict partitioning to specific tables with a high growth rate. Table 9-3 lists the master and dependent tables that can be partitioned.

      Table 9-3 Partial Partitioning

      Master Table Dependent Table of Master Table

      COMPOSITE_INSTANCE

      REFERENCE_INSTANCE

      CUBE_INSTANCE

      CUBE_SCOPE

      XML_DOCUMENT

      None

      MEDIATOR_INSTANCE

      MEDIATOR_CASE_INSTANCE

      MEDIATOR_PAYLOAD

      None


      You can partition any of the tables in Table 9-3 by following these constraints:

      • If you want to partition a dependent table, you must also partition its master table.

      • All tables should be equipartitioned along the same date ranges and the same name.

      • Always partition the COMPOSITE_INSTANCE table. This constraint is essential when the Audit Level property is set to Development or Production for any of the composites. The verification script checks for active flows based on the active composite instances within that partition. Therefore, if the COMPOSITE_INSTANCE table is not partitioned, the entire verification script logic based on the equipartitioning of all the tables fails.

  • Regardless of the group and component, all tables that are partitioned use the same time range and the partition ID.

9.4.3.2 Component Tables, Range Partition Keys, and Groups

Table 9-4 through Table 9-9 are divided into three groups.

  • Group 1: This includes tables that are directly related to the end-to-end flow trace of a composite. A majority of the tables fall into this group.

  • Group 1A: This includes a small set of tables that are not directly related to the flow trace (for example, REJECTED_MESSAGE).

  • Group 2: This includes a small set of tables that have a dependency on multiple tables from Group 1 and 1A tables. You must first execute the group 1 verification script and drop the group 1 partitions before executing the group 2 verification script.

    Note:

    Groups 1 and 1A are combined in the verification script. Executing the verification script does not require you to have knowledge of this classification.

Table 9-4 Component: SOA Infrastructure

Table Range Partition Key Group

COMPOSITE_INSTANCE

PARTITION_DATE

1

REFERENCE_INSTANCE

CPST_PARTITION_DATE

1

COMPOSITE_INSTANCE_FAULT

CPST_PARTITION_DATE

1

COMPOSITE_SENSOR_VALUE

CPST_PARTITION_DATE

1

COMPONENT_INSTANCE

CPST_PARTITION_DATE

1

REJECTED_MESSAGE

CREATED_TIME

1A

REJECTED_MSG_NATIVE_PAYLOAD

RM_PARTITION_DATE

1A

INSTANCE_PAYLOAD

CREATED_TIME

2

COMPOSITE_INSTANCE_ASSOC

CREATED_TIME

2


Table 9-5 Component: Oracle BPEL Process Manager

Table Range Partition Key Group

CUBE_INSTANCE

CPST_INST_CREATED_TIME

1

CI_INDEXES

CI_PARTITION_DATE

1

CUBE_SCOPE

CI_PARTITION_DATE

1

DOCUMENT_CI_REF

CI_PARTITION_DATE

1

AUDIT_TRAIL

CI_PARTITION_DATE

1

AUDIT_DETAILS

CI_PARTITION_DATE

1

DLV_SUBSCRIPTION

CI_PARTITION_DATE

1

WORK_ITEM

CI_PARTITION_DATE

1

AUDIT_COUNTER

CI_PARTITION_DATE

1

WI_FAULT

CI_PARTITION_DATE

1

DLV_MESSAGE

RECEIVE_DATE

1A

HEADERS_PROPERTIES

DLV_PARTITION_DATE

1A

DOCUMENT_DLV_MSG_REF

DLV_PARTITION_DATE

1A

XML_DOCUMENT

DOC_PARTITION_DATE

2


Table 9-6 Component: Oracle Mediator

Table Name Range Partition Key Group

MEDIATOR_INSTANCE

COMPOSITE_CREATION_DATE

1

MEDIATOR_CASE_INSTANCE

MI_PARTITION_DATE

1

MEDIATOR_CASE_DETAIL

MI_PARTITION_DATE

1

MEDIATOR_AUDIT_DOCUMENT

MI_PARTITION_DATE

1

MEDIATOR_DEFERRED_MESSAGE

CREATION_DATE

1A

MEDIATOR_PAYLOAD

CREATION_TIME

2


Table 9-7 Component: Human Workflow

Table Range Partition Key Group

WFTASK

COMPOSITECREATEDTIME

1

WFTask_TL

COMPOSITECREATEDTIME

1

WFTaskHistory

COMPOSITECREATEDTIME

1

WFTaskHistory_TL

COMPOSITECREATEDTIME

1

WFComments

COMPOSITECREATEDTIME

1

WFMessageAttribute

COMPOSITECREATEDTIME

1

WFAttachment

COMPOSITECREATEDTIME

1

WFAssignee

COMPOSITECREATEDTIME

1

WFReviewer

COMPOSITECREATEDTIME

1

WFCollectionTarget

COMPOSITECREATEDTIME

1

WFRoutingSlip

COMPOSITECREATEDTIME

1

WFNotification

COMPOSITECREATEDTIME

1

WFTaskTimer

COMPOSITECREATEDTIME

1

WFTaskError

COMPOSITECREATEDTIME

1

WFHeaderProps

COMPOSITECREATEDTIME

1

WFEvidence

COMPOSITECREATEDTIME

1

WFTaskAssignmentStatistic

COMPOSITECREATEDTIME

1

WFTaskAggregation

COMPOSITECREATEDTIME

1


Table 9-8 Component: Oracle B2B

Table Range Partition Key Group

B2B_BUSINESS_MESSAGE

CPST_INST_CREATED_TIME

1

B2B_APP_MESSAGE

CPST_INST_CREATED_TIME

1

B2B_WIRE_MESSAGE

CPST_INST_CREATED_TIME

1

B2B_DATA_STORAGE

CPST_INST_CREATED_TIME

1

B2B_EXT_BUSINESS_MESSAGE

CPST_INST_CREATED_TIME

1


Table 9-9 Component: Oracle BPM Suite

Table Range Partition Key Group

BPM_AUDIT_QUERY

CI_PARTITION_DATE

1

BPM_MEASUREMENT_ACTIONS

CI_PARTITION_DATE

1

BPM_MEASUREMENT_ACTION_EXCEPS

CI_PARTITION_DATE

1

BPM_CUBE_AUDITINSTANCE

CI_PARTITION_DATE

1

BPM_CUBE_TASKPERFORMANCE

CI_PARTITION_DATE

1

BPM_CUBE_PROCESSPERFORMANCE

CI_PARTITION_DATE

1


9.4.4 Executing the Verification Script

A verification script is provided for the DBA to identify when to drop a partition and its equipartitioned dependent table. The verification script is located in MW_HOME/SOA_ORACLE_HOME/rcu/integration/soainfra/sql/verify.

To execute the verification script:

  1. Create a directory with the SQL command PART_DIR. For example:

    CREATE DIRECTORY PART_DIR AS '/tmp/verify'
    
  2. Provide the soainfra user with write privileges on this directory. The log and SQL files are generated in this directory.

  3. For executing the stored procedure, the client script soa_exec_verify.sql can be used. Edit soa_exec_verify.sql and enter the partition names that require verification in the array mySoa_drv_list.

    1. To execute function verify_soa.verify_1, pass 1 as the parameter.

    2. To execute function verify_soa_verify_2, pass 2 as the parameter.

  4. Review the logs and SQL files generated in the PART_DIR directory.

Note:

A verification script is not provided for business rules.

9.4.5 Verifying and Dropping Partitions

To verify and drop partitions:

  1. Execute function verify_soa.verify_1.

  2. Check the log file in the PART_DIR folder with the name SOA_PARTITION_NAME_LOG_1 for any failures. If you have active, long running instances, see Section 9.4.6, "Moving Active, Long Running Instances to a Different Partition."

  3. Drop the partitions that can be dropped by using the script generated in the PART_DIR folder with the name SOA_PARTITION_NAME_RESULT_1.sql.

  4. Execute verify_soa.verify_2.

  5. Check the log file in the PART_DIR folder with the name SOA_PARTITION_NAME_LOG_2 for any failures.

  6. Drop the droppable partitions using the script generated in the PART_DIR folder with the name SOA_PARTITION_NAME_RESULT_2.sql.

Note:

There is an issue caused by the existence of foreign key constraints in the Oracle B2B table. When dropping the partition, the B2B partition purge is invoked, the foreign key constraints must be disabled before dropping the partition and enabled afterward. To perform this action, execute the PL/SQL procedures b2b_disable_constraints and b2b_enable_constraints at the appropriate steps in the above procedure. Because foreign keys are enabled and disabled in these procedures, it is not recommended to run them on a live system.

9.4.6 Moving Active, Long Running Instances to a Different Partition

The verification script checks if there are active instances in the partition. When no instances are active, the partition can be dropped. However, you may have active, long running instances present in the partition. These active instances prevent a partition from being dropped. To avoid this problem, you can move long running instances to a different partition.

The Oracle database provides an option for enabling and disabling row movements across partitions. When you create or alter a partitioned table, a row movement clause, either ENABLE ROW MOVEMENT or DISABLE ROW MOVEMENT, can be specified. This clause either enables or disables the movement of a row to a new partition if its key is updated. This option can handle long-running processes that prevent partition drops.

The verify scripts provide a count of total instances, open instances, and the percentage of open instances in a partition. Based on this information, you now have a choice of executing the row movement procedure. This updates the partition keys of the targeted tables, which in turn initiates a row movement of these instances to a different partition. Once all active instances from all partitioned tables have been moved to a different partition, the targeted partition can be dropped.

Notes:

  • Create a separate partition for active, long running transactions. You can then move these instances from the current partition to the new partition by providing the new_partition_date that falls into that partition range. It is recommended that you run a periodical purge on these long-running instances.

  • Row movement involves expensive updates to multiple rows. Only exercise row movement when the number of active processes is small. While the verification script provides a count of active instances, many of the dependent tables have a many-to-one relationship with the master tables. This can become a larger set of rows to move between partitions (if the dependent tables are also partitioned). Use row movement discretely based on the tables partitioned, the active instances in the partition, the data shape, and the available infrastructure setup.

  • Enabling row movement between partitions can significantly degrade runtime performance if the partition key is updated frequently. However, a partition key column is never changed for the Oracle SOA Suite database tables once they are created. Therefore, no row movement at runtime occurs.

To move long running instances to a different partition:

  1. Run the verification script for group 1. This script is described in Section 9.4.4, "Executing the Verification Script."

  2. Check the log scripts to see if there are any active instances preventing the partition drop.

  3. Run the row movement procedure. Based on the logs from step 2, check the count of open instances. Based on this count, decide if the row movement script should be executed or if dropping of partitioning should be postponed.

    1. Log in to SQL*Plus as the SOAINFRA user:

      CONNECT SOAINFRA/password
      
    2. Execute the following PL/SQL procedure to move rows for group 1 tables:

      SQL> PROCEDURE exec_row_movement_1( partition_name in varchar2, 
      new_partition_date in timestamp );
      

      where:

      partition_name is the name of the partition on which to execute row movement.

      new_partition_date is the new date with which to update the partition key column.

  4. Execute the purge script to delete nonpartitioned tables as described in Section 9.3.6, "Executing the Purge Scripts." The purge_partitioned_component parameter of the purge procedures must be set to false.

  5. Drop the group 1 partitions (based on step 3).

  6. Run the verification script for group 2.

  7. Check if there are any active instances holding back the partition drop.

  8. Run the row movement procedure. Based on the logs from step 7, check the count of open instances. Based on this count, decide if the row movement script should be executed or if dropping of partitioning should be postponed.

    1. Return to SQL*Plus as the SOAINFRA user.

      CONNECT SOAINFRA/password
      
    2. Execute the following PL/SQL procedure to move rows for group 2 tables:

      SQL> PROCEDURE exec_row_movement_2( partition_name in varchar2, 
      new_partition_date in timestamp );
      

      where:

      partition_name is the name of the partition on which to execute row movement.

      new_partition_date is the new date with which to update the partition key column.

  9. Drop the group 2 partitions (based on step 8).

9.4.7 Partial Partitioning of Components

If you have an environment in which some components are partitioned, while other components are not partitioned, the nonpartitioned data set must be purged using the purge scripts described in Section 9.3, "Deleting Large Numbers of Instances with the Purge Scripts."

For example, assume human workflow is not partitioned, while other components are partitioned. The verification script reports that all SOA partitions can be dropped using the command for dropping partitions. However, the human workflow tables continue to hold workflow data until the data is purged using the loop/parallel purge scripts.