Wednesday, 26 March 2014

Purging instances using sql scripts

In Oracle SOA Suite, if your application creates number of instances and if your application has large number of payloads the database will grow faster and it uses all of the available disk space in your machine. If your application continues it consumes all your disk space and your SOA application will stop functioning and degrades the performance of your application.

 There is a simple way to avoid this type of problem, the available option is purging the database. Purge script deletes the instances which are completed successfully, faulted, terminated, stale and unknown states. The following steps shows how to purge the instances using sql scripts.


step 1: open command prompt
step 2: change directory to <middleware_hom>\soa\rcu\integration\soainfra\sql\soa_purge
           ex: cd C:\oracle117\Middleware\soa\rcu\integration\soainfra\sql\soa_purge
step 3: sqlplus / as sysdba
step 4: GRANT EXECUTE ON DBMS_LOCK TO <RCU PREFIX>_SOAINFRA;
           ex: GRANT EXECUTE ON DBMS_LOCK TO DEV_SOAINFRA;
step 5: GRANT CREATE JOB TO <RCU PREFIX>_SOAINFRA;
           ex: GRANT CREATE JOB TO DEV_SOAINFRA;




step 6: exit
step 7: sqlplus DEV_SOAINFRA/<password>

       

step 8: @soa_purge_scripts.sql

  
   
step 9: To see the list of available instance execute execute the following command
             select state, id, composite_dn from composite_instance;
  

step 10: execute the following sql command to purge the instance from the time interval 01-01-2014 to 31-03-2014

execute soa.delete_instances ( to_timestamp('2014-01-01','YYYY-MM-DD'),to_timestamp('2014-03-31','YYYY-MM-DD'),20000,60,to_timestamp('2014-03-31','YYYY-MM-DD'),false);


step 11: re execute the following command.

select state, id, composite_dn from composite_instance;




Thursday, 20 March 2014

Tuning JVM heap size of weblogic domain on Linux & Windows

You can modify Xms value to adjust minimum heap size and Xmx value to adjust maximum heap size. To change default heap settings in your weblogic domain, navigate to domain_home\bin and edit the setDomainEnv File.

For Linux users:
      If you are using Linux operating system add the following code in setDomainEnv.sh file, add the blue font       code next to the following code

       if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
        CUSTOM_MEM_ARGS_64BIT="-Xms${XMS_JROCKIT_64BIT}m -Xmx${XMX_JROCKIT_64BIT}m"
        export CUSTOM_MEM_ARGS_64BIT
        CUSTOM_MEM_ARGS_32BIT="-Xms${XMS_JROCKIT_32BIT}m -Xmx${XMX_JROCKIT_32BIT}m"
        export CUSTOM_MEM_ARGS_32BIT
else
        CUSTOM_MEM_ARGS_64BIT="-Xms${XMS_SUN_64BIT}m -Xmx${XMX_SUN_64BIT}m"
        export CUSTOM_MEM_ARGS_64BIT
        CUSTOM_MEM_ARGS_32BIT="-Xms${XMS_SUN_32BIT}m -Xmx${XMX_SUN_32BIT}m"
        export CUSTOM_MEM_ARGS_32BIT
fi

       # Set heap for AdminServer
       if [ "${SERVER_NAME}" == "AdminServer" ] ; then
            USER_MEM_ARGS="-Xms1024m -Xmx2048m"
            export USER_MEM_ARGS
       fi

      #Setting heap for managed servers
      if [[ "${SERVER_NAME}" == "soa_server1" ]] ; then
          USER_MEM_ARGS="-Xms2048m -Xmx4096m"
          export USER_MEM_ARGS
      fi
    if [[ "${SERVER_NAME}" == "bam_server1" ]] ; then
        USER_MEM_ARGS="-Xms1024m -Xmx2048m"
        export USER_MEM_ARGS
      fi



     start admin and manged servers, use ps -ef | grep java command to check the heap settings
 


For Windows users:
     If you are using Windows operating system add the following code in setSOADomainEnv.cmd file.
    

if  "%SERVER_NAME%"=="AdminServer" (
               set JAVA_OPTIONS=%JAVA_OPTIONS%
      set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m
              set PORT_MEM_ARGS=-Xms2048m -Xmx2048m   
        )

if  "%SERVER_NAME%"=="soa_server1" (
 set JAVA_OPTIONS=%JAVA_OPTIONS%
      set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m
              set PORT_MEM_ARGS=-Xms4096m -Xmx8192m
       )

if  "%SERVER_NAME%"=="bam_server1" (
        set JAVA_OPTIONS=%JAVA_OPTIONS%
              set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m
              set PORT_MEM_ARGS=-Xms4096m -Xmx8192m
         )