Sunday, 21 August 2011

What is the default username and password for Oracle Enterprise Repository 11g

The default username and password for Oracle Enterprise Repository 11g is:

User: admin

Password: admin

This is valid only for the fresh install. After the first login you will be forced to change the password for the admin user.

The admin user is the default administrative account installed with Oracle Enterprise Repository.






Monday, 27 June 2011

Oracle WebLogic Server Basic Concepts - Domain, Admin server, Managed Server

I found this great resource to answer the following questions:

1. What is a weblogic Domain?
2. What is a Weblogic Admin Server?
3. What is a Managed Server?
4. What is a Weblogic Cluster

and many more basic conscepts of weblogic Server.

Please go to this link: Oracle WebLogic Server Basic Concepts

This will be an eye opener presentation, if you are new to Weblogic Server.

Wednesday, 22 June 2011

nohup: Execute Commands After You Exit From a Shell Prompt


Most of the time you login into remote server via ssh. If you start a shell script or command and you exit (abort remote connection), the process / command will get killed. Sometime job or command takes a long time. If you are not sure when the job will finish, then it is better to leave job running in background. However, if you logout the system, the job will be stopped. What do you do?

nohup command

Answer is simple, use nohup utility which allows to run command./process or shell script that can continue running in the background after you log out from a shell:

nohup Syntax:

nohup command-name &
Where,
  • command-name : is name of shell script or command name. You can pass argument to command or a shell script.
  • & : nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an & symbol.

nohup command examples

1) Login to remote server
$ ssh user@remote.server.com
2) Execute script called pullftp.sh
# nohup pullftp.sh &
Type exit or press CTRL + D exit from remote server.
# exit
3) Find all programs and scripts with setuid bit set on, enter:
# nohup find / -xdev -type f -perm +u=s -print > out.txt &
Type exit or press CTRL + D exit from remote server.
# exit
Please note that nohup does not change the scheduling priority of COMMAND; use nice for that:
# nohup nice -n -5 ls / > out.txt &
As you can see nohup keep processes running after you exit from a shell. Read man page of nohup and nice command for more information. Please note that nohup is almost available on Solaris/BSD/Linux/UNIX variant.
Update:
# 1: As pointed out by Jason you can use at command to queue a job for later execution. For example, you can run pullftp.sh script to queue (one minute) later execution
$ echo "pullftp.sh" | at now + 1 minute
# 2: You can also use screen command for same. Brock pointed out disown shell internal command for same purpose. Here is how you can try it out:
$ pullftp.sh &
$ disown -h
$ exit

This is a complete copy from the source. 


Aditional Info: less Nohup.out

Provides you with the output of the <command&>. This is some thing similar to tail -f on a live log file. 

Monday, 20 June 2011

SetDb.env - Oracle Database Key environment Settings.

 You need the following environment setting set in your linux environment so that you can start working with the Oracle DB.

ORACLE_SID=<NAME of your DB>
export ORACLE_SID
ORACLE_HOME=<complete path of your oracle home>
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH

you can either have them typed every time you log in to the linux environment or create them as an  environment file which you can execute every time you log in to your Linux Environment.

Steps as follows:
==============
1. vi <Filename>.env or <Sid_ServerName>.env
2. copy paste the below:

ORACLE_SID=<NAME of your DB>
export ORACLE_SID
ORACLE_HOME=<complete path of your oracle home>
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH

3. Replace the parameters <Values> with your Database values.
4. Save the file.
5. Make sure that you have provided execute permissions for the file.
6. Now execute the file (Source the file) as shown below:

.<Space>./<Filename>.env.

Now all your environment variables are set.

If you would like to verify the environment Variables try the following:

$ echo $ORACLE_HOME or $ORACL_SID

You should see the values as set earlier.

Note: When the above environment variables are not set most of the Database utilities will fail to work.

For example when you run sqlplus will return an error such as:

message file spl<lang>.msb not found

SP2-0750 need to set ORACLE_HOME to your ORACLE software directory 


Reference Source: sqlplus not initializing in linux (Oracle Forum)


How to Make Oracle Database Start and Shutdown Automatically - Linux

The automatic startup and shutdown of the Oracle database can be achieved with the files dbstart and dbshut both provided by Oracle.

These files rely on the existance of the file /etc/oratab to work (although by altering the dbshut and dbstart files this can be moved).


The file oratab is used by ORACLE utilities (DbStart and DbShut).  It is created by root.sh and updated by the Database Configuration Assistant when creating a database.

The format of the /etc/oratab file is as follows: 


SID:ORACLE_HOME:AUTO

An example:


orcl:/home/oracle/7.3.3.0.0:Y  -- 'Y' -- To Start Automatically
leaveup:/home/oracle/7.3.2.1.0:N -- 'N' -- Not to start Automatically.
 
This is not it, there is more to it. The above will work only when the DbStart and DbShut scripts are run during the startup of the linux system. Please read on:



