Thursday, April 12, 2012

How to remove the block in Oracle ESB Resequencer?

A Resequencer is used to rearrange a stream of related but out-of-sequence messages back into order. The messages are rearranged on an identifier that is a part of the message. The Resequencer should be aware of the identifier sequence for rearranging the messages. While rearranging the messages, the Resequencer typically uses the identifier sequence to decide the position of a message.

In resequencer the message that generates an error is moved to the error hospital. The group is moved to an error state and is not picked up by the dequeue system of any ESB instance. The user can resubmit the error-generating message using the error hospital. On resubmission of the message, the group is moved to a normal state, so that it can be picked up by the dequeue system of any ESB instance.

Example:

'ProcessSalesOrderFulfillmentSiebelCommsSequencer' resequencer is grouped with AccountId, If an order for customer X fails, then the resequencer will not allow new orders for same customer X to process. You will not see errors any errors.

To enable the block to process further orders from the customer X, you need to execute below scripts in ORAESB schema.

Note: You need to executed the script, only if the errored problem is fixed.

1) select GUID from wf_events where Name = '<Resequencer ESB Service Name>';

2) update esb_group_status set error=0, lockConId='NONE' where error!=0 and group_id='<GROUP_ID>' and service_guid='<GUID>';

3) commit;

Example:

-- Get service_guid(B4B82FA18B3911DEBFD0D7F6B776077D)
select guid from wf_events where name = 'ProcessSalesOrderFulfillmentSiebelCommsSequencer'

-- Account Id(1-70KX)
update esb_group_status set error=0, lockConId='NONE' where error!=0 and group_id='1-70KX' and service_guid='B4B82FA18B3911DEBFD0D7F6B776077D';
commit;

Tuesday, March 27, 2012

Oracle SOA/BPEL/ESB Timeout Configuration

Transaction timeout configuration settings are need to be carried out in below set of configuration points.


1. Global Transaction Timeout: Set the global transaction time out value in transaction-timeout attribute of transaction-manager.xml.

  a) Edit transaction-manager.xml from $ORACLE_HOME\j2ee\oc4j_soa\config\transaction-manager.xml
  b) Find the transaction-timeout parameter and change its value to 7200(Seconds).
  c) Save and close the file.

2. EJB Timeout: transaction-timeout attribute controls the transaction timeout interval (in seconds), If the transaction has not completed in this timeframe, the transaction is rolled back.

  a) Edit orion-ejb-jar.xml from $ORACLE_HOME\j2ee\oc4j_soa \application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml
  b) Find all occurrences of the transaction-timeout parameter and change its value to 3600 (Seconds).
  c) Save and close the file.

3. SyncMaxWaitTime is a domain level property and its setting is applicable for synchronous durable bpel processes

  a) Log in to the BPEL Console.
  b) Click the Configuration tab.
  c) Change the value of syncMaxWaitTime to 240 (seconds) and click on Apply

4. ESB Timeout: Edit esb_config.ini file from $ORACLE_HOME/integration/esb/config/esb_config.ini

  a) Change the value of xa_timeout parameter to 900 (Seconds).

5. Restart the server to make effect of all the changes.

Monday, March 26, 2012

Oracle BRM JCA Adapter logging on Oracle Application Server

The JCA Resource Adapter supports Java Unified Logging (JUL), which allows the adapter to use the Oracle Application Server logging library.


Follow below instruction to enable BRM JCA Adapter logging:

1. Create directory: $Oracle_home/j2ee/Instance/application-deployments/default/BRMAdapter/logs.

2. Edit $Oracle_home/j2ee/Instance/config/j2ee-logging.xml file in an XML editor.

