Oracle7 Server Tuning | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
This chapter introduces the full range of diagnostic tools that are available for monitoring production systems and determining performance problems.
On the other hand, if your application does not contain an audit table, you might not want to add one: it would delay performance. Consider the trade-off between the value of obtaining the information and the performance cost of doing so.
See Also: Your operating system documentation for more information on platform-specific tools.
See Also: Chapter 19, "The Dynamic Performance Tables"
Oracle7 Server Reference provides detailed information about each view.
See Also: Chapter 21, "The SQL Trace Facility and TKPROF".
Tuning is much easier where a baseline exists, either from a capacity study performed for this application or (even better) data from this or another site running the same application with acceptable performance. The task is then to identify all differences between the two environments and attempt to bring them back into line.
Where no directly relevant data can be found, you can check data from similar platforms and similar applications to see if they have the same performance profile. There is no point in trying to tune out a certain effect if it turns out to be ubiquitous!
See Also: Chapter 19, "The Dynamic Performance Tables"
Oracle7 Server Reference provides detailed information about each view.
See Also: Oracle Server Manager User's Guide for a description of all the monitors and how they relate to the V$ views.
See Also: Oracle SNMP Support Reference Guide.
EXPLAIN PLAN results should be interpreted with some discretion. Just because a plan does not seem efficient on the surface does not necessarily mean that the statement will run slowly. Choose statements for tuning based upon their actual resource consumption, not upon a subjective view of their execution plan.
See Also: Chapter 20, "The EXPLAIN PLAN Command"
See Also: Chapter 21, "The SQL Trace Facility and TKPROF"
See Also: Chapter 23, "Registering Applications"
The Oracle Performance Manager tracks real-time memory performance in several ways, providing data that can be immediately put to use for memory performance management. For example, the Parse Ratio Chart gives the DBA a measure of the application's success at finding available parsed SQL in the database's library cache buffer; potentially indicating that Shared Pool memory allocation is insufficient. Monitor Charts can also be linked together, allowing the user to drill down in a logical progression of analysis. For example, if the DBA detects a performance problem with the Library Cache Hit Ratio, she can drill-down to the Library Cache Details Chart. Other memory monitoring charts include: Data Dictionary Cache Hit Ratio, Memory Allocated, and Sort Hit Ratio, to name a few.
User-defined charts can be created through the Oracle Performance Manager for virtually any data in your database, whether this data is database performance related or data from your business application tables that you want to chart. Oracle Monitor provides dialog boxes for entering the SQL to retrieve the data, for defining operations to be performed on the data, and for selecting the type of chart best suited to graphically display the data. The ability for the user to define his own charts can be combined with the power of Oracle Trace to create custom charts for monitoring application performance, application audit trails, or business transaction data. Using Oracle Trace in this way will be discussed in more detail later.
Performance problems detected by using the Oracle Monitor can be corrected by using other Oracle Enterprise Manager applications. For example; memory management problems that might be corrected by modifying buffer sizes can be easily done using the Oracle Instance Manager application to reset buffer size parameters. Likewise, the DBA could address I/O or contention problems by using the Oracle Storage Manager application to reset storage parameters, or the Oracle Tablespace Manager application to further analyze the problem and defragment tables if necessary.
In addition, a DBA detecting performance problems through the Oracle Monitor can obtain a far greater degree of detail through two other Performance Pack applications: Oracle TopSessions and Oracle Trace. Ultimately, the DBA can elect to have a detailed tuning analysis conducted by the Oracle Expert automated performance tuning application. Oracle Expert produces recommendations and scripts for improving the performance of the database being monitored.
The Oracle TopSessions application provides the DBA with a focused view of performance activity for the top n Oracle sessions at any given time. Oracle TopSessions extracts and analyzes sample Oracle dynamic performance data, automatically determining the top Oracle user sessions based on a specific selection criteria, such as file I/O activity. Using Oracle TopSessions, the DBA can quickly detect which user sessions are causing the greatest file I/O activity and require further investigation.
Oracle TopSessions provides two views of session data: an Overview of a select number of top sessions, and a Session Details view. The application starts with an overview of the top ten sessions connected to the database instance, with an initial default sort based on session PGA memory usage. The data displayed in the initial overview includes items such as: session ID, node, application, username, last session command executed, and the status of the session (idle, active, blocked or killed). The user can then customize the display by changing the number of sessions to be monitored, and can select the type of statistical filtering and sorting to be done for the Overview display of monitored sessions.
The Session Details display allows the user to drill down into a particular session, providing pages for detailed displays of general session information, session statistics, cursors, and locks. The Session Details General Page expands the information provided in Overview display, adding information such as identifiers for the schema, SQL, deadfalls, rows, and blocks as applicable. The Statistics Page displays detailed performance statistics for the session that are captured from the V$SESSTAT view. The Cursors page provides information on all shared cursors for the session, including SQL Statements and Explain Plans. The user has the option of displaying the session's currently executing SQL statements, or displaying all SQL statements that have and will be executed for the session. The Session Details Locks Page displays information about the database locks held or requested by session.
A DBA monitoring multiple instances can open as many Oracle TopSessions displays as necessary. The information displayed in Oracle TopSessions is static until refreshed. Oracle TopSessions allows the user to determine if the refresh should be manual or automatic, and the frequency of automatic refresh.
The Oracle Trace product provides a new data collection methodology that goes a significant step further than sampling techniques. Oracle Trace collects performance data for each and every occurrence of key events in an application being monitored. It provides an entire census of performance data, rather than a sample of data, for a software application or database event. This allows performance problems detected through sampling techniques to be pinpointed to specific occurrences of a software product's execution.
Oracle Trace will collect performance data for pre-defined events in products such as the Oracle Server, SQL*Net, and any other Oracle or third party application that has been programmed with Oracle Trace data collection API. An Oracle Trace "event" is an occurrence within the software product containing the Oracle Trace API calls. For example, specific events have been identified in the Oracle Server, such as a SQL parse, execute, and fetch. These events have been delimited with API calls, which are invoked when the event occurs during a scheduled Oracle Trace collection for the Oracle Server. Another example of an "event" to be monitored for performance data would be a transaction in an application, such as a "deposit" in a banking application. Any product can be programmed with Oracle Trace API calls for event-based data collection.
The type of performance data collected for events includes extensive resource utilization data, such as CPU time, memory usage and page faults, as well as performance data specific for the product being monitored. For example, user and form identification data would likely be collected for business application events, in addition to resource utilization data for those events. In addition, Oracle Trace provides the unique capability to correlate the performance data collected across any end-to-end client/server application containing Oracle Trace instrumented products. Performance can be tracked across multiple products involved in the enterprise transaction, allowing the application developer, DBA, or systems manager to easily identify the source of performance problems.
From a DBA's perspective, the value of Oracle Trace is embodied in the products that use Oracle Trace data for analysis and performance management. DBAs and other users do not have to instrument an application in order to use Oracle Trace, rather, the majority of users will employ Oracle Trace to collect data for a product that already contains the API calls, and will likely use the collected data in some other tool that performs monitoring or analysis. For example, Oracle Server release 7.3 and SQL*Net 2.3 contain Oracle Trace API calls for event data collection. An Oracle Trace user will be able to schedule a collection of Oracle Trace data for either of these products, format the data and review it in reports. In addition, Oracle Trace data for Oracle Server 7.3 can be imported into the Oracle Expert database tuning application, where it will be automatically analyzed for Oracle server tuning.
See Also: Chapter 22, "Oracle Trace Methodology"
The Tablespace Viewer provides the administrator with a complete picture of the characteristics of all tablespaces associated with a particular Oracle instance, including: tablespace datafiles and segments, total data blocks, free data blocks and percentage of free blocks available in the tablespace's current storage allocation. The DBA has the option of displaying all segments for a tablespace or all segments for a datafile. The Tablespace Viewer also provides a map of the organization of a tablespace's segments. This map graphically displays the sequential allocation of space for segment extents within a selected tablespace or datafile. For example, a table segment may consist of three extents, all of which are physically separated by other segment extents. The map will highlight the locations of the three extents within the tablespace or datafile. It will also show the amount of free space available for each segment. In this way, the Tablespace Viewer map provides the DBA with an easy birds-eye view of tablespace fragmentation.
When tablespace fragmentation is detected, the DBA can use the Oracle Tablespace Manager defragmentation feature to automatically correct the problem. The DBA can select a table for defragmentation from the list of table segments. The defragmentation process uses the Oracle export/import functions on the target table, and ensures that all rows, indexes, constraints and grants will remain intact. Before the table export occurs, the DBA is presented with a dialog box for modifying the storage parameters for the selected table if desired. The new parameters will then be used in the re-creation of the defragmented table. The DBA also has the option of compressing the table's extents into one large initial extent.
In addition to managing fragmentation, a DBA must watch for opportunities to more effectively use available database resources. A database incurring lots of updates and deletes will develop empty data blocks; pockets of free space that are too small for new extents. The Tablespace Manager Viewer allows the DBA to visually identify free blocks. If these free blocks are adjacent, they can be automatically joined using the Oracle Tablespace Manager's coalesce feature. In this way they will become more useful space for future extents.
After Oracle Expert has analyzed the data, the user can review the recommendations, including selectively viewing the detailed analysis. The user can choose to accept specific recommendations before generating the recommendation implementation files, which generally consist of new instance parameter files and implementation scripts. The user has full control over the implementation process. The implementation files can be invoked when the user is ready, and will automatically implement the changes the user has accepted. Oracle Expert also produces a series of reports to document the data and analysis behind the recommendations. These reports provide extensive documentation for the database and tuning process. For the less experienced DBA, they can be a valuable education in the factors that drive database performance.
In summary, Oracle Expert, along with the other Performance Pack applications, provides the Oracle DBA with a useful set of tools for monitoring and tuning Oracle databases.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |