Search This Blog

Sunday, July 06, 2014

SOA 12c Install error Insufficient free space

 

While trying to install getting an error

 

java -jar fmw_12.1.3.0.0_soa_quickstart.jar
Launcher log file is /tmp/OraInstall2014-07-07_11-50-41AM/launcher2014-07-07_11-50-41AM.log.
Insufficient free space in /tmp/orcl965540478413729726.tmp to extract the installer.  Actual 153 MB.  Required 3053 MB.

As I do not have sufficent space in /tmp directory used the following workaround.

Create a directory /fmw11g/tmp

export _JAVA_OPTIONS="-Djava.io.tmpdir=/fmw11g/tmp"

Now when you start the installer you see the o/p as

java -jar fmw_12.1.3.0.0_soa_quickstart.jar
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/fmw11g/tmp
Launcher log file is /fmw11g/tmp/OraInstall2014-07-07_11-56-55AM/launcher2014-07-07_11-56-55AM.log.

Monday, January 13, 2014

Opatch fails with the error java.lang.UnsatisfiedLinkError: Can't load library ../oui/lib/linux/liboraInstaller.so

 

OPatch giving an error on 64 bit linux with 64 bit JDK
java.lang.UnsatisfiedLinkError: Can't load library: /fmw11g/fmw1116/Middleware/oracle_common/oui/lib/linux/liboraInstaller.so
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1706)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1004)
        at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:402)
        at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:126)
        at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.ssgetUidux(OiipgEnvironment.java:528)
        at oracle.sysman.oii.oiix.OiixEnvironmentOps.ssgetUidux(OiixEnvironmentOps.java:159)
        at oracle.opatch.OUIReplacer.isRootAccess(OUIReplacer.java:741)
        at oracle.opatch.OPatch.main(OPatch.java:513)
Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: no oraInstaller in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1029)
        at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.loadNativeLib(OiipuUnixOps.java:420)
        at oracle.sysman.oii.oiip.osd.unix.OiipuUnixOps.<clinit>(OiipuUnixOps.java:126)
        at oracle.sysman.oii.oiip.oiipg.OiipgEnvironment.ssgetUidux(OiipgEnvironment.java:528)
        at oracle.sysman.oii.oiix.OiixEnvironmentOps.ssgetUidux(OiixEnvironmentOps.java:159)
        at oracle.opatch.OUIReplacer.isRootAccess(OUIReplacer.java:741)
        at oracle.opatch.OPatch.main(OPatch.java:513)
Modify the file
/fmw11g/fmw1116/Middleware/wlserver_10.3/common/bin/commEnv.sh
and Change the
SUN_ARCH_DATA_MODEL="64"
JAVA_USE_64BIT=true
JAVA_HOME variable to /home/oracle/jdk1.6.0_45_64  and
JAVA_VENDOR variable to Sun.
for example ,
# Setup SUN_ARCH_DATA_MODEL
SUN_ARCH_DATA_MODEL="64"
#JAVA_USE_64BIT, true if JVM uses 64 bit operations
JAVA_USE_64BIT=true
# Reset JAVA_HOME, JAVA_VENDOR and PRODUCTION_MODE unless JAVA_HOME
# and JAVA_VENDOR are pre-defined.
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
  # Set up JAVA HOME
  JAVA_HOME="/home/oracle/jdk1.6.0_45_64"
  # Set up JAVA VENDOR, possible values are
  #Oracle, HP, IBM, Sun ...
  JAVA_VENDOR=Sun
  # PRODUCTION_MODE, default to the development mode
  PRODUCTION_MODE=""
fi

https://blogs.oracle.com/fmwinstallproactive/entry/which_jdk_is_my_fmw

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;

  

Friday, October 05, 2012

How to Capture offending sql of ORA-00001 error

 

Using sql*plus run the sql
 
alter system set events='0001 trace name errorstack level 12';

Now login to other session and run the command ,

SQL> oradebug setmypid
Statement processed.
SQL> oradebug eventdump system
1 trace name ERRORSTACK level 12 >>>> This indicates event is present in the DB

Please also check the folloine note , to check for the events in the db
How To List All The Named Events Set For A Database (Doc ID 436036.1)

Simulate the error of ORA-00001 ,

create table a1(a number primary key);
insert into a1 values (1);
commit;


SQL> insert into a1 values (1);
insert into a1 values (1)
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C0079247) violated

SQL> show parameters user_dump_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      /home/ias/oracle/product/10.2.0/db10gr2/admin/db10gr2/udump

In the latest file you will find the entries as ,

*** 2012-10-05 14:00:11.038
ksedmp: internal or fatal error
ORA-00001: unique constraint (SCOTT.SYS_C0079247) violated
Current SQL statement for this session:
insert into a1 values (1)
----- Call Stack Trace -----

Turn off the debug logs ,
SQL> alter system set events='1 trace name errorstack off';

To confirm whether the event is off or not run the following ,

SQL> oradebug setmypid
Statement processed.
SQL> oradebug eventdump system

Statement processed.

Monday, September 24, 2012

Using DocFetcher tool as local search engine

 

http://docfetcher.sourceforge.net/en/index.html

DocFetcher is an open source desktop search application that runs on Microsoft Windows, Mac OS X and Linux.
It is written in Java and has a Standard Widget Toolkit based graphical user interface.

DocFetcher's indexing and searching facilities are based on Apache Lucene, a widely used open source search engine.
Contents

    1 Features
    2 Portability
    3 Pairing of HTML files
    4 See also
    5 External links

Features

    Supports all major document formats, including PDF, HTML, Microsoft Office and OpenOffice.org
    Supported archive formats: zip, 7z, rar, tar.*
    Can search in Outlook emails (PST files)
    Can be customized to index any kind of source code file
    Automatically updates its indexes whenever files are modified
    Exclusion of files from indexing based on regular expressions

Portability

DocFetcher is available as a portable version, which allows the user to bundle DocFetcher and his or her personal files in order to create a portable and searchable "document repository". Portable means the user may for instance carry around this repository on a USB drive, or a synchronize it over multiple computers via a file synchronization service. Also, due to the fact that DocFetcher is Java-based, this repository can be accessed from different platforms, e.g. from Windows as well as from Linux.
Pairing of HTML files

How to use DocFetcher tool to Index your book mark pages and other online pages that of interest to you

You can use the ScrapBook (Firefox plugin) for this purpose.
https://addons.mozilla.org/en-US/firefox/addon/scrapbook/

ScrapBook is a Firefox plugins that allows you to save web pages and manage your collection of saved pages.
DocFetcher can be used for full-text search in your ScrapBook collection.

Store all the scrapbook collection to some directory and add this directory to the DocFether tool for indexing.

SOA 11g NTLM Setup

This article explains how to configure NTLM protected web Service from the SOA 11g , 

This contains all the steps required to configure a Active Directory , DNS Server and NTLM based Web Service and integrating with SOA 11g etc.

As the setup needs lot of manual setup's I documented all the important steps so that you will not be wasting much time like I did in this case ,

Important points :-
Create a AD Domain first , make sure you select the DNS Server part of this AD Setup , if you do not select this step then NTLM may not work properly.

You can use the tool , dcpromo for this purpose ,

Refer to this blog for the Active Directory Install ,

http://helpdeskgeek.com/how-to/windows-2003-active-directory-setupdcpromo/

Open the DNS Server Setup on the Windows 2003 machine and put your actual DNS machine as forward DNS to this DNS Sever. 

Image(11)

And Add the DNS Servers To the list , 

Image(12)

and restart the Windows 2003 domain , 

Now login in to the test Windows XP machine

In the DNS Server specificy the your Active Directory Machine name , As you have to setup your main DNS Server

as the forward DNS in the Windows 2003 , you will not have any problems in accessing the other machines in your setup.

Image(13)

Go to My Computer Properties and use the AD Domain machine , for example ,

Image(14)

Create a test user from Windows 2003 domain and use this user to login to Windows 2003 domain , for example

Image(4)

Now install the IIS Server on the Windows 2003 machine , Click on Add or Remove programs and Add/Remove Windows Components

Image(5)

Install .Net FrameWork SDK , i.e .NET 4.0.X on this machine ,

Invoke the inetmgr (IIS Admin tool ) and Create a Virtual Directory say c:\temp\test1

Image(6)

Under Directory Server for this Virtual Directory remove the Enable Anonymous access and click 

on Integrated Windows Authentication ,

Image(7)

Create a Simple HTML File with the following on this ,

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title>Test Page IIS</title>
</head>
<body>
Hello Test<br>
</body>
</html> 

Access the URL using ,

http://iscsoavm10.mydomain.com/test1/test.html

This asks for a username and password on a plain machine , 

If you access this URL using a machine , that is already logged in to this domain , then it will not ask for the password. This is what NTLM about.

For testing the ASP.Net file create the following test.aspx file ,

<%@ Page Language="C#" %>
<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">
<p><%= "Hello World!" %></p>
<p><%= User.Identity.Name %></p>
</body>
</html>

Copy this file in c:\temp\test1 directory and run the

http://iscsoavm10.mydomain.com/test1/test.aspx

This displays the o/p as 

Hello World!

ISCSOAVM100\Administrator

Using Visual C# Studio create a Sample Web Service 

In the Web.config file have the following entries ,

==========================================================================================

<?xml version="1.0"?>
<configuration>
  <appSettings/>
  <connectionStrings/>
  <system.web>
    <compilation>
    </compilation>
    <!--
        The <authentication> section enables configuration
        of the security authentication mode used by
        ASP.NET to identify an incoming user.
    -->
    <authentication mode="Windows" />
    <!--
        The <customErrors> section enables configuration
        of what to do if/when an unhandled error occurs
        during the execution of a request. Specifically,
        it enables developers to configure html error pages
        to be displayed in place of a error stack trace.
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
         <error statusCode="403" redirect="NoAccess.htm"/>
         <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>
      -->
  </system.web>
  <system.webServer>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>
  <system.serviceModel>
    <services>
      <service name="WcfService3.Service1" behaviorConfiguration="WcfService3.Service1Behavior">
        <!-- Service Endpoints -->
        <endpoint address="" binding="basicHttpBinding"  bindingConfiguration="BasicHttpEndpointBinding" contract="WcfService3.IService1">
          <!--
              Upon deployment, the following identity element should be removed or replaced to reflect the
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
              automatically.
          -->
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="basicHttpBinding"    contract="IMetadataExchange" bindingConfiguration="BasicHttpEndpointBinding" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WcfService3.Service1Behavior">
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
     <bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
  </system.serviceModel>
