Thursday, January 26, 2012

Purge bases on Composite Name

Purge bases on Composite Name
There are some scenarios where executing purge scripts for a single composite make sense then executing it on whole of the soainfra schema.
when we execute Purge script based on composite name the instances of the specific composite gets deleted. This can be again be more specific by providing composite versions and partition name.
Below is the script for both loop purge and parallel purge. Basic setup for executing purge based on composite name is same as loop purge or parallel purge(please refer blogs on this blog same names)

parameters used :

composite_name => 'HelowSoaPurge',
composite_revision => '2.0',
soa_partition_name => 'SoaPurge');



=====================================================================
Loop purge

DECLARE

MIN_CREATION_DATE timestamp := TIMESTAMP'2011-09-19 02:00:00';
MAX_CREATION_DATE timestamp := TIMESTAMP'2011-09-20 00:00:00';
batch_size integer;
max_runtime integer;
retention_period timestamp;
BEGIN
max_runtime := 60;
retention_period := to_timestamp('2011-09-20','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 => true,
composite_name => 'HelowSoaPurge',
composite_revision => '2.0',
soa_partition_name => 'SoaPurge');
END;
/

=====================================================================
Parallel Purge

DECLARE

MIN_CREATION_DATE timestamp := TIMESTAMP'2011-09-19 01:00:00';
MAX_CREATION_DATE timestamp := TIMESTAMP'2011-09-20 00:00:00';
batch_size integer;
max_runtime integer;
retention_period timestamp;
BEGIN
max_runtime := 60;
retention_period := to_timestamp('2011-09-21','YYYY-MM-DD');
batch_size := 10000;
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 => true,
composite_name => 'HelowSoaPurge',
composite_revision => '1.0',
soa_partition_name => 'SoaPurge');
END;

/

=================================================================
Disclaimer: The views expressed on this blog are solely our own and do not necessarily reflect the views of Oracle.
=================================================================

7 comments:

  1. Can you tell me which version soa suite have this feature?
    Thanks
    Michael

    ReplyDelete
  2. Hi Michael,
    Below is my description

    11g PS3 -> all feature are available including Purge based on Composite Name
    11g ps4 -> Purge based on Composite Name was not present
    11g PS5 -> Purge based on Composite Name is introduced back

    Thanks

    ReplyDelete
  3. It 's excellent posting and useful for developers
    Oracle SOA Online Course

    ReplyDelete