Professional Documents
Culture Documents
GOAL
Show how to run the purge scripts step by step.
Show also how to monitoring the current purge script execution.
Also include queries to get information before and after running the purge
scripts.
SOLUTION
This note show how to run the purge script step by step and other tips to do
understand the purge scripts execution.
This is the first query executed by the purge scripts to know the ecid
feasible to be delete.
ECID
---------------------------------------------------------------------------------------------------1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-0000000000a29180
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-000000000091348b
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-0000000000a01bb9
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000008eea46
1357a44e35b4c3cd:78cfa31f:13b62df6c03:-8000-0000000000000bee
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000009cdc93
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000008f015f
1357a44e35b4c3cd:-5f256b44:13bb540af47:-8000-000000000000065f
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000008edb01
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-000000000091923b
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000008ebfd7
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-0000000000918485
1357a44e35b4c3cd:78cfa31f:13b62df6c03:-8000-00000000000008f4
1357a44e35b4c3cd:32b103ab:13bb5484207:-8000-00000000008f112a
C. To know the potential rows to be deleted on the cube instance we execute the following:
-------------------------------------5
10
8
5
5
8
9
10
5
10
10
-------224372
2
1
10
28
1
4
58
3632
11
165
On the month of March exists 224372 potential to be dropped. If we execute the purge scripts for that month in particular
-------------------------------------10
5
10
8
5
5
10
-------15
7
3
1
5
17
1
15-03-2013
29-04-2013
09-03-2013
16-04-2013
14-03-2013
23-04-2013
05-03-2013
08-03-2013
04-04-2013
08-04-2013
01-05-2013
21-03-2013
28-04-2013
23-04-2013
04-03-2013
16-04-2013
02-05-2013
22-03-2013
24-04-2013
07-12-2012
04-03-2013
10-04-2013
12-04-2013
17-04-2013
13-03-2013
01-03-2013
06-03-2013
07-03-2013
08-03-2013
15-04-2013
22-04-2013
12-04-2013
10-04-2013
02-05-2013
01-05-2013
25-04-2013
19-11-2012
04-03-2013
11-04-2013
22-04-2013
5
10
10
10
5
10
5
10
5
10
5
5
10
5
8
5
10
10
10
5
5
10
5
10
5
5
5
5
5
10
5
10
5
5
10
10
10
9
10
10
1
1
12
9
7
2
53742
9
6
24
2
11
3
4
1
8
1
21
11
3632
39708
48
7
1
8
8
53542
53752
23564
27
1
1
2
8
10
2
2
4
30
3
We will execute the purge scExecuting the purge scripts for that period
in particular. But before that, let's elaborate this file with the following:
max_runtime integer;
retention_period timestamp;
BEGIN
MIN_CREATION_DATE := to_timestamp('2013-03-01','YYYY-MM-DD');
MAX_CREATION_DATE := to_timestamp('2013-03-31','YYYY-MM-DD');
max_runtime := 60;
retention_period := to_timestamp('2013-05-01','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;
/
select to_char(CREATION_DATE, 'MM-YYYY'), state, count(*) from BD25_SOAINFRA.cube_instance where
state >= 5 group by to_char(CREATION_DATE, 'MM-YYYY'), state order by 1;
spool off;
ALTER PROCEDURE debug_purge COMPILE PLSQL_CCFLAGS = 'debug_on:false' REUSE SETTINGS;
ALTER PROCEDURE log_info COMPILE PLSQL_CCFLAGS = 'debug_on:false' REUSE SETTINGS;
/
column username format a20
column sql_text format a55 word_wrapped
set serveroutput on size 1000000
declare
x number;
begin
for x in
( select username||'('||sid||','||serial#||') ospid = ' || process ||' program = ' || program
username, to_char(LOGON_TIME,' Day HH24:MI') logon_time, to_char(sysdate,' Day HH24:MI')
current_time, sql_address, LAST_CALL_ET
from v$session where status = 'ACTIVE' and rawtohex(sql_address) <> '00' and username is not null
order by last_call_et )
loop
for y in ( select max(decode(piece,0,sql_text,null)) || max(decode(piece,1,sql_text,null)) ||
max(decode(piece,2,sql_text,null)) || max(decode(piece,3,sql_text,null)) sql_text from
v$sqltext_with_newlines where address = x.sql_address and piece < 4)
loop
if ( y.sql_text not like '%listener.get_cmd%' and y.sql_text not like '%RAWTOHEX(SQL_ADDRESS)%')
then
dbms_output.put_line( '--------------------' );
dbms_output.put_line( x.username );
dbms_output.put_line( x.logon_time || ' ' || x.current_time|| ' last et = ' || x.LAST_CALL_ET);
dbms_output.put_line(substr( y.sql_text, 1, 250 ) );
end if;
end loop;
end loop;
end;
/
column username format a15 word_wrapped
column module format a15 word_wrapped
column action format a15 word_wrapped
column client_info format a30 word_wrapped
select username||'('||sid||','||serial#||')' username, module, action, client_info from v$session
where module||action||client_info is not null;
quit;
Executing the previous script you will be able to inspect what is doing the purge scripts as example I got the
following output when I waiting for ending the purge scripts.
---------- ---------8 1
5 224372
8 1
9 4
10 58
5 28
10 165
5 10
10 11
10 2
5 3632
11 rows selected.
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
18:27:52
18:27:52
18:27:52
18:27:52
18:27:52
18:27:52
18:27:52
18:27:52
18:27:52
18:27:53
18:27:53
18:27:53
18:27:53
18:27:53
18:27:53
18:27:53
18:27:53
18:27:54
: procedure delete_instances
: time check
: sysdate = 22/MAY/2013:18/27
: stoptime = 22/MAY/2013:19/27
: checking for partitions
: done checking for partitions
: composite_dn =
: loop count = 1
: deleting non-orphaned instances
Number of rows in table ecid_purge Inserted = 1694
: perform top-level pruning
: total rows before top level pruning = 1694
Number of rows in table prune_running_insts Inserted for open composite instances 0
Number of rows in table prune_running_insts deleted for open composite instances 0
: total rows after top level pruning = 1694
: total rows before pruning 1694
: calling pruneOpenECIDs
Number of rows in table prune_running_insts Inserted (bpel)for open ci 0
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
= 0
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:54
18:27:57
18:35:37
18:35:37
18:35:37
18:37:44
18:38:35
18:50:15
18:50:56
18:50:56
18:50:56
19:02:35
19:15:30
19:17:40
19:18:01
19:22:00
19:22:01
19:22:01
19:25:04
19:25:05
19:25:05
19:25:05
19:25:05
19:25:06
19:25:06
19:25:06
19:25:06
19:25:06
19:25:06
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:07
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
: workflow.delete_workflow_instances begins
: Purging WFTask_TL
Number of rows in table WFTask_TL Purge WFTask_TL0
: Purging WFTaskHistory
Number of rows in table WFTaskHistory Purge WFTaskHistory0
: Purging WFTaskHistory_TL
Number of rows in table WFTaskHistory_TL Purge WFTaskHistory_TL0
: Purging WFComments
Number of rows in table WFComments Purge WFComments0
: Purging WFMessageAttribute
Number of rows in table WFMessageAttribute Purge WFMessageAttribute0
: Purging WFAttachment
Number of rows in table WFAttachment Purge WFAttachment0
: Purging WFAssignee
Number of rows in table WFAssignee Purge WFAssignee0
: Purging WFReviewer
Number of rows in table WFReviewer Purge WFReviewer0
: Purging WFCollectionTarget
Number of rows in table WFCollectionTarget Purge WFCollectionTarget0
: Purging WFRoutingSlip
Number of rows in table WFRoutingSlip Purge WFRoutingSlip0
: Purging WFNotification
Number of rows in table WFNotification Purge WFNotification0
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
22-MAY-2013
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:08
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:25:09
19:27:07
19:50:59
19:54:29
20:27:45
20:27:48
20:27:48
20:27:48
20:27:48
20:41:31
20:43:07
20:43:08
20:43:09
20:43:09
20:43:09
20:43:09
20:43:09
20:43:09
20:43:09
20:46:31
20:46:31
20:46:31
20:46:31
20:46:31
: Purging WFTaskTimer
Number of rows in table WFTaskTimer Purge WFTaskTimer0
: Purging WFTaskError
Number of rows in table WFTaskError Purge WFTaskError0
: Purging WFHeaderProps
Number of rows in table WFHeaderProps Purge WFHeaderProps0
: Purging WFEvidence
Number of rows in table WFEvidence Purge WFEvidence0
: Purging WFTaskAssignmentStatistic
Number of rows in table WFTaskAssignmentStatistic Purge WFTaskAssignmentStatistic0
: Purging WFTaskAggregation
Number of rows in table WFTaskAggregation Purge WFTaskAggregation0
: Purging WFTask
Number of rows in table WFTask Purge WFTask0
: workflow.delete_workflow_instances ends
: workflow.deleteComponentInstance ends
: completed workflow.deleteComponentInstances
: calling mediator.deleteComponentInstances
Number of rows in table temp_mediator_instance Inserted = 12
Number of rows in table mediator_payload purged is : 0
Number of rows in table mediator_deferred_message purged is : 0
Number of rows in table mediator_document purged is : 0
Number of rows in table mediator_case_detail purged is : 0
Number of rows in table mediator_case_instance purged is : 0
Number of rows in table mediator_instance purged is : 0
: completed mediator.deleteComponentInstances
: calling decision.deleteComponentInstances
Number of rows in table temp_brdecision_instance Inserted = 0
Number of rows in table BRDecisionFault purged is : 0
Number of rows in table BRDecisionUnitOfWork purged is : 0
Number of rows in table BRDecisonInstance purged is : 0
: completed decision.deleteComponentInstances
: calling fabric.deleteComponentInstances
Number of rows in table reference_instance_purge inserted = 736122
Number of rows in table xml_document purged is : 736080
Number of rows in table instance_payload purged is : 736139
Number of rows in table reference_instance purged is : 736122
Number of rows in table xml_document purged is : 0
Number of rows in table rejected_msg_native_payload purged is : 0
Number of rows in table instance_payload purged is : 0
Number of rows in table composite_instance_fault purged is : 39
Number of rows in table xml_document purged is : 224407
Number of rows in table instance_payload purged is : 224407
Number of rows in table composite_sensor_value purged is : 0
Number of rows in table composite_instance_assoc purged is : 0
Number of rows in table component_instance_purge inserted = 0
Number of rows in table xml_document purged is : 0
Number of rows in table instance_payload purged is : 0
Number of rows in table component_instance purged is : 0
Number of rows in table attachment purged is : 0
Number of rows in table attachment_ref purged is : 0
Number of rows in table composite_instance purged is : 226023
: completed fabric.deleteComponentInstances
: time check
: sysdate = 22/MAY/2013:20/46
: stoptime = 22/MAY/2013:19/27
03-2013
03-2013
04-2013
04-2013
05-2013
05-2013
11-2012
5 11
9 4
5 28
10 165
5 10
10 11
10 1
12-2012 5 3632
9 rows selected.
Procedure altered.
Procedure altered.
SQL>