Search This Blog

Tuesday, November 19, 2013

How to print the XML data for a variable in BPEL

 

You can use the following java embedded  code 

try { 
  System.out.println("+++++++ Printing XML Variables ++++++++++ (Start) "+getInstanceId());  
    oracle.xml.parser.v2.XMLElement input = (oracle.xml.parser.v2.XMLElement) getVariableData("transactionDataArray");  
  System.out.println(" ++++ qname "+input.getQualifiedName() );  
javax.xml.transform.TransformerFactory tfactory = javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.Transformer xform = tfactory.newTransformer();
javax.xml.transform.dom.DOMSource src = new  javax.xml.transform.dom.DOMSource(input);
java.io.StringWriter writer = new java.io.StringWriter();
javax.xml.transform.Result  result = new javax.xml.transform.stream.StreamResult(writer);
xform.transform(src, result);
System.out.println(writer.toString());
  System.out.println("+++++++ Printing XML Variables ++++++++++ (End) "+getInstanceId());
} catch (Exception e) {  
  System.out.println("exception "+e.getMessage());  
}

This will print the XML string for an variable.

Wednesday, October 23, 2013

Changing the Java Memory Settings for the WebLogic Server Based on Server Name

 


In Unix/Linux

Add these lines to $DOMAIN_HOME/bin/startWeblogic.sh file ,
 
+=+= Start +=+=
if [ "$SERVER_NAME" = "AdminServer"  ]
then
export MEM_ARGS="-Xms512m -Xmx1560m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=64m"
fi

if [ "$SERVER_NAME" = "bam_server1"  ]
then
export MEM_ARGS="-Xms512m -Xmx756m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=64m"
fi

echo "================================ Memory Arguments for " $SERVER_NAME " " $MEM_ARGS

+=+= End  +=+=

Add the above libes after the line ,

. ${DOMAIN_HOME}/bin/setDomainEnv.sh $*

 

In Windows

+=+= Start +=+=
if "%SERVER_NAME%"=="AdminServer" (
set MEM_ARGS=
set MEM_ARGS=-Xms512m -Xmx1586m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=64m
       
    )
   
if "%SERVER_NAME%"=="bam_server1" (
set MEM_ARGS=
set MEM_ARGS=-Xms212m -Xmx556m -XX:PermSize=212m -XX:MaxPermSize=312m -XX:ReservedCodeCacheSize=64m
       
    )
   
echo  ===================== Memory Arguments for  %SERVER_NAME%  %MEM_ARGS%   
+=+= End  +=+=


Add the above libes after the line

call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*

Friday, October 18, 2013

Create SOA related Queues

 

-- Drop and create IP_IN_QUEUE related queue tables , queues etc
begin
dbms_aqadm.stop_queue (queue_name => 'IP_IN_QUEUE');
dbms_aqadm.drop_queue (queue_name => 'IP_IN_QUEUE');
dbms_aqadm.stop_queue (queue_name => 'IP_OUT_QUEUE');
dbms_aqadm.drop_queue (queue_name => 'IP_OUT_QUEUE');
dbms_aqadm.drop_queue_table (queue_table => 'IP_QTAB');
end;
 
BEGIN
   dbms_aqadm.create_queue_table (queue_table => 'IP_QTAB', queue_payload_type =>  'IP_MESSAGE_TYPE', multiple_consumers => TRUE);
   dbms_aqadm.create_queue (queue_name =>  'IP_IN_QUEUE', queue_table =>  'IP_QTAB');
   dbms_aqadm.create_queue (queue_name => 'IP_OUT_QUEUE', queue_table => 'IP_QTAB');
   dbms_aqadm.start_queue(queue_name => 'IP_IN_QUEUE', dequeue => TRUE, enqueue => TRUE);
   dbms_aqadm.start_queue(queue_name =>  'IP_OUT_QUEUE', dequeue => TRUE, enqueue => TRUE);
END;

-- Drop and create  edn_event_queue related related queue tables , queues etc and subscribers

begin
  DBMS_AQADM.stop_queue(queue_name=>'edn_event_queue');
  DBMS_AQADM.drop_queue(queue_name=>'edn_event_queue');
  DBMS_AQADM.drop_queue_table(queue_table=>'edn_event_queue_table');
end;

begin
  DBMS_AQADM.create_queue_table(
    queue_table         => 'edn_event_queue_table',
    queue_payload_type  => 'EDN_EVENT_DATA',
    multiple_consumers  => TRUE);
   
  DBMS_AQADM.create_queue(
    queue_name          => 'edn_event_queue',
    queue_table         => 'edn_event_queue_table');
  DBMS_AQADM.start_queue(queue_name=>'edn_event_queue');
end;

REM  Register Fabric subscriber
declare
  sub sys.aq$_agent;
begin
  sub := sys.aq$_agent('edn_java_subscriber', NULL, NULL);
  DBMS_AQADM.add_subscriber(queue_name=>'edn_event_queue', subscriber=>sub);
end;

REM  Register SQL subscriber
declare
  sub sys.aq$_agent;
begin
  sub := sys.aq$_agent('edn_sql_subscriber', NULL, NULL);
  DBMS_AQADM.add_subscriber(queue_name=>'edn_event_queue', subscriber=>sub);
end;

--  Drop and create  edn_oaoo_queue related related queue tables , queues etc and subscribers

