Tuesday, October 19, 2010

What is Cross Tier (xtier) functionality in JVM Diagnostics (AD4J)?

Using JVM Diagnostics(AD4J), one can diagnose an issue across 3 tiers i.e. Java application<-> JVM <-> Database. User can relate an application activity to database activity. As of now, only oracle database is supported.
If cross tier is configured correctly, in real time user can see DB Wait link for active JVM threads that are busy in db activity. While in monitoring data, data appears in Top DB States and Top SQLs. One can use filters on them. By looking at Database pages, one can see JVM activity inside db.
Cross tier configuration requires: 
  • Java application and JVM with jamagent running and registered with console
  • Database to be monitored needs to be registered with console
  • Dbagent needs to be running on machine where database is running as same user who is running oracle database.
To ensure that cross tier is configured correctly:
1.            Navigate to Targets->Middleware->JVM Diagnostics->Setup->Databases page and ensure that database to be monitored is registered correctly. Verify following:
•             OS User field should specify the user who installed the database
•             DB User field should specify the DB application user credentials (Should have access to GV$ and V$ views)
•             DB User (Explain Plan) field should specify DB system user credentials
2.            DB Agent should be running on the machine on which DB is installed with correct manager IP and port
./dbagent jamconshost=<ManagerIP> jamconsport=<ManagerPort>
Note: On aix, either dbagent needs to run as root user or set the suid to root for dbagent binary.
3.            To verify cross tier functionality, go to Targets->Middleware->JVM Diagnostics. Select JVM on left Panel and click JVM->Threads->Real Time Analysis page for the JVM if you encounter a thread that is in the DB Wait state, it should be a hyperlink so you can follow the thread into the Database pages and see its database session information including the SQL that it executes.
In addition, if monitoring is started, data would appear in Top DBStates and Top SQLs table and charts.


Venkat said...

Thanks for very informative blog.
I have been trying to get cross tier functionality work using AD4J at a client site. As far as I know, I have registered databases correctly and deployed agents on required targets. I do see some data in TOP SQLs etc.. But I have never seen "DB Wait" link with hyperlink to get more informaiton on database SQL execution .
I did lot research but no luck in getting it to work. Can you please give any pointers on what else I need to check in terms of configurations to get xtier functionality working ?


Neelima Bawa said...

Hi Venkat,
you may like to confirm that hostname of db is same at all places. When you registered it, when application uses it and when dbagent tries to get it. That should ensure that DBwait link appears.