3. Add following lines under the <log_handlers> element:

  <log_handlers>
  <log_handler name="brm-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory">
  <property name="path" value="Oracle_home/j2ee/oc4j_soa/application-deployments/default/BRMAdapter/logs/BRMAdapterLog.log"/>
  <property name="maxFileSize" value="10485760"/>
  <property name="maxLogSize" value="104857600"/>
  <property name="encoding" value="UTF-8"/>
  <property name="format" value="ODL-TEXT"/>
  </log_handler>
  </log_handlers>

  where,
  o Path specifies the directory in which the adapter creates the log file.
  o maxFileSize specifies the maximum size, in bytes, of the log file. When a log file reaches this limit, a new log  file is generated.
  o maxLogSize specifies the maximum size, in bytes, of the logging directory.
  o encoding must be set to UTF-8.
  o format must be set to ODL-TEXT. This enables you to view the log files directly in the Oracle Application Server control console.

4. Add the following lines under the <loggers> element:

  <loggers>
  <logger name="oracle.tip.adapter.brm" level="LogLevel" useParentHandlers="false">
  <handler name="oc4j-handler"/>
  <handler name="brm-handler"/>
  </logger>

  where LogLevel is set to one of the following:

  o SEVERE to log problems that require attention from the system administrator.
  o WARNING to log actions that should be reviewed and may require action before an error occurs.
  o INFO to log normal actions or events. This includes user operations, such as user log ins, and automatic operations, such as log file rotations.
  o CONFIG to log configuration-related messages.
  o FINE to log trace or debug messages for performance monitoring.
  o FINER to log highly detailed trace or debug message.
  o FINEST to log the most detailed trace or debug messages.

5. Save and close the file.

6. Restart the application server or the J2EE instance.

Thursday, March 22, 2012

Oracle BPEL configuration settings to handle large payload/document

Processing of big payload in BPEL process may result in following problem.


1) OutOfMemoryError - Increase the java heap size

Refer my previous posts on how to increase the heap.

2) Process hangs with out result - This occurs due to huge number of activities generated during bpel instance processing.

Process hangs due to maximum number of in-memory activities. You may get "Instance not found in datasource" or "Maximum request depth exceeded" errors. Process will also throw 'TimeOut' error for synchronous processes after reaching the tansaction-timeout duration.

To solve this problem, we need to add 'dspMaxRequestDepth' property in $ORACLE_HOME/bpel/domains/default/config/domain.xml file.

This property sets the maximum number of in-memory activities to process within the same request. After processing an activity request, Oracle BPEL Process Manager attempts to process as many subsequent activities as possible without jeopardizing the transactionality of the request. Once the activity processing chain has reached this depth, the instance is dehydrated and the next activity is performed in a separate transaction. The default value is 600 activities.

Please add below set of property elements in domain.xml and restart the server to take effect of the changes. Here in below property, I have set the maximum in-memory activities as 4000.

<property id="dspMaxRequestDepth">
<name>Maximum number of in memory activities</name>
<value>4000</value>
<comment><![CDATA[
This property sets the maximum number of in-memory activities to process within the same request. After processing an activity request, Oracle BPEL Process Manager attempts to process as many subsequent activities as possible without jeopardizing the transactionality of the request. Once the activity processing chain has reached this depth, the instance is dehydrated and the next activity is performed in a separate transaction.
<p/>
If the request depth is too large, the total request time can exceed the application server transaction timeout limit.
<p/>
The default value is 600 activities.
]]></comment>
</property>

3) Time out error - Increase the timeout setting

How to configure timeout setting will come in my next posting.

Wednesday, March 7, 2012

Export Cross Reference Table

Set below environment variables.


export OC4J_USERNAME=oc4jadmin
export OC4J_PASSWORD=oc4jadmin
export DB_URL=jdbc:oracle:thin:@HOST_NAME:1521:SERVICE_ID
export DB_USER=aia
export DB_PASSWORD=aia

Execute below commands to export ITEM_ITEMID table to Item_Xref.xml file.

$ cd $ORACLE_HOME/integration/esb/bin

$ ./xrefexport.sh -file ./Item_Xref.xml -table ITEM_ITEMID

NOTE: If you encounter any error as below then set the environment variable 'export oc4j_username=oc4jadmin' and 'export oc4j_password=welcome1' instead of upper_case variable name