begin
  DBMS_AQADM.stop_queue(queue_name=>'edn_oaoo_queue');
  DBMS_AQADM.drop_queue(queue_name=>'edn_oaoo_queue');
  DBMS_AQADM.drop_queue_table(queue_table=>'edn_oaoo_delivery_table');
end;
/

begin
  DBMS_AQADM.create_queue_table(
    queue_table         => 'edn_oaoo_delivery_table',
    queue_payload_type  => 'edn_oaoo_delivery',
    multiple_consumers  => TRUE);
  DBMS_AQADM.create_queue(
    queue_name          => 'edn_oaoo_queue',
    queue_table         => 'edn_oaoo_delivery_table');
  DBMS_AQADM.start_queue(queue_name=>'edn_oaoo_queue');
end;


declare
  sub sys.aq$_agent;
begin
  sub := sys.aq$_agent('edn_oaoo_subscriber', NULL, NULL);
  DBMS_AQADM.add_subscriber(queue_name=>'edn_oaoo_queue', subscriber=>sub);
end;

Friday, August 16, 2013

Byteman Oracle JDBC Tracing

 

Extract byteman to a directory say , javac -cp lib/byteman.jar HelperSub.java 

First compile the helper class

javac -cp lib/byteman.jar HelperSub.java 

Make a jar file of this helper class

jar cvf HelperSub.jar HelperSub.class

Find the pid of the process 

jps -l
10065 org.apache.derby.drda.NetworkServerControl
14085
19782 weblogic.Server
20846 sun.tools.jps.Jps

Install the byteman agent to running jvm 

bin/bminstall.sh 19782

Load the heloper jar file

bmsubmit.sh -s /home/oracle/byteman-download-2.1.3/HelperSub.jar 

Load the rules

bmsubmit.sh  -l ../OracleJDBCTracing.btm 

run bmsubmit.sh with out any arguments to see whether it got loaded or not

to unload the rules use 

./bmsubmit.sh -u

Rules to trace Oracle JDBC Statements