init.d & rc.d

To start and stop the database when the machine comes up and goes down by modifying the startup routines for the Linux machine. This is quite easy, although I should point out here that this may change depending on which flavour of Linux (slackware, debian, redhat, etc). I will show examples which work for Redhat Linux 5.0. To modify these for your own flavour of Linux, please see your Linux documentation sets. (Although it should hold true for any Sys V type UNIX).
Firstly, we need to create the script which will run dbshut and dbstart in the /etc/rc.d/init.d directory.

Create the following file as /etc/rc.d/init.d/OracleDB:

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=<Oracle Home>
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
   'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        touch /var/lock/subsys/dbora
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
        rm -f /var/lock/subsys/dbora
        ;;
esac




After checking the correctness of the above script, This script needs to be linked to the Linux runlevel directories.

The following commands will ensure that the databases will come up in runlevels 3,4 and 5:



$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc3.d/S99OracleDB


$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc4.d/S99OracleDB
$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc5.d/S99OracleDB





The following commands will ensure that the databases will shut down in runlevels 0,1,2 and 6:





$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc0.d/K10OracleDB          # Halting
$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc1.d/K10OracleDB
$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc2.d/K10OracleDB
$ ln -s /etc/rc.d/init.d/OracleDB /etc/rc.d/rc6.d/K10OracleDB        # Rebooting




 Reference: Oracle Database HOWTO

Tuesday, 3 May 2011

How to configure SQL IDentity Provider for ORACLE BPEL or Worklist application in 11g SOA (Troubleshooting)

If you are looking to setup SQL IDentity Provider  for ORACLE BPEL or Worklist application in 11g SOA then you are in the right place.

The solution is basically provided by an Oracle Sample.

You can download the Oracle Sample here: workflow-120-SQLIdentityProvider.zip

Please follow the steps in the sample provided. Also you can double check the steps with this blog: SQLAuthenticator and Human Worklist Application

Credits to: .

By now you have setup the SQL Identiy provider for BPEL and worklist app.

Troubleshooting: (WorklistApp only)

When you have setup the SQL Identiy Provider, there is a very much likely chance that you might face an issue with the user name case sensitivity.

For example if you had a user in mixed case such as  UserName. Then when you try to log in to worklist app, it will complain that the user does not exist, despite that you witness the UserName exist in the database. This will not work for the following reasons.

Human workflow system (Worklist app) appears to be case insensitive for user names login. By default  all user names are stored in lowercase (Not using SQL identity, as this is a different case). As is the case we need to change a property to notify worklist app. 

Solution:

User name case insensitivity property should be changed in Oracle Enterprise Manager Fusion Middleware Control.

Please follow the steps provided in the
Document:  Oracle® Fusion Middleware Developer's Guide for Oracle SOA Suite 11g Release 1 (11.1.1)
Following the steps mentioned in the document and set the value to "true".

This will resolve the issue.

Tuesday, 26 April 2011

How To Generate Encrypted Password For admin.encrypted.password Property In ant-orabpel.properties File

This blog post will provide steps to generate an encrypted password for admin.encrypted.password property in <Oracle Home>/bpel/utilities/ant-orabpel.properties file.

In order to encrypt the password for admin.encrypted.password property in
ant-orabpel.properties file please do the following:

For example your password is "welcome1"

Make sure you are in <Oracle Home>/bpel/bin

Issue the following commands:

[SOA:~/product/10.1.3.1/OracleAS_1/bpel/bin]$ . ./devprompt.sh
[SOA:~/product/10.1.3.1/OracleAS_1/bpel/bin]$ java com.collaxa.cube.util.EncryptPassword welcome1

This will generate the password encrypted like:
AK6qvYcrlNMqnYt1uPZFjw==

Tuesday, 19 April 2011

How to Enable Oracle BPEL Debugger in Oracle SOA 10.1.3.5 MRL#1

In this section I will provide you with steps to enable BPEL Debugger in Oracle SOA suite 10.1.3.5 MRL#1.

If you read this document: Oracle® Application Server Release Notes and New Features
10g Release 3 (10.1.3.5.1) Part Number E15342-03

Section:

5.8.4 Debugging BPEL Processes and Instances from Oracle BPEL Control

Note: This feature is only available 10.1.3.5 MLR#1 onwords 


It tells you about how you can debug BPEL processes and instances from Oracle BPEL Control with the BPEL debugger.

But before you can start working on or using this feature, you need enable the debugging feature.

Follow the below steps to enable debugging in Oracle BPEL PM:

1. Edit File <SOA_HOME>\bpel\domains\default\config\domain.xml.

2. Add or make changes to domain.xml as below:

<property id="enableDebugger">
<name>enableDebugger</name>
<value>true</value>
<comment>
<![CDATA[debugger<p/>]]>;</comment>
</property>

