Thursday, March 29, 2012

Mediator Re-sequencer Purging

Mediator Re-sequencer purging

Earlier Mediator Re-sequencer tables were not considered for purging from purge scripts. We have included this from 11g Patch-set 5 onwards and did a back-port on the previous patches also

Purge scripts now considered below table while executing loop/parallel purge
1. MEDIATOR_GROUP_STATUS
2. MEDIATOR_RESEQUENCER_MESSAGE

There are couple constraints in executing purge on mediator re-sequencer tables

MEDIATOR_GROUP_STATUS
What can be purged

1. FOR BestEffort and FIFO groups in READY state,
2. We try to purge messages first and then the groups.This facilitate group purging.

What cannot be purged

1. Standard Mode Re-sequencer groups cannot be purged.
2. groups in running state cannot be purged(for all the strategy)


MEDIATOR_RESEQUENCER_MESSAGE.

1. Messages in COMPLETED and ABORTED state only can be purged. Rest all cannot be purged.


what are the different status available under above tables

Group states:

READY = 0; ->Purgeable
LOCKED = 1; ->NON Purgeable
ERROR = 3; ->NON Purgeable
TIMED_OUT=4; ->NON Purgeable
GROUP_ERROR=6; ->NON Purgeable

message states
READY = 0; ->Purgeable
LOCKED = 1; ->NON Purgeable
ERROR = 3; ->NON Purgeable
COMPLETED = 2; ->Purgeable
TIMED_OUT=4; ->Purgeable
ABORTED=5; ->Purgeable


Loop and parallel same scripts can be used from my old blog Executing Parallel Purge script andExecuting Loop Purge scrip

Thursday, February 23, 2012

11g purge scripts growth

History of purge scripts and its portability

1st version of purge scripts came only in PS1 or 11.1.1.2.0 release this had purge based on instance state, composite name, and version


2nd version of purge scripts came only in PS2 or 11.1.1.3.0 release. for the 1st time Full partition concept was introduced


3rd version of purge scripts was available in PS3 or 11.1.1.4.0 release it was know as " purging for Extremely large environments support"
Purge script was changed and made it very simple. partition purge concept was also supported

this script was not compatible to work on older patch sets(PS1 amd ps2) as there was change in the way the scripts works.
So there is backport_scripts which would work fine on PS2 and PS1 was developed


4th version no enhancement were made available in PS4 or 11.1.1.5.0 release.


5th version more enhancement were made available in PS5 or 11.1.1.6.0 release. this includes

Partial Partitioning of Component tables
Purge By Composite DN
Partitioning Strategy for long running processes introducing "Row Movement strategy "
NOTE: there is no backport scripts available for this so far

Wednesday, February 22, 2012

java.sql.SQLException: ORA-01654: unable to extend index DEV3_SOAINFRA.COMPOSITE_INSTANCE_STATE by 8 in tablespace DEV3_SOAINFRA[[

if you are hitting anything like the below issues or similar to the below issues then this may be because of dbf file size issues

Issues:
java.sql.SQLException: ORA-01654: unable to extend index DEV3_SOAINFRA.COMPOSITE_INSTANCE_STATE by 8 in tablespace DEV3_SOAINFRA[[

oracle.toplink.exceptions.DatabaseException[[
Internal Exception: java.sql.BatchUpdateException: ORA-01691: unable to extend lob segment DEV3_SOAINFRA.SYS_LOB0000129222C00018$$ by 8 in tablespace DEV3_SOAINFRA

Solution: to extend datafile/dbf file size by 4gb
ALTER DATABASE DATAFILE ‘db1300/oradata/db1300/DB1300_soainfra.dbf’ RESIZE 4000M;

NOTE: make sure you take a backup of dbf files before executing above alter command

if the file got corrupted then u may have to recreat the file then use bleow command to recreate it

ALTER TABLESPACE DEV3_SOAINFRA ADD DATAFILE ‘db1300/oradata/db1300/DB1300_soainfra.dbf’ SIZE 4000M
AUTOEXTEND ON
NEXT 512K
MAXSIZE 250M;


refernce to some of the good material
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_3002.htm

http://docs.oracle.com/cd/B10500_01/server.920/a96521/tspaces.htm

http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_3.shtml

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.
=================================================================

Tuesday, January 17, 2012

ORA-06512: at "SYS.UTL_FILE", line 536

ssue 4 : obtained when soa_exec_verify.sql is executed
Enter value for 1: 1
old 19: if &1 = 1 then
new 19: if 1 = 1 then
DECLARE
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "DB2813_SOAINFRA.VERIFY_SOA", line 252
ORA-06512: at line 20

Solution:

1. Make sure you have given permissions as specified in Partitioning Concept blog
2. Make sure the directory is created for dumping sql logs

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

Partition cannot be dropped for XML_DOCUMENTS

Issue 3: (Partition drop)
Partition cannot be dropped if there are some b2b records associated with the table.

Solution:
log into soainfra user and run "exec b2b_disable_constraints" command.
then rerun verify script that was generated, you will be able to see all b2b related tables getting altered
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Issue 5 : cannot drop xml_document table partition
SQL> @/tmp/verify/SOA_P03_2012_RESULT_2
SQL> REM Auto generated by the SOA verify script
SQL> REM Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
SQL> REM DESCRIPTION
SQL> REM This script is generated by the SOA verify sctipts. It is used to drop partitions from the SOA Table.
SQL> REM This script should only be run by DBA who is familiar with the SOA Schema.
SQL> REM
SQL> -- COMPONENT: FABRIC
SQL> -- COMPONENT: BPEL
SQL> ALTER TABLE XML_DOCUMENT drop partition P03_2012 UPDATE GLOBAL INDEXES;
ALTER TABLE XML_DOCUMENT drop partition P03_2012 UPDATE GLOBAL INDEXES
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys

Solution:
Reason : XML_DOCUMENT is referred by B2B related tables also and hence the partition cannot be dropped so easily.

solution : Run b2b disable constraints as below then run drop partition command
login as soainfra user and run
$SQL>exec B2B_DISABLE_CONSTRAINTS

to enable B2B constraint after dropping run below command
$SQL> exec B2B_ENABLE_CONSTRAINTS
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
================================================================================
Disclaimer: The views expressed on this blog are solely our own and do not necessarily reflect the views of Oracle.
================================================================================

Error Message = ORA-20001: Jobs still running or not shut down properly

Issue2 :(specific to Parallel Purge)

02-JAN-2012 03:57:10 : jobs running = 2
02-JAN-2012 03:57:10
: ERROR(delete_instances_in_parallel. Error Code = -20001,
Error Message = ORA-20001: Jobs still running or not shut down properly
DECLARE
*
ERROR at line 1:
ORA-20001: Jobs still running or not shut down properly
ORA-06512: at "DB7607_SOAINFRA.SOA", line 661
ORA-06512: at line 11

Solution:
Delete all records from job_flow_control table;
Delete from job_flow_control

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