Professional Documents
Culture Documents
Queries To Check SOA Purging
Queries To Check SOA Purging
GOAL
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.
bitand(state,127)=1 or
bitand(state,16)=16 or
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:
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;
On the month of March exists 224372 potential to be dropped. If we execute the purge scripts for that month in particular
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:
spool '/home/oracle/PurgeLogs/spool.log';
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;
DECLARE
MAX_CREATION_DATE timestamp;
MIN_CREATION_DATE timestamp;
batch_size integer;
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;
set serveroutput on
declare
x number;
begin
for x in
from v$session where status = 'ACTIVE' and rawtohex(sql_address) <> '00' and username is not null
order by last_call_et )
loop
loop
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;
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.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @purgescript-month.sql
Procedure altered.
Pocedure altered.
11 rows selected.
9 rows selected.
Procedure altered.
Procedure altered.
SQL>
sqlplus / as sysdba