3. A table is required for debugger that is not created by default in the ORABPEL schema.

   To create the table.

   Execute this script by logging into database with orabpel as user.

    $SOA_HOME\bpel\system\database\script\debugger_oracle.ddl

4. Restart the BPEL server. 

hope this helps.

ORACLE BPEL 11g, Composite Deployment Propagation Issue Due To Coherence.

If you are facing BPEL (SOA) composite deployment propagation issues in 11g oracle SOA cluster, then there is a very good chances that this happening due to the cluster communication section.

In 11g the cluster communication is maintained by another Oracle product called Coherence.

When you look at the Soa Diagnostic logs (and/or the coherence log if you have redirected the coherence logs to some other file)  you might witness logs such as:


Log from SOA1Cohearance.log

2011-03-30 11:08:27.270 Oracle Coherence GE 3.3.2/391 <Warning> (thread=PacketPublisher, member=1): Experienced a 22869 ms communication delay (probable remote GC) with Member(Id=2, Timestamp=2011-03-30 10:17:51.636, Address=IPAddress:Port, MachineId=<MachineID>, Location=process:<Process@Domain>); 123 packets rescheduled, PauseRate=0.0075, Threshold=6802011-03-30 11:31:00.643 Oracle Coherence GE 3.3.2/391 <Warning> (thread=Cluster, member=1): This senior Member(Id=1, Timestamp=2011-03-29 16:13:25.607, Address=IPAddress:Port, MachineId=<Machine ID>, Location=process:<Domain@DomanName>) appears to have been disconnected from another senior Member(Id=2, Timestamp=2011-03-30 10:17:51.636, Address=IPAddress:Port, MachineId=<MachineID>, Location=process:<Process@Domain>), which is the only member of its cluster, but did not respond to any of the termination requests; manual intervention may be necessary to stop that process.2011-03-30 11:31:00.695 Oracle Coherence GE 3.3.2/391 <D5> (thread=Cluster, member=1): TcpRing: disconnected from member 2 due to a disconnect request2011-03-30 11:31:01.652 Oracle Coherence GE 3.3.2/391 <D5> (thread=Cluster, member=1): TcpRing: connecting to member 2 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}2011-03-30 11:31:01.949 Oracle Coherence GE 3.3.2/391 <D6> (thread=PacketPublisher, member=1): Member(Id=2, Timestamp=2011-03-30 10:17:51.636, Address=IPAddress:Port, MachineId=<MachineID>, Location=process:<Process@Domain>) has failed to respond to 17 packets; declaring this member as paused.2011-03-30 11:31:03.672 Oracle Coherence GE 3.3.2/391 <D5> (thread=Cluster, member=1): TcpRing: connecting to member 2 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}2011-03-30 11:31:05.694 Oracle Coherence GE 3.3.2/391 <D5> (thread=Cluster, member=1): TcpRing: connecting to member 2 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}



Log from SOA2Cohearance.log

2011-03-30 11:30:53.820 Oracle Coherence GE 3.3.2/391 <Warning> (thread=PacketPublisher, member=2): Timeout while delivering a packet; removing Member(Id=1, Timestamp=2011-03-29 16:13:25.607, Address=IPAddress:Port, MachineId=<Machine ID>, Location=process:<Domain@DomanName>)
2011-03-30 11:30:53.820 Oracle Coherence GE 3.3.2/391 <D5> (thread=PacketPublisher, member=2): Member 1 left service soa_domain_SOA_ClusterCacheService with senior member 2
2011-03-30 11:30:53.821 Oracle Coherence GE 3.3.2/391 <D5> (thread=PacketPublisher, member=2): Member 1 left Cluster with senior member 2
2011-03-30 11:30:53.821 Oracle Coherence GE 3.3.2/391 <D5> (thread=ReplicatedCache:soa_domain_SOA_ClusterCacheService, member=2): Service soa_domain_SOA_ClusterCacheService: sending ServiceConfigSync to all
2011-03-30 11:30:54.181 Oracle Coherence GE 3.3.2/391 <D5> (thread=Cluster, member=2): TcpRing: disconnected from member 1 due to the peer departure
2011-03-30 11:31:00.683 Oracle Coherence GE 3.3.2/391 <Warning> (thread=Cluster, member=2): The member formerly known as Member(Id=1, Timestamp=2011-03-30 11:30:53.82, Address=IPAddress:Port, MachineId=<Machine ID>, Location=process:<Process@Domain>) has been forcefully evicted from the cluster, but continues to emit a cluster heartbeat; henceforth, the member will be shunned and its messages will be ignored.
2011-03-30 11:31:01.670 Oracle Coherence GE 3.3.2/391 <D4> (thread=TcpRingListener, member=2): Rejecting connection to member 1 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}
2011-03-30 11:31:03.685 Oracle Coherence GE 3.3.2/391 <D4> (thread=TcpRingListener, member=2): Rejecting connection to member 1 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}
2011-03-30 11:31:05.704 Oracle Coherence GE 3.3.2/391 <D4> (thread=TcpRingListener, member=2): Rejecting connection to member 1 using TcpSocket{State=STATE_OPEN, Socket=Socket[addr=/<IPAddress>,port=<Port>,localport=<Port>]}
When you see log message such as above, All it says is that Coherence is not able to communicate to the other node member in the cluster. In other words the other node, which keeps disconnecting very often, is not responding to coherence connection request.

