
{"id":8008,"date":"2019-01-18T08:03:49","date_gmt":"2019-01-18T08:03:49","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/database-performance-tuning\/"},"modified":"2026-11-03T19:29:13","modified_gmt":"2026-11-03T19:29:13","slug":"database-performance-tuning","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/database-performance-tuning\/","title":{"rendered":"Database performance tuning"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>Doing performance tuning on your database is one of the most common and yet the&nbsp;most important activity that every database administrator (DBA) must perform on&nbsp;an ongoing and regular basis. Experts recommend that you regularly fine-tune&nbsp;databases to optimized performance. Fine-tuning helps users to run their reports&nbsp;and queries faster and get results quicker. This post shares some techniques for&nbsp;troubleshooting and tuning Oracle&nbsp;\u00a9; databases.<\/p>\n<p><strong>Tuning steps<\/strong><\/p>\n<p>To start with, you need to identify the area where the problem is occurring.Possible areas that can trigger the problem include the operating system,&nbsp;database, memory shortages, and so on. After you have identified a problem area,&nbsp;you can proceed with tuning the area for maximum benefits. This blog focusses&nbsp;on only performance tuning.<\/p>\n<p>Oracle has given DBAs a few tools to help with diagnosing problems and&nbsp;troubleshooting performance issues. These tools include the Automatic Database&nbsp;Diagnostic Monitor (ADDM) and Automatic Workload Repository (AWR) reports, which&nbsp;you can generate for the problematic time-period and use in your analysis. You&nbsp;should use the tools to look for skewed or tunable components.<\/p>\n<p><strong>&nbsp;Top Timed Events in AWR reports<\/strong><\/p>\n<p>AWR is a tool with which you can generate a report that summarizes memory usage&nbsp;in a statistics form by a particular instance. To generate an AWR report,&nbsp;run the following file in a sqlplus prompt:<\/p>\n<p><em>&nbsp; &nbsp; @$ORACLE_HOME\/rdbms\/admin\/awrrpt.sql<\/em><\/p>\n<p>\nThis generates an AWR report in HTML format by &nbsp;using a pre-stored template.&nbsp;After you have generated the AWR report, you can quickly see the <strong>Top Timed&nbsp;Events<\/strong> section in the AWR report, which identifies the problematic area, as&nbsp;shown in the following image:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture1_2.png\" alt=\"database tuning pic 1\" \/><\/p>\n<p><strong>&nbsp;ADDM tuning Session&nbsp;<\/strong><\/p>\n<p>Normally, when an issue is reported, the DBA might troubleshoot only that area&nbsp;or resolve that specific problem. However, if the issue is not correctly&nbsp;identified and addressed, it might lead to bigger problems in future. The DBA&nbsp;can miss the bigger picture here. To help DBAs get a bigger and a complete&nbsp;picture about database issues, Oracle has provided another tool for DBAs, ADDM.&nbsp;An ADDM tuning session follows a procedure similar to the manual tuning session.&nbsp;The following image shows a comparison:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture2_2.png\" alt=\"database tuning pic 2\" \/><\/p>\n<p><a href=\"  Oracle 11G Performance Tuning training manual\"><em>Image Source<\/em><\/a>&nbsp;<\/p>\n<p>Retrieve ADDM reports by using SQL or through Oracle Enterprise Manager (OEM).&nbsp;The following image shows sample SQL:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture3.png\" alt=\"database tuning pic 3\" \/><\/p>\n<p><strong>&nbsp;Bad SQL and execution plans&nbsp;<\/strong><\/p>\n<p>After the AWR or ADDM report identifies sections of bad SQL\/SQLID, you can use&nbsp;DBMS\\_XPLAN to gather more information about them. The DBMS_XPLAN package&nbsp;supplies the following table functions that you can use to retrieve and display&nbsp;the execution (exec) plan:<\/p>\n<p><em>&nbsp; &nbsp; DISPLAY<br \/>\n&nbsp; &nbsp; DISPLAY_AWR<br \/>\n&nbsp; &nbsp; &nbsp;select plan_table_output from table (DBMS_XPLAN.DISPLAY_AWR(&#8216;fs22b3fgfh8xc&#8217;));<br \/>\n&nbsp; &nbsp; DISPLAY_CURSOR<\/em><\/p>\n<p>The following image shows sample output from the `EXPLAIN PLAN` command and&nbsp;identifies whether the query is using a full table scan or narrowing down the&nbsp;data by using some indexes:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture4.png\" alt=\"database tuning part 4\" \/><\/p>\n<p>ADDM reports reflect whether you can achieve any performance benefit by creating&nbsp;some new indexes. You can also run the SQL Tuning Advisor from OEM to fine tune&nbsp;the queries and possibly use a better execution plan. Most of the time, using&nbsp;a better plan for problematic SQL resolves the major performance issue.&nbsp;<\/p>\n<p><strong>SQL Tuning Advisor<\/strong><\/p>\n<p>SQL Tuning Advisor helps analyze SQL statements and obtain performance&nbsp;recommendations by using SQL authorization ID (SQLID) to analyze and suggest&nbsp;solutions. SQL Tuning Advisor analyzes the following sources:<\/p>\n<ul>\n<li>&nbsp;Top activity: Analyzes the top SQL statements currently active.<\/li>\n<li>&nbsp;SQL tuning sets: Analyzes a set of SQL statements that you provide.<\/li>\n<li>&nbsp;Historical SQL (AWR): Analyzes SQL statements from statements collected by&nbsp;AWR snapshots.<\/li>\n<\/ul>\n<p>The following screenshots show some examples:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture5.png\" alt=\"database tuning pic 5\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture6.png\" alt=\"database tuning pic 6\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture7.png\" alt=\"database tuning pic 7\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture8.png\" alt=\"database tuning pic 8\" \/><\/p>\n<p><strong>&nbsp;Long running requests&nbsp;<\/strong><\/p>\n<p>\nIn Oracle eBusiness Suite databases, the issue of long running requests mostly&nbsp;crops up where a few concurrent requests keep on running. To resolve this, you&nbsp;need to gather more information about the database session associated with the&nbsp;concurrent requests. The following image shows steps to collect this&nbsp;information:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture9.png\" alt=\"database tuning pic 9\" \/><\/p>\n<p><strong>Oracle Database memory parameters&nbsp;<\/strong><\/p>\n<p>After reviewing the AWR reports, a DBA can easily identify the cache that&nbsp;requires fine tuning because the cache hit ratio is lower for that cache than&nbsp;it is for other caches. &nbsp;The following image shows a few of the top database&nbsp;parameters that you must consider for instance-wide memory tuning.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture10_0.png\" alt=\"database tuning  pic 10\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture10.png\" alt=\"database tuning pic10\" \/><\/p>\n<p><a href=\"https:\/\/ora-performance-tuning.blogspot.com\/2014\/02\/automatic-shared-memory-management.html\"><em>Image Source<\/em><\/a>&nbsp;<\/p>\n<p><strong>Commonly observed wait events<\/strong><\/p>\n<p>\nThe following table shows some common wait events and their possible causes::<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26579-body-Picture11.png\" alt=\"database tuning  pic 11\" \/><\/p>\n<p><em>Table source: Oracle Performance Tuning 11G OCP training manual, &nbsp;chapter 20, page 24&nbsp;<\/em><\/p>\n<p>&nbsp;<strong>Top 10 tuning issues<\/strong><\/p>\n<p>Customers commonly face the following top 10 tuning issues:<\/p>\n<p><strong>Bad connection management&nbsp;<\/strong>&nbsp;Developers write the code to connect to the&nbsp;database in the application or run queries to fetch the data from the database.&nbsp;After the data has been fetched and nothing more is required, the code should&nbsp;close the connection to the database. However, this often doesn&#8217;t happen, which&nbsp;leads to an increased number of inactive sessions in the database. These sessions<br \/>\nuse precious resources that could have been used for other active connections.<\/p>\n<p><strong>Bad use of cursors and shared pool:<\/strong> A cursor is a tool in the arsenal of&nbsp;a Developer that mostly stay unutilized. Without cursors, Oracle has to hard&nbsp;parse the code every time it&#8217;s run. This hugely impacts the performance of SQL&nbsp;queries that are run repeatedly. A DBA can identify this problem by looking into&nbsp;the <strong>Instance Efficiency Percentages &#8211; Execute to Parse %.&nbsp;<\/strong>&nbsp;AWR report section.<\/p>\n<p><strong>Bad SQL:<\/strong>&nbsp;The way that an SQL query is written (with join conditions to&nbsp;fetch the data) significantly affects the performance of that SQL, after it&#8217;s&nbsp;executed. You should avoid full table scans for large tables. After SQL has&nbsp;been prepared, developers and DBAs should run an explain plan on that SQL to&nbsp;understand the cost of running it in the database. By using cursors, bind&nbsp;variables, and indexes, you can increase the efficiency.<\/p>\n<p><strong>Use of nonstandard initialization parameters:&nbsp;<\/strong>DBAs should always use only&nbsp;standard or recommended initialization parameters. Use non-standard initialization&nbsp;parameters only when they are suggested by an Oracle Service Request (SR).<\/p>\n<p><strong>Getting database I\/O wrong<\/strong>: When a DBA choosing database hardware should&nbsp; try to distribute the database over multiple disks and involve the network team&nbsp;in a discussion about the speed with which data will be traveling to end users&nbsp;from the database server and back. A DBA should take into consideration the&nbsp;speed of the network switches and routers to avoid any bottleneck or performance<br \/>\nissues.<\/p>\n<p><strong>Redo log setup problems<\/strong>: Redo logs are required to store the data from&nbsp;redo buffer so that Oracle can redo the transactions in case of any crash. If&nbsp;the redo log size is inadequate, then multiple switches might happen in the&nbsp;database that cause performance issues. This also increases the load on the&nbsp;archive generation.<\/p>\n<p><strong>Serialization of data blocks in the buffer cache:<\/strong>&nbsp;This happens due to&nbsp;a shortage of free list groups or undo segments. This situation arises for&nbsp;insert-heavy databases with a large base of active users but fewer undo segments,&nbsp;which ultimately leads to performance issues.<\/p>\n<p><strong>Full table scans<\/strong>&nbsp;Check for full table scans in queries by running an&nbsp;explain plan. Normally, a query that does full table scans reflects bad SQL&nbsp;design, which can be corrected by using indexes and by narrowing the data&nbsp;required. In few cases, full table scans can be beneficial, especially in the&nbsp;case of small tables.<\/p>\n<p><strong>Recursive SQL:&nbsp;<\/strong>Recursive SQL can be a boon to developers if used correctly,&nbsp;but it can be a double-edged sword. Done right, it provides the output&nbsp;efficiently. Otherwise, it hugely impacts the performance of the database<\/p>\n<p><strong>In-disk sorting<\/strong> In-disk sorting is a very expensive task for database.It indicates poor SQL design and bad optimization. You can identify the issue&nbsp;in the <strong>Instance Activity Stats \u2013 Sorts (disk)<\/strong>&nbsp;AWR report section.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>While DBAs must consider different areas for performance tuning, in the database world, performance tuning starts from the database and application design stage.Databases and applications that are designed with performance tuning perspective&nbsp;in mind are much more scalable than applications designed without performance&nbsp;tuning consideration.The performance tuning points covered in this blog are just a tip of the iceberg.&nbsp;I recommend that fellow DBAs keep reading more on the topic to take care of the&nbsp;database performance overall.<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Database performance tuning<\/p>\n","protected":false},"author":2,"featured_media":8010,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26579","content_type":"blog","created_by":"10130","authored_on":"2024-02-06T08:03:49+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Ashish Malik, Professional Services Delivery Architect, Rackspace Technology","seo_description":"Learn essential techniques for troubleshooting and tuning Oracle databases to optimize performance, improve query speed, and enhance overall system efficiency.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26579-insights_image-oracle-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"Oracle","product":"","publisheddate":"2019-01-18T08:03:49","rxt_solutions":"Applications, Data, Databases","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Database Performance Tuning: Techniques for Oracle Databases | Rackspace Technology","field_topics":"","field_slug":"database-performance-tuning","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-8008","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=8008"}],"version-history":[{"count":3,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8008\/revisions"}],"predecessor-version":[{"id":9826,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8008\/revisions\/9826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/8010"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=8008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=8008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=8008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}