OracleJDBCTracing.btm
## EXECUTION TIME #############
RULE OracleStatement Code StartTimer
CLASS  oracle.jdbc.driver.OracleStatement
METHOD  doExecuteWithTimeout()
HELPER HelperSub
AT ENTRY
BIND app1 = $0;
m2 = app1.sqlObject.getOriginalSql()
IF true
DO createTimer($0);
ENDRULE
RULE OracleStatement Code Insert AT EXIT StopTimer
CLASS  oracle.jdbc.driver.OracleStatement
METHOD  doExecuteWithTimeout()
HELPER HelperSub
AT EXIT
IF true
DO tracelnplain("Execution Time ("   + Integer.toHexString($0.hashCode()).toUpperCase() + ") : "+ getElapsedTimeFromTimer($0) +" ms");
deleteTimer($0);
ENDRULE
##+  $this.getOriginalSql()
RULE OracleStatement Code Insert
CLASS  oracle.jdbc.driver.OracleStatement
METHOD  doExecuteWithTimeout()
HELPER HelperSub
AT ENTRY
BIND app1 = $0;
m2 = app1.sqlObject.getOriginalSql()
IF true
DO tracelnwithdate(  " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") " +  " SQL : "+ m2  ) ;
ENDRULE
RULE OracleStatement Code Insert AT EXIT
CLASS  oracle.jdbc.driver.OracleStatement
METHOD  doExecuteWithTimeout()
HELPER HelperSub
AT EXIT
IF true
DO tracelnplain("-------------------------------------------------------------------------------- ");
ENDRULE
############# Get the Parameters from OraclePreparedStatement
HELPER HelperSub
RULE OraclePreparedStatement Code Insert setArray
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setArray(int,java.sql.Array)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Array) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setAsciiStream
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setAsciiStream(int,java.io.InputStream)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (AsciiStream) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setAsciiStream 3 params
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setAsciiStream(int,java.io.InputStream,long length)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (AsciiStreamWithLength) P"  + $1 + " ==> " +$2 + " ==> " +$3  )
ENDRULE
RULE OraclePreparedStatement Code Insert setBigDecimal
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setBigDecimal(int,java.math.BigDecimal)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BigDecimal) P"  + $1 + " ==> " +$2  )
ENDRULE
RULE OraclePreparedStatement Code Insert setBoolean
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setBoolean(int,boolean)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (bool) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setByte
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setByte(int,byte)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Byte) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setBytes
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setBytes(int,byte[])
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Bytes) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert      setCharacterStream
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD setCharacterStream(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert      setCharacterStream 3
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD setCharacterStream(int,java.io.Reader,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream-With-length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert      setCharacterStream 3 long
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD setCharacterStream(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream-With-length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setClob
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setClob(int,java.sql.Clob)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Clob) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setClob Reader
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setClob(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Reader) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setClob Reader 3
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setClob(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Reader-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setDate
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setDate(int,java.sql.Date)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Date) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setDate Calendar
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setDate(int,java.sql.Date,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Calendar) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setDouble
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setDouble(int,double)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (double) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setFloat
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setDouble(int,float)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Float) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setInt
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setInt(int,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (int) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setLong
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setLong(int,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (long) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert      setNCharacterStream
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setNCharacterStream(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (NCharacterStream) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setNCharacterStream long
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setNCharacterStream(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (NCharacterStream-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setNClob
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setNClob(int,java.sql.NClob)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (NClo) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setNString
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setNClob(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (NString) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setNull
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setNull(int,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Null) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setObject
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setObject(int,java.lang.Object)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OraclePreparedStatement Code Insert setObject(int,java.lang.Object,int )
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setObject(int,java.lang.Object,int )
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object-SqlType) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setObject(int,java.lang.Object,int,int )
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setObject(int,java.lang.Object,int,int )
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object-SqlType-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3 +" ==> " +$3)
ENDRULE
RULE OraclePreparedStatement Code Insert setRowId
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setRowId(int,java.sql.RowId)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (RowId) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setShort
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setShort(int,short)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Short) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setSQLXML
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setSQLXML(int,java.sql.SQLXML)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (SQLXML) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setString
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setString(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (String) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setTime
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setTime(int,java.sql.Time)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Time) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OraclePreparedStatement Code Insert setTime Calendar
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setTime(int,java.sql.Time,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Time-Calendar) P"  + $1 + " ==> " +$2  + " ==> " +$3 )
ENDRULE
RULE OraclePreparedStatement Code Insert setTimestamp
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setTimestamp(int,java.sql.Timestamp)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Timestamp) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OraclePreparedStatement Code Insert setTimestamp Calendar
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setTimestamp(int,java.sql.Timestamp,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Timestamp-Calendar) P"  + $1 + " ==> " +$2  + " ==> " +$3 )
ENDRULE
RULE OraclePreparedStatement Code Insert setURL
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setURL(int,java.net.URL)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (URL) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OraclePreparedStatement Code Insert setStringForClob
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setStringForClob(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (StringForClob) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OraclePreparedStatement Code Insert setBinaryFloat
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setBinaryFloat(int,oracle.sql.BINARY_FLOAT)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BinaryFloat) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OraclePreparedStatement Code Insert setBinaryDouble
CLASS  oracle.jdbc.driver.OraclePreparedStatement
METHOD  setBinaryDouble(int,oracle.sql.BINARY_DOUBLE)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BinaryDouble) P"  + $1 + " ==> " +$2   )
ENDRULE
############# Get the Parameters from OracleCallableStatement ###########
RULE OracleCallableStatement Code Insert setArray
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setArray(int,java.sql.Array)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Array) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setAsciiStream
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setAsciiStream(int,java.io.InputStream)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (AsciiStream) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setAsciiStream 3 params
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setAsciiStream(int,java.io.InputStream,long length)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (AsciiStreamWithLength) P"  + $1 + " ==> " +$2 + " ==> " +$3  )
ENDRULE
RULE OracleCallableStatement Code Insert setBigDecimal
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setBigDecimal(int,java.math.BigDecimal)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BigDecimal) P"  + $1 + " ==> " +$2  )
ENDRULE
RULE OracleCallableStatement Code Insert setBoolean
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setBoolean(int,boolean)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (bool) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setByte
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setByte(int,byte)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Byte) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setBytes
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setBytes(int,byte[])
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Bytes) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert      setCharacterStream
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD setCharacterStream(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert      setCharacterStream 3
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD setCharacterStream(int,java.io.Reader,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream-With-length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert      setCharacterStream 3 long
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD setCharacterStream(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (CharacterStream-With-length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setClob
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setClob(int,java.sql.Clob)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Clob) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setClob Reader
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setClob(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Reader) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setClob Reader 3
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setClob(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Reader-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setDate
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setDate(int,java.sql.Date)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Date) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setDate Calendar
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setDate(int,java.sql.Date,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Calendar) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setDouble
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setDouble(int,double)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (double) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setFloat
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setDouble(int,float)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Float) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setInt
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setInt(int,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (int) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setLong
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setLong(int,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (long) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert      setNCharacterStream
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setNCharacterStream(int,java.io.Reader)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (NCharacterStream) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setNCharacterStream long
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setNCharacterStream(int,java.io.Reader,long)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (NCharacterStream-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setNClob
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setNClob(int,java.sql.NClob)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (NClo) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setNString
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setNClob(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (NString) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setNull
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setNull(int,int)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Null) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setObject
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setObject(int,java.lang.Object)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object) P"  + $1 + " ==> " +$2)
ENDRULE
RULE OracleCallableStatement Code Insert setObject(int,java.lang.Object,int )
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setObject(int,java.lang.Object,int )
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object-SqlType) P"  + $1 + " ==> " +$2 + " ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setObject(int,java.lang.Object,int,int )
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setObject(int,java.lang.Object,int,int )
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain(" (" + Integer.toHexString(app1.hashCode()).toUpperCase() +") (Object-SqlType-With-Length) P"  + $1 + " ==> " +$2 + " ==> " +$3 +" ==> " +$3)
ENDRULE
RULE OracleCallableStatement Code Insert setRowId
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setRowId(int,java.sql.RowId)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (RowId) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setShort
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setShort(int,short)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Short) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setSQLXML
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setSQLXML(int,java.sql.SQLXML)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (SQLXML) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setString
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setString(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (String) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setTime
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setTime(int,java.sql.Time)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Time) P"  + $1 + " ==> " +$2 )
ENDRULE
RULE OracleCallableStatement Code Insert setTime Calendar
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setTime(int,java.sql.Time,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Time-Calendar) P"  + $1 + " ==> " +$2  + " ==> " +$3 )
ENDRULE
RULE OracleCallableStatement Code Insert setTimestamp
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setTimestamp(int,java.sql.Timestamp)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Timestamp) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OracleCallableStatement Code Insert setTimestamp Calendar
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setTimestamp(int,java.sql.Timestamp,java.util.Calendar)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (Timestamp-Calendar) P"  + $1 + " ==> " +$2  + " ==> " +$3 )
ENDRULE
RULE OracleCallableStatement Code Insert setURL
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setURL(int,java.net.URL)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (URL) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OracleCallableStatement Code Insert setStringForClob
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setStringForClob(int,java.lang.String)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (StringForClob) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OracleCallableStatement Code Insert setBinaryFloat
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setBinaryFloat(int,oracle.sql.BINARY_FLOAT)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BinaryFloat) P"  + $1 + " ==> " +$2   )
ENDRULE
RULE OracleCallableStatement Code Insert setBinaryDouble
CLASS  oracle.jdbc.driver.OracleCallableStatement
METHOD  setBinaryDouble(int,oracle.sql.BINARY_DOUBLE)
AT ENTRY
BIND app1 = $0;
IF true
DO tracelnplain( " (" + Integer.toHexString(app1.hashCode()).toUpperCase() +")  (BinaryDouble) P"  + $1 + " ==> " +$2   )
ENDRULE