The following was the solution in my/our case: 

Finally with various testing and researching, found out that the second node container was taking a long time with Garbage collection (GC) and was found that the second node's Java start up parameters where not set up to standards.

As a result  the Java start up parameters were tuned as following:

-XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy -XX:ParallelGCThreads=4 -XX:+UseGetTimeOfDay -Xms4096m -Xmx4096m -XX:PermSize=512m -XX:MaxPermSize=756m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=10

and aded -Dtangosol.coherence.mode=prod to EXTRA_JAVA_OPTIONS variable

Note: Dont forget to restart your weblogic managed servers.

With the above settings, the issue with BPEL composite Deployment propagation disappeared.

Monday, 4 April 2011

How to Trace or Debug Database for issues / How to setup Tracing in database.

often during integration testing we encounter ORA Data base errors,  In this case we are debugging ORA- 02074 error.

here is how we can get more info about the tracing.

You need to set the command as below to you DB:

alter system set events '2074 trace name errorstack level 3';

If you would like to know more about the alter system set events command please

Oracle event trace types - by Burleson Consulting

When you set the above command and reproduce the issue, what ever that might be, look into the Alert_xxx.log file for statements such as below



Mon Apr 04 10:31:34 2011
Errors in file <Path>/trace/<InstanceName>_ora_20926.trc:
ORA-02074: cannot SET NLS in a distributed transaction
Mon Apr 04 10:31:36 2011
Errors in file <Path>/trace/<InstanceName>_ora_20950.trc:
ORA-02074: cannot SET NLS in a distributed transaction

This file gives the trace file name which contains the session dumps. In order to read the trace file, I believe you need extensive DBA skills. But do give it a shot.

How to Reset or Refresh Oracle ESB (10g) MetaData Repository.


Sometimes ESB repository does not behaves as expected especially after a rigorous DEV cycles or for some other reasons. In order to bring it back to clean, at $ORACLE_HOME/integration/esb/bin directory a script called ‘reset.bat/sh’ is available. This script will cleanup the ESB repository. Simply execute the command as shown below and follow the output.

./reset.sh -DDB_URL=jdbc:oracle:thin:@//db_host:db_port/sid -DDB_USER=<User> -DDB_PASSWORD=<Password>

Note: Once you are able to execute it successfully, its very important to restart your ESB instance before using it.

Also remember to Deploy/redeploy all the ESB and BPEL process once again.

Thursday, 31 March 2011

JTA Transactions - Local and Global Transaction. And example with Oracle BPEL Application.

This Blog is about understanding the basics of transaction in J2EE level and how this can be translated to Oracle, BPEL conceptually. This does not limit the interpolation of this concept in simple Java projects as well.

Now lets dig in...


Transactions

J2EE supports two kinds of transactions:
  • Local Transactions - A local transaction is internal to a single resource.
  • Global Transactions - A global transaction is created by an external transaction manager (JTA) and is used to scope work on multiple resources.

Local Transactions

When a managed data source is configured for local transactions it returns connections that can participate in local transactions but cannot participate in global transactions. This means that the connections will not be enlisted in global transactions. The data source will set the auto commit to true for retrieved connections. However, it is up to the client to determine how the connections will be used in local transactions. That is, the client can change the auto-commit mode by using setAutoCommit() on a connection.


Local transactions are transactions associated with a particalar data source (means they are resource-specific). the most common example would be a transaction associated with a JDBC connection.

Global Transactions (XA)

When a managed data source is configured for global transactions, it returns connections that can participate in global transactions. A global transaction (also called a distributed transaction) enlists more than one resource in the transaction.

Global Transactions provide the ability to work with multiple transactional resources (typically relational databases and message queues).

Sources:
Oracle® Containers for J2EE Services Guide 10g (10.1.3.1.0)
Question: Difference between local and global transaction ? - AllInterview


Now putting this in SOA, Concept for better understanding:


Diag Source: Oracle® Containers for J2EE Services Guide 10g (10.1.3.1.0)Part Number B28958-01

So with the above image, lets make some assumptions,

hint: BPEL needs a JDBC connection for its dehydration purpose.

The client Tx is the main BPEL process and the new Tx is probably the adapter / another BPEL process invocation process with in the main BPEL process.


In a local transaction setup, client Tx will be a separate transaction and new Tx will be on its own.
In a global transaction setup, new Tx will be a part of or will participate with client Tx.

