Showing posts with label bpel. Show all posts
Showing posts with label bpel. Show all posts

Tuesday, October 7, 2014

Accessing raw Audit Trail xml directly from database

Hi Everyone, 

If you need to access the audit trail directly from database then what you have to do is simple. First query the audit_trail table. You'll see several lines for a single cikey. Convert chunks to binary and concatenate all rows for a cikey but do this for each block separately. Finally uncompress it and what you'll get is a raw audit trail xml. You can convert it to table or just search a specific keyword or even you can code your own display engine if you don't like the oracle's em console. 

For me this function is important because for an archived instance I don't have to move the instance to production in order to see the audit trail. 


Function works for both 10g and 11g. I didn't have the chance to test 12c but if audit_trail is still there then I think it will work for 12c as well..

You will need blob_to_clob function. you can get it from here; http://www.dba-oracle.com/t_convert_blob_to_clob_script.htm



create or replace function get_audit_xml(vcikey in number) return clob is
  tmpblob blob;
  vblob blob;
  audit_trail clob:='<audit_trail>';
begin
for b in (select distinct block from audit_trail where block=1 and cikey=vcikey order by 1) 
  loop
  tmpblob:=to_blob('0');
  vblob:=to_blob('0'); 
  for x in (select row_number() over (order by count_id) row_num ,to_blob(log) chunk from audit_trail where cikey=vcikey  and block=b.block)
   loop 
      if(x.row_num=1) then
        tmpblob:= x.chunk;
      else
        dbms_lob.append(dest_lob => tmpblob,src_lob => x.chunk);
      end if;
   end loop;
 utl_compress.lz_uncompress(src => tmpblob, dst => vblob);
audit_trail:=audit_trail||blob_to_clob(vblob);
end loop;
return audit_trail||'</audit_trail>';
end get_audit_xml; 



You can use this function in your posts or website but please give credit to my blog when doing this.

Sunday, August 4, 2013

Running BPEL 10.1.2.0.2 with Java 1.5+


Hi Everybody,

If you are running on Oracle Bpel 10.1.2.0.2 and stuck with java version 1.4 then I have a great news for you!

Previously you may already tried to run bpel with newer versions of java by adding "java-bin" element to opmn.xml;


opmn.xml
<data id="java-bin" value="/home/oracle/java15/bin/java"/>

You were excited and wondering about how bpel will perform with new java version.. oppps! after starting the container you will see this error message;



JDK version not supported.
The JDK version "1_5" is not supported by the OraBPEL domain runtime. Currently only JDK version 1.4 is supported.

13/08/04 16:50:47       at com.collaxa.cube.admin.adaptors.ServerAdaptorFactory.createJDKAdaptor(ServerAdaptorFactory.java:63)
13/08/04 16:50:47       at com.collaxa.cube.admin.adaptors.ServerAdaptorManager.init(ServerAdaptorManager.java:53)
13/08/04 16:50:47       at com.collaxa.cube.admin.ServerManager.__init(ServerManager.java:213)
13/08/04 16:50:47       at com.collaxa.cube.admin.ServerManager.init(ServerManager.java:101)
13/08/04 16:50:47       at com.collaxa.cube.ejb.impl.ServerBean.init(ServerBean.java:200)......


I decompiled the ServerAdaptorFactory class. Then I saw that if I put a java option then I may deceive the bpel .. Yes! it worked :)

1) Put this option to "start-parameters" in opmn.xml and leave the "java-bin" attribute with new version of java.

-Djava.specification.version=1.4


This will make your container to start up with java 1.5+ without any trouble and run your bpel instances successfully but you will not able to deploy new processes (try, you'll get errors). To overcome this new problem you should do one more little thing;

2) Link your new java 1.5+ tools.jar file to $ORACLE_HOME/jdk/lib/tools.jar.. 

Now you can run bpel 10.1.2.0.2 with java 1.5+

We are running bpel 10.1.2.0.2 on sun jdk 1.7.0_25 64bit (with 5GB heap and G1GC) without any problem. Now garbage collection takes tens of milliseconds to complete and we don't experience memory leak anymore (previously we had to restart servers once a week because heap was getting full and garbage collector was taking too much time and still could not empty old generation). With java 1.7, cpu performance is also a big achievement; we are able to process much more instances even with using less cpu resource.




Wednesday, July 31, 2013

oraclesoatricks.blogspot.com

Hello everybody!

I will share some interesting and some life saving tricks in this blog which will be related to oracle bpel and soa suite (mostly administration tricks and some may be development).

First of all I'd like to talk a bit about myself; I'm an expert administrator working at Turkcell for more than 8 years and 6 years had passed with working on Oracle Middleware products. 

Nowadays I'm focused on Oracle SOA suite 11g but we also have legacy systems running bpel 10.1.2 and soa suite 10.1.3.

So; be ready to hear our first trick about "bpel 10.1.2" which will be a real life saving one in a few days..