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.