In another scenario, we can have one client Tx as local and two new Tx as XA. In this scenario the BPEL process will be on tis own and the two new  Tx will be part of one global Tx.

for example this case will apply where you have one BPEL process and you have two or more DB adapters in the BPEL process. Which means, all the DB adapter Tx will roll back if any one of the DB adapters fail with an error.


Additional Info:

Source: Local and global transaction considerations - IBM docs


Local and global transaction considerations

Applications use resources, such as Java Database Connectivity (JDBC) data sources or connection factories, that are configured through the Resources view of the administrative console. How these resources participate in a global transaction depends on the underlying transaction support of the resource provider.

For example, most JDBC providers can provide either XA or non-XA versions of a data source. A non-XA data source can support only resource manager local transactions (RMLT), but an XA data source can support two-phase commit coordination, as well as local transactions.

If an application uses two or more resource providers that support only RMLTs, atomicity cannot be assured because of the one-phase nature of these resources. To ensure atomic behavior, the application should use resources that support XA coordination and should access them within a global transaction.
If an application uses only one RMLT, atomic behavior can be guaranteed by the resource manager, which can be accessed in a local transaction containment (LTC) context.

An application can also access a single resource manager in a global transaction context, even if that resource manager does not support the XA coordination. An application can do this because the application server performs an "only resource optimization" and interacts with the resource manager in a RMLT. In a global transaction context, any attempt to use more than one resource provider that supports only RMLTs causes the global transaction to be rolled back.

At any moment, an instance of an enterprise bean can have work outstanding in either a global transaction context or an LTC context, but not both. An instance of an enterprise bean can change from running in one type of context to the other (in either direction), if all outstanding work in the original context is complete. Any violation of this principle causes an exception to be thrown when the enterprise bean tries to start the new context.

Tuesday, 29 March 2011

What is a durable subscription - JMS.

 A durable subscription saves messages for an inactive subscriber and deliveres these saved messages when the subscriber reconnects. In this way, a subscriber will not loose any messages even though it disconnected. A durable subscription has no effect on the behavior of the subscriber or the messaging system while the subscriber is active (e.g., connected). A connected subscriber acts the same whether its subscription is durable or non-durable. The difference is in how the messaging system behaves when the subscriber is disconnected.

Use a Durable Subscriber to make the messaging system save messages published while the subscriber is disconnected.

Source:  http://www.eaipatterns.com/DurableSubscription.html

The durable subscription only apply to the topic of the JMS.


JMS Queue - Difference between a Queue and a Topic.

This is a typical interview question: What is the difference between a Queue and a Topic ( or Queue Vs Topic).

Before you go for the comparisons you need to learn the basics such as what is a JMS Queue what was the purpose of this technology and so on...

I would like to point you to this wiki page:

Topic: Java Message Service


After you have reviewed the above page you might have understood what is the difference already. But for those who are time short... read on.

First Elements of an JMS Queue:

JMS provider
    An implementation of the JMS interface for a Message Oriented Middleware (MOM). Providers are implemented as either a Java JMS implementation or an adapter to a non-Java MOM.

JMS client    An application or process that produces and/or receives messages.

JMS producer/publisher    A JMS client that creates and sends messages.

JMS consumer/subscriber
    A JMS client that receives messages.

JMS message
    An object that contains the data being transferred between JMS clients.

JMS queue
    A staging area that contains messages that have been sent and are waiting to be read. Note that, contrary to what the name queue suggests, messages have to be delivered in the order sent A JMS queue only guarantees that each message is processed only once.

JMS topic    A distribution mechanism for publishing messages that are delivered to multiple subscribers. 

Source: Java Message Service

The comparison: Queue VS Topic

Queue:

  • Point-to-point model
  • Only one consumer gets the message
  • Messages have to be delivered in the order sent
  • A JMS queue only guarantees that each message is processed only once.
  • The Queue knows who the consumer or the JMS client is. The destination is known.
  • The JMS client (the consumer) does not have to be  active or connected to the queue all the time to receive or read the message.
  • Every message successfully processed is acknowledged by the consumer.


Descriptive example: A JMS queue is a channel through which users "pull" messages they want to receive using the p2p model, instead of automatically receiving messages on a particular topic. The producer submits messages to the queue, and recipients can browse the queue and decide which messages they wish to receive. In the p2p model, users can see the contents of the messages held in the queue before deciding whether or not to accept their delivery.



 
Topic:

  • Publish/subscribe model
  • Multiple clients subscribe to the message
  • There is no guarantee messages have to be delivered in the order sent
  • There is no guarantees that each message is processed only once. -- As this can be sensed from the model 
  • The Topic, have multiple subscribers and there is a chance that the topic does not know all the subscribers. The destination is unknown.
  • The subscriber / JMS client needs to the active when the messages are produced by the producer, unless the subscription was a durable subscription.
  • No, Every message successfully processed is not acknowledged by the consumer/subscriber.