</configuration>

==========================================================================================

The important one's are 

     <bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>

  <endpoint address="" binding="basicHttpBinding"  bindingConfiguration="BasicHttpEndpointBinding" contract="WcfService3.IService1">

   <endpoint address="mex" binding="basicHttpBinding"    contract="IMetadataExchange" bindingConfiguration="BasicHttpEndpointBinding" />

With out this , you may get lot of exceptions like 'anonymous' users are not allowed etc ,

Web Service Code 

---------------------

using System;

using System.Collections.Generic;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

using System.Web;

using System.ServiceModel;

namespace WcfService3

{

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.

// NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.

public class Service1 : IService1

    {

public string GetData( int value)

        {

//  OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name

// Create stream writer object and pass it the file path

StringBuilder sw = new StringBuilder ();

            sw.AppendLine( "--------> " + value);

return string.Format( "You entered: {0}", sw.ToString());

        }

public CompositeType GetDataUsingDataContract(CompositeType composite)

        {

if (composite == null)

            {

throw new ArgumentNullException("composite" );

            }

if (composite.BoolValue)

            {

                composite.StringValue += "Suffix";

            }

return composite;

        }

    }

}

Web Services Interface Code 

===========================

using System;

using System.Collections.Generic;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

namespace WcfService3

{

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.

    [ServiceContract]

public interface IService1

    {

        [ OperationContract]

string GetData( int value);

        [ OperationContract]

CompositeType GetDataUsingDataContract(CompositeType composite);

// TODO: Add your service operations here

    }

// Use a data contract as illustrated in the sample below to add composite types to service operations.

    [DataContract]

public class CompositeType

    {

bool boolValue = true;

string stringValue = "Hello ";

        [ DataMember]

public bool BoolValue

        {

get { return boolValue; }

set { boolValue = value; }

        }

        [ DataMember]

public string StringValue

        {

get { return stringValue; }

set { stringValue = value; }

        }

    }

}

From Visual Studio Create a New Publish Profile with the directory as say c:\temp\test

and publish this Web Service to this directory.

If the C# Visual studio and IIS server are there on a different machines then copy the  contents c:\temp\test to the IIS Server directory.

From the Browser access the URL ,

http://iscsoavm10.mydomain.com/test1/Service1.svc

This should ask for a password, enter the username as test and Welcome1.

Now from SOAP UI 

Image(15)

Image(9)

Click on Auth from the SOAP UI

Image(16)

From JDeveloper you have to first download the wsdl file and the related XSD files manually ,

First download the wsdl file , 

http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?wsdl

In this wsdl file , you will find you need 3 xsd files ,

<xsd:import schemaLocation="http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd0" namespace="http://tempuri.org/"/>

<xsd:import schemaLocation="http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>

<xsd:import schemaLocation="http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/WcfService3"/>

Download the xsd files ,

http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd0 as xsd0.xsd

http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd1  as xsd1.xsd

http://iscsoavm10.iscsoavm10.mydomain.com/Test1/Service1.svc?xsd=xsd2  as xsd2.xsd

and change the downloaded wsdl file 

<xsd:import schemaLocation="xsd/xsd0.xsd" namespace="http://tempuri.org/"/>

<xsd:import schemaLocation="xsd/xsd2.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>

<xsd:import schemaLocation="xsd/xsd2.xsd" namespace="http://schemas.datacontract.org/2004/07/WcfService3"/>

And create a simple BPEL to call this service , 

In the composite.xml file have the following entries ,

oracle.webservices.auth.username

oracle.webservices.auth.password

oracle.webservices.preemptiveBasicAuth as false ,

for example , 

<binding.ws port="http://tempuri.org/#wsdl.endpoint(Service1/BasicHttpBinding_IService1)"
                location="test1.wsdl" soapVersion="1.1">
      <property name="weblogic.wsee.wsat.transaction.flowOption"
                type="xs:string" many="false">WSDLDriven</property>
                 <property name="oracle.webservices.auth.username"  type="xs:string" many="false">test</property>
                 <property name="oracle.webservices.auth.password"  type="xs:string" many="false">Welcome1</property>
                 <property name="oracle.webservices.preemptiveBasicAuth"  type="xs:string" many="false">false</property>
    </binding.ws>

You can also set these properties from EM Console , 

Click on your SOA project , and Services and References

and Click on Web Service you are calling and Click on the Proprties TAB , here you can enter the values for 

oracle.webservices.auth.username

oracle.webservices.auth.password

oracle.webservices.preemptiveBasicAuth

Image(17)