HelperSub.java 

==========

import java.io.FileWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.jboss.byteman.rule.Rule;
import org.jboss.byteman.rule.helper.Helper;
public class HelperSub extends Helper
{
  public static PrintWriter  fw = null ;
  public HelperSub(Rule paramRule)
  {
    super(paramRule);
  }
  public static void activated()
    {
        System.out.println("=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ in the activated");
      SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("dd-MMM-yy HH:mm:ss.SSS");
      try {
        fw = new PrintWriter("jdbclogs.txt");
      fw.println(" JDBC Logs  on " +localSimpleDateFormat.format(new Date()) +"\n");
      }
      catch (Exception e1) {
        e1.printStackTrace();
      }
    }
    public static void deactivated()
    {
        System.out.println("=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ in the  deactivated");
      try {
       fw.close();
      }
      catch (Exception e1) {
        e1.printStackTrace();
      }
    }
  public boolean tracelnwithdate(String paramString)
  {
    SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("dd-MMM-yy HH:mm:ss.SSS");
  // System.out.println(localSimpleDateFormat.format(new Date()) + paramString);
  try {
    fw.println(localSimpleDateFormat.format(new Date()) + paramString );
    fw.flush();
  }
  catch (Exception e1) {
    e1.printStackTrace();
  }
    return true;
  }
  public boolean tracelnplain(String paramString)
  {
    try {
      fw.println( paramString );
      fw.flush();
    }
    catch (Exception e1) {
      e1.printStackTrace();
    }
    return true;
  }
}

Monday, August 12, 2013

Coherence Logging in SOA

 

C:\temp\tangosol_coherence_override_1.xml

<coherence>
<cluster-config>
<unicast-listener>
<address system-property="tangosol.coherence.localhost">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.localport">8088</port>
<port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust>
<well-known-addresses>
<socket-address id="1">
<address system-property="tangosol.coherence.wka1">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka1.port">8088</port>
</socket-address>
<socket-address id="2">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8089</port>
</socket-address>
<socket-address id="3">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8090</port>
</socket-address>
<socket-address id="4">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8091</port>
</socket-address>
</well-known-addresses>
</unicast-listener>
</cluster-config>
</coherence>

C:\temp\tangosol_coherence_override_2.xml

<coherence>
<cluster-config>
<unicast-listener>
<address system-property="tangosol.coherence.localhost">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.localport">8089</port>
<port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust>
<well-known-addresses>
<socket-address id="1">
<address system-property="tangosol.coherence.wka1">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka1.port">8088</port>
</socket-address>
<socket-address id="2">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8089</port>
</socket-address>
<socket-address id="3">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8090</port>
</socket-address>
<socket-address id="4">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8091</port>
</socket-address>
</well-known-addresses>
</unicast-listener>
</cluster-config>
</coherence>

C:\temp\tangosol_coherence_override_3.xml

<coherence>
<cluster-config>
<unicast-listener>
<address system-property="tangosol.coherence.localhost">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.localport">8090</port>
<port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust>
<well-known-addresses>
<socket-address id="1">
<address system-property="tangosol.coherence.wka1">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka1.port">8088</port>
</socket-address>
<socket-address id="2">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8089</port>
</socket-address>
<socket-address id="3">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8090</port>
</socket-address>
<socket-address id="4">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8091</port>
</socket-address>
</well-known-addresses>
</unicast-listener>
</cluster-config>
</coherence>

C:\temp\tangosol_coherence_override_4.xml

<coherence>
<cluster-config>
<unicast-listener>
<address system-property="tangosol.coherence.localhost">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.localport">8091</port>
<port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust>
<well-known-addresses>
<socket-address id="1">
<address system-property="tangosol.coherence.wka1">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka1.port">8088</port>
</socket-address>
<socket-address id="2">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8089</port>
</socket-address>
<socket-address id="3">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8090</port>
</socket-address>
<socket-address id="4">
<address system-property="tangosol.coherence.wka2">xx.xx.xx.xx</address>
<port system-property="tangosol.coherence.wka2.port">8091</port>
</socket-address>
</well-known-addresses>
</unicast-listener>
</cluster-config>
</coherence>

Start the Coherence Cache on all the four servers using ,

java -cp coherence.jar -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.session.localstorage=true -Dtangosol.coherence.override=c:\temp\tangosol_coherence_override_1.xml com.tangosol.net.DefaultCacheServer
 
java -cp coherence.jar -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.session.localstorage=true -Dtangosol.coherence.override=c:\temp\tangosol_coherence_override_2.xml com.tangosol.net.DefaultCacheServer