Descriptive Example: A JMS topic is the channel through which users subscribe to receive specific messages from a producer in the publish-and-subscribe model of JMS messaging. The model can be compared to subscribing to a newspaper; for example, if John Doe subscribed to "The New York Times," he would receive the paper every day from the newspaper producer. Similarly, if John Doe used JMS messaging to subscribe to a particular topic, he would receive all sent messages from a producer regarding that topic.

Wednesday, 23 March 2011

How to Collect Thread dump for Oracle Applications - In this Case B2B 10g in Linux.

The command to perform a thread dump on linux is kill -3 <pid>. 


The <pid> can be found using opmnctl status for the midtier. 


Example of the output:


-------------------+--------------------+---------+---------
ias-component      | process-type       |     pid | status -------------------+--------------------+---------+---------
LogLoader          | logloaderd         |     N/A | Down   dcm-daemon         | dcm-daemon         |     N/A | Down   OC4J               | home               |    1648 | Alive  HTTP_Server        | HTTP_Server        |    1646 | Alive  B2B                | B2BServer          |    1647 | Alive  B2B                | OC4J_B2B           |    1649 | Alive  DSA                | DSA                |     N/A | Down   


In the above example, the <pid> is 1647.


The thread dumps are located in file $ORACLE_HOME/opmn/logs/B2B~B2BServer~*  or B2B~OC4J_B2B~* file. 


This needs to be done a least three times at interval about 15-30 seconds each after the issue (what ever you are debugging) has been re-produced. 


Example of a thread dump:


Full thread dump Java HotSpot(TM) Server VM (1.4.2_14-b05 mixed mode):

"Thread-9" prio=1 tid=0x088d0110 nid=0x22b8 runnable [0x857ab000..0x857ac228]
       at java.net.SocketInputStream.socketRead0(Native Method)
       at java.net.SocketInputStream.read(SocketInputStream.java:129)
       at oracle.net.ns.Packet.receive(Unknown Source)
       at oracle.net.ns.DataPacket.receive(Unknown Source)
       at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
       at oracle.net.ns.NetInputStream.read(Unknown Source)
       at oracle.net.ns.NetInputStream.read(Unknown Source)
       at oracle.net.ns.NetInputStream.read(Unknown Source)
       at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:978)
       at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:950)
       at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:447)
       at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:183)
       at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:872)
       at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
       at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3000)
       at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3042)
       - locked <0x91feaae8> (a oracle.jdbc.driver.T4CCallableStatement)
       - locked <0x91e29b38> (a oracle.jdbc.driver.T4CConnection)
       at oracle.jms.AQjmsConsumer.dequeue(AQjmsConsumer.java:1601)
       at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:922)
       at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:835)
       at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:776)
       at oracle.tip.adapter.b2b.data.MsgListener.run(MsgListener.java:366)
       at java.lang.Thread.run(Thread.java:534) 

Tuesday, 22 March 2011

ServerURL and Callback Server URL in SOA 11g, 10G

This question or need for setting property really arises when you want a cluster setup or predominantly when you have a software or a hardware load-balancer which takes the requests and routs.


In 10g We would configure this Call back url and server URL by following steps:


  1. Set the soapServerURL and the soapCallbackUrl to the same value as the load balancer URL:
    1. Open the ORACLE_HOME/bpel/system/config/collaxa-config.xml file.
    2. Set the soapServerUrl and soapCallbackUrl to the HTTPS URL, so that the entries resemble the following:
      ...
          <property id="soapServerUrl">
              <name>BPEL soap server URL</name>
                 <value>https://soa.mycompany.com</value>
      ...
          </property>
      ...
          <property id="soapCallbackUrl">
              <name>BPEL soap callback URL</name>
                 <value>https://soa.mycompany.com</value>
      ...
          </property>
      
  2. Restart the OC4J_SOA instances on both computers.

Source: Oracle® Application Server Enterprise Deployment Guide 10g Release 3 (10.1.3.1.0)
Part Number B28939-03
Section: Section: 3.1.12 Configuring the Cluster of BPEL Instances

Now the same can be achieved in 11g by following the steps from:

1. Right Click on SOA-INFRA component in the left navigation tree. Go to Soa Administration --> Common Properties 



2. Set the CallBackServerURL and the ServerURL to  http://deskLinux:8001 and click Save button


3. Restart SOA server to activate the changes . The URL should now be modified for all composites.


Source: Thanks to Mihai's Blog.
ServerURL and Callback Server URL in SOA 11g

Reference:
Document: Oracle® Fusion Middleware Enterprise Deployment Guide for Oracle SOA Suite 11g Release 1 (11.1.1)
Part Number E12036-01

Section: 5.17 Setting the Frontend HTTP Host and Port - Callback URL


Sunday, 20 March 2011

Configurable Properties and Reference Binding for Oracle JCA adapters 11g

If you would like to know what are all the configurable properties and reference binding for oracle JCA adapters 11g

Please refer this document:

