- Oracle SOA Suite 11g Performance Tuning Cookbook
- Matthew Brasier Nicholas Wright
- 347字
- 2021-08-13 16:51:41
Identifying slow-running database queries
SOA Suite applications make heavy use of the database. Identifying the database queries that are running slowly can allow you to identify areas where performance improvements can be made by tuning or reducing the amount of database access.
Getting ready
You will need SOA Suite installed and running, and have loaded it with representative load or live data.
This recipe requires that you are able to log in to the SOA Suite database as an administrator and are able to execute the necessary SQL statements.
How to do it…
- Log in to the SQL database as an administrator.
- Execute the following SQL query:
SELECT * FROM (SELECT sql_fulltext, sql_id, child_number, disk_reads, executions, first_load_time, last_load_time FROM v$sql ORDER BY elapsed_time DESC) WHERE ROWNUM < 10 /
This will return the top 10 recent slowest SQL statements, although statements eventually get removed from the
v$sql
table. So, this will contain statements that have been recently executed.
How it works…
Oracle SOA Suite makes very heavy use of the database, being able to identify the queries that take the longest time, which allows these to be optimized. The v$sql
table in Oracle is a virtual table that contains the statistics about the recently executed SQL statements, so it can be used to identify the statements that take the longest to execute.
There are a number of ways of discovering slow-running database queries, but we have selected the preceding method because it is simple and easy to understand. More complex statistics can be used to identify exactly what it is that is causing queries to run slowly.
Once you have identified slow-running database queries, the steps you need to take to resolve them depends upon what the queries are. If they are application-related queries, then you can focus on changing the application code, but if they relate to Oracle SOA Suite itself, then you will have to look at things like reducing the amount of logging and persistence in your application, or rearchitecting it to behave differently.
See also
- Chapter 7, Data Sources and JMS
- Building E-commerce Sites with VirtueMart Cookbook
- 物聯(lián)網(wǎng)安全(原書第2版)
- INSTANT PhpStorm Starter
- 物聯(lián)網(wǎng)概論(第2版)
- 物聯(lián)網(wǎng)關(guān)鍵技術(shù)及應(yīng)用
- 通信簡史:從信鴿到6G+
- Socket.IO Real-time Web Application Development
- 物聯(lián)網(wǎng)通信技術(shù)
- 網(wǎng)管員必讀:網(wǎng)絡(luò)管理(第2版)
- Scala Design Patterns.
- 網(wǎng)絡(luò)利他行為研究:積極心理學(xué)的視角
- Practical Web Penetration Testing
- 大型企業(yè)微服務(wù)架構(gòu)實(shí)踐與運(yùn)營
- 基于IPv6的家居物聯(lián)網(wǎng)開發(fā)與應(yīng)用技術(shù)
- 圖解物聯(lián)網(wǎng)