$ ./xrefexport.sh -file ./Item_Xref.xml -table ITEM_ITEMID

./xrefexport.sh[49]: test: Specify a parameter with this command.
invoke:Connection Details =sun.net.www.protocol.http.HttpURLConnection:http://HostName:7777/esb/j_security_check
postAndReceive:Connection response code = 302
getCookie:Final cookie value = JSESSIONID=39256409e4e9d3aa94731f05baa844eb8e9e35bf6cde13a5b37bd08c486c6aa8.e3mMc3qLbN8Le34RbN4Rch8Na3j0; path=/esb
invoke:Connection Details =sun.net.www.protocol.http.HttpURLConnection:http://HostName:7777/esb/login_error.jsp
postAndReceive:Connection response code = 200
getCookie:Final cookie value = JSESSIONID=39256409e4e9d3aa94731f05baa844eb8e9e35bf6cde13a5b37bd08c486c6aa8.e3mMc3qLbN8Le34RbN4Rch8Na3j0; path=/esb
Export Failed .. reason : "Authendication Failed"


Above error occurs due to a bug in xrefexport.sh which reads the environment variable oc4j username and password with lower case oc4j_username/oc4j_password. This error occurs only in some versions of SOA Suite alone.

Wednesday, February 8, 2012

Purge/Delete AQ Messages

Manual deletion of AQ message leads to various problem error such as " A resource exception occurred while waiting for inbound messages", it's always advisable to use scripts to delete the AQ messages.


Below script deletes the messages from Queue table.

DECLARE
po dbms_aqadm.aq$_purge_options_t;
BEGIN
po.block := FALSE;
DBMS_AQADM.PURGE_QUEUE_TABLE(
queue_table => 'AIA_SALESORDERJMSQTAB',
purge_condition => NULL,
purge_options => po);
END;

Tuesday, February 7, 2012

How to increase heap size in 64 bit machine OC4J Container?

In 64 bit machine you can increase the heap size to about 2^64. To increase the heap size in 64 bit JVM, the processor and operating system should also have 64 bit type to support almost unlimited heap size.

Note: The heap size should be kept at optimum size, even though it supports huge allocation. Performance will be degraded if you allocate more heap. Its better to use half the size of RAM as your heap size.

How to determine the maximum heap that can be allocated for your JVM?

Use the command "java -d64 -mx10g -version", if your JVM supports 64 bit you will get the jdk version otherwise you will get "Unrecognized option: -d64" message.

$ java -d64 -mx15g -version
java version "1.5.0.16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.16-_09_mar_2009_04_02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0.16 jinteg:03.09.09-12:27 IA64W, mixed mode)

$ java -d64 -mx1024g -version
java version "1.5.0.16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.16-_09_mar_2009_04_02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0.16 jinteg:03.09.09-12:27 IA64W, mixed mode)

How to change the heap size in OC4J container?

Take a backup of opmn.xml and edit the opmn.xml at location $ORACLE_HOME/opmn/conf.

Edit the startParameters of your container and add "-d64 -ms10g -mx10g" in value of 'java-options' to increase the heap size to 10GB

<category id="start-parameters">
<data id="java-options" value="-server -d64 -ms10g -mx10g -XX:MaxPermSize=512M -XX:AppendRatio=3 -Djava.security.policy=$ORACLE_HOME/j2ee/oc4j_soa/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doraesb.home=$ORACLE_HOME/integration/esb -Dhttp.proxySet=false -Doc4j.userThreads=true -Doracle.mdb.fastUndeploy=60 -Doc4j.formauth.redirect=true -Djava.net.preferIPv4Stack=true -Dorabpel.home=$ORACLE_HOME/bpel -Xbootclasspath^/p:$ORACLE_HOME/bpel/lib/orabpel-boot.jar -Dhttp.proxySet=false -XX:MaxNewSize=614m -XX:NewSize=614m -XX:SurvivorRatio=6 -Daia.home=$AIA_HOME/AIA -Dbpel.delivery.operationNameCheck=true -Dbpel.dms=false" />
</category>