Oracle® Fusion Middleware Administrator's Guide for Oracle SOA Suite
11g Release 1 (11.1.1)

Section: 33 Configuring Service and Reference Binding Components


Source: Oracle Documentation. OTN.

This included, but not limited to, configuration properties for: DB adapter, File Adapter, FTP Adapter, AQ Adapter, MQ Series Adapter, Oracle Socket Adapter, Oracle JCA Adapters Endpoint Properties.

Thursday, 17 March 2011

Difference between Sync and Async BPEL process -- Well explained.

This below blog contains all the essential to differentiate or understand the differences between the Sync and Asyn BPEL process.

Difference between Sync and Async BPEL process - anindyabhattacharjee

Well explained Anindya. Hats off.....

Just for quick reference and to find the differences: if you look in to the source code of the .BPEL file you will find the following respective to the to different BPEL process:

Async BPEL process will contain:  Receive and Invoke for the call back.

 <sequence name="main">
        <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1_Async.wsdl) -->
        <receive name="receiveInput" partnerLink="bpelprocess1_async_client" portType="client:BPELProcess1_Async" operation="process" variable="inputVariable" createInstance="yes"/>
        <!--
          Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
        -->
        <invoke name="callbackClient" partnerLink="bpelprocess1_async_client" portType="client:BPELProcess1_AsyncCallback" operation="processResponse" inputVariable="outputVariable"/>
    </sequence>

Sync BPEL process will contain: Receive and a Reply.

  <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in Sync_realSync.wsdl) -->
    <receive name="receiveInput" partnerLink="sync_realsync_client" portType="client:Sync_realSync" operation="process" variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <reply name="replyOutput" partnerLink="sync_realsync_client" portType="client:Sync_realSync" operation="process" variable="outputVariable"/>
  </sequence> 

How To Configure a Read Only or Read & Deployment Only or Restricted User For Oracle SOA 11g Enterprise Manager Console


If you  would like to create or configure a user, Who only has read and deploy composites permissions (Restricted Access) in EM console please do the following:

Access to the Enterprise Manager console is determined by the role assigned to the user. See Appendix C.1 Roles and Privileges in:
Document Reference: Oracle® Fusion Middleware Administrator's Guide for Oracle SOA Suite and Oracle Business Process Management Suite 11g Release 1 (11.1.1.4.0) - Part Number E10226-06

Section: C.1.1 Overall Role Functionality Matrix
For a description of the roles defined and the access granted to each role.

Steps to configure the roles described in the document document: (In this case we assign the Monitor role to the user created)

  1.  Log in to the Weblogic console.
  2. Click on Security Realms -> the name of the realm (myRealm is the default) -> Users and Groups.
  3. Click on New to create a new user.
  4. Click on the name of the user just created, then Groups and move Monitors from the list on the left to the right. Click Save.
  5. Now log in to the Enterprise Manager console with admin privileges, open the SOA folder and right-click on soa-infra and select Security -> Application Roles.
  6. Leave the search text empty and click on search button. This will give you a list of all Application Roles.
  7. Click on SOAMonitor role to edit it.
  8. Scroll down and click on add user. Click on the search button, and a list of available users will be populated. You should see the user just created on the Weblogic console. Move the user to the right and click OK and OK again.
  9. Log out, then log in with the user just created.


Additional Info: If you are keen in learning about the roles and their restrictions on weblogic server console please refer:


Document: Oracle® Fusion Middleware Securing Resources Using Roles and Policies for Oracle WebLogic Server 11g Release 1 (10.3.4) - Part Number E13747-04
Section: 6 Users, Groups, And Security Roles



Tuesday, 15 March 2011

Oracle SOA JMS Adapter Tuning - Number of Inbound Threads


To improve performance, the adapter.jms.receive.threads property can be tuned for an adapter service. The default value is 1, but multiple inbound threads can be used to improve performance. When specified, the value of adapter.jms.receive.threads is used to spawn multiple inbound poller threads.


For example:

<service name="dequeue" ui:wsdlLocation="dequeue.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/jms/textmessageusingqueues/textmessageusingqueues/dequeue%2F#wsdl.interface(Consume_Message_ptt)"/>
<binding.jca config="dequeue_jms.jca">
<property name="adapter.jms.receive.threads" type="xs:string" many="false">10</property>
</binding.jca">
</service>


These setting need to be done in 10g - BPEL.xml or 11g Composite.xml


In this case  there will be 10 concurrently processing threads.

How can I throttle (Frequency) inbound message flow 10g and 11g- For Adapters Like JMS, File, AQ.

There is an activation agent (bpel.xml) property (since 10.1.3.1), which can be used to control the speed at which the adapter posts messages to BPEL

 ...
    <activationAgents>
         <activationAgent partnerLink="JmsDequeuePL" ... >
           <property name="minimumDelayBetweenMessages">1000</property>
       </activationAgent>
    </activationAgents>
  </BPELProcess>