java -cp coherence.jar -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.session.localstorage=true -Dtangosol.coherence.override=c:\temp\tangosol_coherence_override_3.xml com.tangosol.net.DefaultCacheServer
 
java -cp coherence.jar -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.session.localstorage=true -Dtangosol.coherence.override=c:\temp\tangosol_coherence_override_4.xml com.tangosol.net.DefaultCacheServer

For Coherence logging ,

Remove the entries , (especially ,  -Dtangosol.coherence.log=jdk)

-Dtangosol.coherence.clusteraddress=xx.x.x.x -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk
And set the following options , -Dtangosol.coherence.log.level=9 -Dtangosol.coherence.log=/tmp/coherence.log

export JAVA_OPTIONS="-Dtangosol.coherence.log.level=9 -Dtangosol.coherence.log=/tmp/coherence.log"

and start the SOA Server , you will find entries like this ,


WellKnownAddressList(Size=2,
  WKA{Address=xx.xx.x.x, Port=8088}
  WKA{Address=xx.x.x.x.x, Port=8088}
  )

For the ODL logging set the Coherence=TRACE:32 and also log level , oracle.integration.platform = TRACE:32
you will find entries like ,
[2013-08-12T15:35:00.316+05:30] [soa_server2] [NOTIFICATION] [] [Coherence] [tid: Logger@9750876 3.7.1.1] [userId: <anonymous>] [ecid: 0000K1lyeYmESOJpMkS4ye1I2BBN000002,0] [APP: soa-infra] 2013-08-12 15:34:58.482/125.893 Oracle Coherence 3.7.1.1 <Info> (thread=[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/fmw11g/fmw1116/Middleware/oracle_common/modules/oracle.coherence/coherence.jar!/tangosol-coherence.xml"

Monday, July 22, 2013

Auditing SOA Server DML Usage (Insert/Update/Delete operations)

 

1. alter system set audit_trail=db,extended scope=spfile;

2. restart the database

3. Login as scott/tiger
audit update , insert, delete on dept;

4. select * from DBA_OBJ_AUDIT_OPTS;
SQL> select * from DBA_OBJ_AUDIT_OPTS;
OWNER                          OBJECT_NAME
------------------------------ ------------------------------
OBJECT_TYPE             ALT       AUD       COM       DEL       GRA
----------------------- --------- --------- --------- --------- ---------
IND       INS       LOC       REN       SEL       UPD       REF EXE
--------- --------- --------- --------- --------- --------- --- ---------
CRE       REA       WRI       FBK
--------- --------- --------- ---------
SCOTT                          DEPT
TABLE                   -/-       -/-       -/-       S/S       -/-
-/-       S/S       -/-       -/-       -/-       S/S       -/- -/-
-/-       -/-       -/-       -/-

5. Now run some sql ,
insert into dept values(60,'SUPPORT1','BANGALORE1')

6. Run the following sql , to check the sql ,
select ntimestamp# , sqltext , sqlbind  from sys.aud$ order by ntimestamp# desc ;

7. To remove the audit , login as scott/tiger user ,
noaudit update , insert, delete on dept;

8.  select * from DBA_OBJ_AUDIT_OPTS;
To capture the sql for a schema ,

1. Login as sys or system user and run the following sql
AUDIT update table , insert table , delete table ,  EXECUTE PROCEDURE by dev1117_soainfra;

2. select * from DBA_STMT_AUDIT_OPTS where user_name = 'DEV1117_SOAINFRA'

USER_NAME                      PROXY_NAME
------------------------------ ------------------------------
AUDIT_OPTION                             SUCCESS    FAILURE
---------------------------------------- ---------- ----------
DEV1117_SOAINFRA
EXECUTE PROCEDURE                        BY SESSION BY SESSION
DEV1117_SOAINFRA
DELETE TABLE                             BY SESSION BY SESSION
DEV1117_SOAINFRA
UPDATE TABLE                             BY SESSION BY SESSION
DEV1117_SOAINFRA
INSERT TABLE                             BY SESSION BY SESSION

3. Now run sql server and you will see all the dml statemnets captured
select ntimestamp# , sqltext , sqlbind  from sys.aud$ order by ntimestamp# desc ;

4. To remove the auditing run ,
NOAUDIT update table , insert table , delete table ,  EXECUTE PROCEDURE by dev1117_soainfra;

Restart the SOA Server so that the audit logs are disabled.


http://stackoverflow.com/questions/13100054/oracle-database-audit-doesnt-show-sql-text-and-bind-values

Wednesday, July 17, 2013

SOA with SqlServer Express 2008

 

 

1. Stop SQL Server's process on the machine.


2. Copy the file x64sqljdbc.dll (64 bit windows) or sqljdbc.dll (32 bit windows)  from
C:\Oracle\Middleware5\wlserver_10.3\server\lib
to
C:\Program Files\Database\MicrosoftSQLServer\MSSQL10_50.MSSQLSERVER\MSSQL\Binn


3. Copy the file C:\Program
Files\Database\MicrosoftSQLServer\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\x64sqljdbc.dll as sqljdbc.dll in the same directory (Only on 64 bit windows)


4. Run the file instjdbc.sql (C:\Oracle\Middleware5\wlserver_10.3\server\lib)
from the Sql Server Management console , here I commented the line
"dump tran master with no_log" as it was not executing , and ensured the
objects are created in the master db.

If you are getting the errors like this ,

XA transactions are disabled by default on Windows Server 2003. Microsoft? Windows Server 2003, Microsoft Distributed
Transaction Coordinator (MS DTC) requires the creation of registry values for all XA DLLs that you plan to use.

Solution (Reference : https://forums.oracle.com/thread/793763)

Connect JDBC Drivers have the XA DLL sqljdbc.dll that is normally installed on SQLServer_Install_Root\MSSQL\Binn.
For example: c:\Program Files\Microsoft SQL Server\MSSQL\Binn) The registry values required for XA transactions are not created automatically. You must create the values manually as follows:
Turn on support for XA transactions:
Open Component Services.
Expand the tree view to locate the computer where you want to turn on support for XA transactions; for example, My Computer.
Right-click the computer name, then click Properties.
Click the MSDTC tab, then click Security Configuration.
Under Security Settings, click the check box for XA Transactions to turn on this support.
Click OK, then click OK again.
Create a registry named-value:
Use Registry Editor and navigate to registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL
Create a new registry named-value:
Name is the file name of the XA DLL (in the format dllname.dll)
Type is String (REG_SZ)
Value is the full path name (including the file name) of the DLL file
Name Type Value
sqljdbc.dll String (REG_SZ) c:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqljdbc.dll

Note: You must create an entry for each XA DLL file that you plan to use. Also, if you are configuring MS DTC on a cluster, you must create these registry entries on each node in the cluster.
For more details, see the following Microsoft document:


5. Restarted the sql server machine

6. Created a new db from the Sql Server Management console with the name as  "soadb"

7. Ran the following sql from the Sql Server Management console (in this
order only)
ALTER DATABASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
ALTER database soadb COLLATE SQL_Latin1_General_CP1_CS_AS
go
ALTER database soadb SET READ_COMMITTED_SNAPSHOT ON
go
ALTER DATABASE SOADB SET MULTI_USER;
go

8. After this ran the rcu and created the necessary schema's

9. Ran the config wizard and created a new doamin with the name
"soa_admin_domain" and
selected "soa 11g development" option so that every thing can be installed on the Admin Server.

Saturday, May 18, 2013

Upgrading Oracle VM 3.0.2 to Latest Version

 

Create a file "public-yum-el5.repo" in the directory /etc/yum.repos.d

[vm3_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleVM/OVM3/latest/x86_64/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

and run “yum update”

This will upgrade Oracle VM to latest version

Friday, March 22, 2013

How to test DB Partitioning Purging feature in SOA 11g

 

This procedure should help you quickly setup DB partitioning SOA 11g , 
Refer to the URL's given below for more information on this.
http://docs.oracle.com/cd/E29505_01/admin.1111/e10226/soaadmin_partition.htm#CJHFJDII
http://www.oracle.com/technetwork/middleware/bpm/learnmore/soa11gstrategy-1508335.pdf


Step#1
First two create two table spaces so that data based on the date can go in to different partitions.

CREATE TABLESPACE soa_ts_before_2013_march
DATAFILE '/fmw11g/db/oradata/db1123/soa_ts_before_2013_march.dbf'
SIZE 1G
REUSE
AUTOEXTEND ON
NEXT 128M
BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO;


CREATE TABLESPACE soa_ts_after_2013_march
DATAFILE '/fmw11g/db/oradata/db1123/soa_ts_after_2013_march.dbf'
SIZE 1G
REUSE
AUTOEXTEND ON
NEXT 128M
BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO;


GRANT UNLIMITED TABLESPACE TO DEV1116_SOAINFRA;

Step #2
You have to modify the table creation scripts so that it contains partitioning information ,

This is the sample table creation script with partions , as you may have existing data , this data needs to be copied to
a temporary table and the main table has to be recreated with the partitioning information , after the table
is created you may to have to enable ENABLE ROW MOVEMENT to move the rows across partitions
CREATE TABLE WFTASK_t PARTITION BY RANGE (COMPOSITECREATEDTIME) (
PARTITION PART1_BEFORE_2013_MARCH VALUES LESS THAN ('31-MAR-13 12.00.00.000000 AM')
TABLESPACE soa_ts_before_2013_march,
PARTITION PART1_AFTER_2013_MARCH VALUES LESS THAN ('01-MAR-15 12.00.00.000000 AM')
TABLESPACE soa_ts_after_2013_march
)
NOLOGGING
AS
SELECT * FROM WFTASK;

RENAME WFTASK TO WFTASK_d;

RENAME WFTASK_t TO WFTASK;

DROP TABLE WFTASK_d cascade CONSTRAINTS;

alter table WFTASK ENABLE ROW MOVEMENT;


These are the tables that needs to be partitioned for SOA Infrastructure , BPEL , Mediator , Human Workflow
for the group related information on these tables , please refer to the URL ,
http://docs.oracle.com/cd/E29505_01/admin.1111/e10226/soaadmin_partition.htm#CJHFJDII

SOA Infrastructure
---------------------

COMPOSITE_INSTANCE,PARTITION_DATE
REFERENCE_INSTANCE,CPST_PARTITION_DATE
COMPOSITE_INSTANCE_FAULT,CPST_PARTITION_DATE
COMPOSITE_SENSOR_VALUE,CPST_PARTITION_DATE
COMPONENT_INSTANCE,CPST_PARTITION_DATE
REJECTED_MESSAGE,CREATED_TIME
REJECTED_MSG_NATIVE_PAYLOAD,RM_PARTITION_DATE
INSTANCE_PAYLOAD,CREATED_TIME
COMPOSITE_INSTANCE_ASSOC,CREATED_TIME

BPEL Tables
--------------

CUBE_INSTANCE,CPST_INST_CREATED_TIME
CI_INDEXES,CI_PARTITION_DATE
CUBE_SCOPE,CI_PARTITION_DATE
DOCUMENT_CI_REF,CI_PARTITION_DATE
AUDIT_TRAIL,CI_PARTITION_DATE
AUDIT_DETAILS,CI_PARTITION_DATE
DLV_SUBSCRIPTION,CI_PARTITION_DATE
WORK_ITEM,CI_PARTITION_DATE
AUDIT_COUNTER,CI_PARTITION_DATE
WI_FAULT,CI_PARTITION_DATE
DLV_MESSAGE,RECEIVE_DATE
HEADERS_PROPERTIES,DLV_PARTITION_DATE
DOCUMENT_DLV_MSG_REF,DLV_PARTITION_DATE
XML_DOCUMENT,DOC_PARTITION_DATE

Mediator Table
-----------------

MEDIATOR_INSTANCE,COMPOSITE_CREATION_DATE
MEDIATOR_CASE_INSTANCE,MI_PARTITION_DATE
MEDIATOR_CASE_DETAIL,MI_PARTITION_DATE
MEDIATOR_AUDIT_DOCUMENT,MI_PARTITION_DATE
MEDIATOR_DEFERRED_MESSAGE,CREATION_DATE
MEDIATOR_PAYLOAD,CREATION_TIME

Human Workflow
--------------------

WFTASK,COMPOSITECREATEDTIME
WFTASK_TL,COMPOSITECREATEDTIME
WFTASKHISTORY,COMPOSITECREATEDTIME
WFTASKHISTORY_TL,COMPOSITECREATEDTIME
WFCOMMENTS,COMPOSITECREATEDTIME
WFMESSAGEATTRIBUTE,COMPOSITECREATEDTIME
WFATTACHMENT,COMPOSITECREATEDTIME
WFASSIGNEE,COMPOSITECREATEDTIME
WFREVIEWER,COMPOSITECREATEDTIME
WFCOLLECTIONTARGET,COMPOSITECREATEDTIME
WFROUTINGSLIP,COMPOSITECREATEDTIME
WFNOTIFICATION,COMPOSITECREATEDTIME
WFTASKTIMER,COMPOSITECREATEDTIME
WFTASKERROR,COMPOSITECREATEDTIME
WFHEADERPROPS,COMPOSITECREATEDTIME
WFEVIDENCE,COMPOSITECREATEDTIME
WFTASKASSIGNMENTSTATISTIC,COMPOSITECREATEDTIME
WFTASKAGGREGATION,COMPOSITECREATEDTIME


I created a simple java program to create the sql that can be used to recreate the tables.
Use this java program to generate the table scripts ,



public class GeneratePartionTable {
public GeneratePartionTable() {
super();
}

public static void main(String[] args) {
GeneratePartionTable generatePartionTable = new GeneratePartionTable();
String p2 = "COMPOSITE_INSTANCE,PARTITION_DATE\n" +
"REFERENCE_INSTANCE,CPST_PARTITION_DATE\n" +
"COMPOSITE_INSTANCE_FAULT,CPST_PARTITION_DATE\n" +
"COMPOSITE_SENSOR_VALUE,CPST_PARTITION_DATE\n" +
"COMPONENT_INSTANCE,CPST_PARTITION_DATE\n" +
"REJECTED_MESSAGE,CREATED_TIME\n" +
"REJECTED_MSG_NATIVE_PAYLOAD,RM_PARTITION_DATE\n" +
"INSTANCE_PAYLOAD,CREATED_TIME\n" +
"COMPOSITE_INSTANCE_ASSOC,CREATED_TIME\n" +
"CUBE_INSTANCE,CPST_INST_CREATED_TIME\n" +
"CI_INDEXES,CI_PARTITION_DATE\n" +
"CUBE_SCOPE,CI_PARTITION_DATE\n" +
"DOCUMENT_CI_REF,CI_PARTITION_DATE\n" +
"AUDIT_TRAIL,CI_PARTITION_DATE\n" +
"AUDIT_DETAILS,CI_PARTITION_DATE\n" +
"DLV_SUBSCRIPTION,CI_PARTITION_DATE\n" +
"WORK_ITEM,CI_PARTITION_DATE\n" +
"AUDIT_COUNTER,CI_PARTITION_DATE\n" +
"WI_FAULT,CI_PARTITION_DATE\n" +
"DLV_MESSAGE,RECEIVE_DATE\n" +
"HEADERS_PROPERTIES,DLV_PARTITION_DATE\n" +
"DOCUMENT_DLV_MSG_REF,DLV_PARTITION_DATE\n" +
"XML_DOCUMENT,DOC_PARTITION_DATE\n" +
"MEDIATOR_INSTANCE,COMPOSITE_CREATION_DATE\n" +
"MEDIATOR_CASE_INSTANCE,MI_PARTITION_DATE\n" +
"MEDIATOR_CASE_DETAIL,MI_PARTITION_DATE\n" +
"MEDIATOR_AUDIT_DOCUMENT,MI_PARTITION_DATE\n" +
"MEDIATOR_DEFERRED_MESSAGE,CREATION_DATE\n" +
"MEDIATOR_PAYLOAD,CREATION_TIME\n" +
"WFTASK,COMPOSITECREATEDTIME\n" +
"WFTASK_TL,COMPOSITECREATEDTIME\n" +
"WFTASKHISTORY,COMPOSITECREATEDTIME\n" +
"WFTASKHISTORY_TL,COMPOSITECREATEDTIME\n" +
"WFCOMMENTS,COMPOSITECREATEDTIME\n" +
"WFMESSAGEATTRIBUTE,COMPOSITECREATEDTIME\n" +
"WFATTACHMENT,COMPOSITECREATEDTIME\n" +
"WFASSIGNEE,COMPOSITECREATEDTIME\n" +
"WFREVIEWER,COMPOSITECREATEDTIME\n" +
"WFCOLLECTIONTARGET,COMPOSITECREATEDTIME\n" +
"WFROUTINGSLIP,COMPOSITECREATEDTIME\n" +
"WFNOTIFICATION,COMPOSITECREATEDTIME\n" +
"WFTASKTIMER,COMPOSITECREATEDTIME\n" +
"WFTASKERROR,COMPOSITECREATEDTIME\n" +
"WFHEADERPROPS,COMPOSITECREATEDTIME\n" +
"WFEVIDENCE,COMPOSITECREATEDTIME\n" +
"WFTASKASSIGNMENTSTATISTIC,COMPOSITECREATEDTIME\n" +
"WFTASKAGGREGATION,COMPOSITECREATEDTIME";

String[] lines = p2.split("\n");
for (int i = 0 ; i < lines.length ; i++ ) {
String p1 = "CREATE TABLE --tablename--_t PARTITION BY RANGE (--key--) (\n" +
" PARTITION PART1_BEFORE_2013_MARCH VALUES LESS THAN ('01-MAR-13 12.00.00.000000 AM') \n" +
"TABLESPACE soa_ts_before_2013_march,\n" +
" PARTITION PART1_AFTER_2013_MARCH VALUES LESS THAN ('01-MAR-15 12.00.00.000000 AM') \n" +
"TABLESPACE soa_ts_after_2013_march \n" +
")\n" +
"NOLOGGING\n" +
"AS\n" +
"SELECT * FROM --tablename--;\n" +
"\n" +
"RENAME --tablename-- TO --tablename--_d;\n" +
"\n" +
"RENAME --tablename--_t TO --tablename--;\n" +
"\n" +
"DROP TABLE --tablename--_d cascade CONSTRAINTS;\n" +
"\n" +
"alter table --tablename-- ENABLE ROW MOVEMENT;";
String[] lines2 = lines[i].split(",");

p1= p1.replaceAll("--tablename--", lines2[0]);
p1 = p1.replaceAll("--key--", lines2[1]) ;

System.out.println(p1);
System.out.println();
}

}
}

Get the o/p of this to a text file and run this sql file as the user
DEV1116_SOAINFRA ,

Step#3
Run some composites , like a simple helloworld , a simple workflow application etc (wanted to keep this composite in the running state), 
Run the soa_exec_verify.sql to verify the partionins

You have to modify the soa_exec_verify.sql script , 
with the partition name , i.e.
mySoa_drv_list(1) := 'PART1_BEFORE_2013_MARCH';

CREATE DIRECTORY PART_DIR AS '/tmp/verify'

grant read,write on directory PART_DIR to public;

Run the script ,

sqlplus dev1116_soainfra/Welcome1 @soa_exec_verify.sql

If you are running the script , you may get an error like this ,

ORA-20000: ERROR :TEMP TABLES NOT EMPTY. PLEASE TRUNCATE TEMP TABLES AFTER EXECUTING ROW MOVEMENT PROCEDURES(IF APPLICABLE)
ORA-06512: in "PROD_SOAINFRA.VERIFY_SOA", line 244

Please run the pl/sql code below to remove the temporary tables ,

DECLARE
BEGIN
verify_soa.trunc_verify1_temp_tables;
END;

/

DECLARE
BEGIN
verify_soa.trunc_verify2_temp_tables;
END;

/

Open the file /temp/verify/SOA_PART1_BEFORE_2013_MARCH_LOG_1 and look for the string "FAIL"
if you see ant FAIL word that means there are some running instances which you need to move to
another parition.

Moving Active, Long Running Instances to a Different Partition

Immediately after running the soa_exec_verify.sql run the exec_row_movement_1 movement scripts to move the running instances to
another parition ,

declare
new_partition_date timestamp;
partition_name varchar2(100);
BEGIN
new_partition_date := to_timestamp('2013-04-09','YYYY-MM-DD');
partition_name := 'PART1_BEFORE_2013_MARCH' ;
verify_soa.exec_row_movement_1(partition_name => partition_name,
new_partition_date => new_partition_date);
commit;
END;

Please note that you should always run the exec_row_movement_1 scripts immediately after running the soa_exec_verify.sql
scripts.exec_row_movement_1 scripts uses the temporary tables created by soa_exec_verify.sql scripts.

Simlarly run the script soa_exec_verify.sql with the input as 2 to run against Group 2 tables ,
and run the exec_row_movement_2 procedure to move the rows of group2 to another partition.

declare
new_partition_date timestamp;
partition_name varchar2(100);
BEGIN
new_partition_date := to_timestamp('2013-04-09','YYYY-MM-DD');
partition_name := 'PART1_BEFORE_2013_MARCH' ;
verify_soa.exec_row_movement_2(partition_name => partition_name,
new_partition_date => new_partition_date);
END;