</BPELSuitcase>
The same setting in 11G would be configured as a binding property in the composite.xml the corresponding (inbound) <service>, e.g.
<service name="Inbound">
  <interface.wsdl interface="http://xmlns.oracle.com/pcbpel/demo1#wsdl.interface(SampleInbound_PortType)"/>
  <binding.jca config="Dequeue_jms.jca">
    <property name="minimumDelayBetweenMessages">1000</property>
  </binding.jca>
</service
 
 This setting ensures that there at least will be 1000 milli seconds delay between two consecutive messages being posted to the BPEL process.

Note: This setting pertains only to BPEL, and only to one adapter polling thread. If multiple adapter polling threads (e.g. multiple JMS dequeuer threads) have been configured, this setting will control the speed of each thread, not the combined speed.

Thursday, 10 March 2011

Siteminder sso cookie does not clear once the App is logged out.



The issue:

If you have setup siteminder sso with oracle fusion middleware.
The fusion middleware application comes with Oracle B2B and Worklist application.Once a user login though sso in these application,the logout button dosent work or complets the loop.
We need a way to clear the siteminder sso cookie once the logout button is clicked.
Please suggest a way to make this customization in the apps.


The solution:

The solution seems to be configuring in SiteMinder: configure the logout URL in the app as a SiteMinder logout URL

Steps are as:

1) Find the URL of the logout action in the app (from the docs, by hovering over it, or by tracing the HTTP traffic)
2) Open the SiteMinder Web Agent configuration (either in the SiteMinder console or in the local WebAgent config file) and add a LogOffUri setting to reflect the above URI. Note: this is a URI not a URL. So remove the http://hostname portion.

if you are not the siteminder administrator, You can pass this info to the SiteMinder administrator and they should know exactly what it means.

Oracle 11g DB vs Microsoft SQL 2008

Once when I visited one of my friends, My friend and I had a (so called healthy) Debate between Oracle 11g DB vs Microsoft SQL 2008.

I was towards oracle's performance and high cost and my friend was towards MS DB and its benifits of being low cost and may be better performance...

After a while... this kind of continued in a email... My friend sent me this PDF document

Twelve ways to reduce costs with SQL Server 2008 - White paper1.pdf

For my review and reading....

As a counter response or you can say to continue the healthier side of the debate... I sent the below response...

Hi Friend,

Had some time in hand to read the PDF that you sent me... thanks for this... now as this is in front of the table...looks like I was right 100%...

Now the Twelve ways to reduce costs with SQL Server 2008 - White paper1.pdf that you attached talks only about cost and cost reduction... and I believe I agreed that Oracle is very very very expensive compared to MS 2008 and I believe I also stated only Enterprise Architecture budget can only offered Oracle... this document does not tell any thing about performance and benchmark comparison with matching cost ....

Now I believe this PDF that you have provided is a sales pitched document.... now I would like to provide my side of refference:

Comparative Management Costs Stud - By Edison group    ---> this is not an oracle document.... (Thanks to google in helping me find one) ... 

A third party comparative Study, this is cost with performance and DBA Management.... Read the conclusion of both, your reference and my reference, and you will know what I was really about and how they compare.... But do read the report in detail for knowledge sake...

The fact speaks out in terms of comparative  study....

Hope this helps you get some insight in comparison. I believe this was a healthy debate.

Cheers,
Arun.

Tuesday, 22 February 2011

Oracle AIA PIP 2.5 10g Certification Matrix

If you are looking for certification matrix for AIA PIP 2.5 with Oracle Fusion Midleware SOA please have a look at the below link:

http://www.oracle.com/technetwork/middleware/foundation-pack/aia10-25-certmatrix-167573.xls

Source: Oracle.

Monday, 21 February 2011

Migrating SOA (Oracle Fusion Middleware) from 10g to 11g - Certification Matrix.

If you are upgrading from SOA (Oracle Fusion Middleware) 10g to 11g and wondering about what products will run on what Database and Operating Systems:

Visit this certification page from Oracle:

http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html

And you might want to  view xls files within this page for any specific product certifications.

Source: Oracle.

What is good about SOA? -- CEO Point of View.

SOA enables development of a new generation of dynamic enterprise applications that address a number of business concerns that are central to growth and competitiveness. SOA solutions promote and promise number of benefits to an enterprise, e.g. enhanced decision making, stronger connection with customers and partners, more productive and flexible applications etc. 


Source: Oracle.


Please post your questions here, if you have any... I will try and get you the answer.

Blog Purpose.

My Intention for this blog is to publish (Blogish) my knowledge about development and management of  systems integration softwere.

This can be useful to all it's readers.

Wish me "All the best".

Cheers.

Note: In some instances, I might have quoted statements from different sources. And the statements might be the copy right of the source. If you find a breach on any of the content published in this blog, please advise me about the breach and I will definitely react to the notice.