Вы находитесь на странице: 1из 5

Shreetam Naik Assistant Professor Susan Ann Dischiave IST 769: Advance Database Management April 4, 2011

Oracle Performance Tuning Practices

Introduction Oracle relational database management system (RDBMS) has been the most popular management system in use in organizations which include small businesses, government offices, financial institutions, large multinational firms and universities. It offers astounding power and flexibility to the systems in these organizations, and at same cost. It is a large and complex data-processing environment, including dozens of software components, hundreds of statements, commands, and utilities, and about 50 volumes of documentation. Oracle in practice has its administration and use shared by many people performing a number of specific design, administrative, and programming roles. With its multiplicity of functions and users comes the potential for diffusion-and confusion-when things go wrong. Because Oracle is a thoroughly tested and well-functioning system, what goes wrong isn t basic operation, but performance. With any large piece of software operating in the real world, the number of user increases as time goes on and organizational needs grow. More and more data needs to be managed, complex queries need to be processed and reports need to be produced. This article lists the best practices for performance tuning and explains their value for Oracle. Best Practices The need for system performance has become a necessity as we enter into the new era of non-stopping improving technologies, with systems getting more complicated and internet playing a major role in business applications. In order to counter its necessity, Oracle has come up with several methodologies based on years of design and experience. Performance strategies are specific to different systems with different purposes, for example, operational systems and decision support systems which require different performance skills and therefore vary due to effectiveness. System performance is designed and built into a system. Performance problems result due to the malfunctioning of some system resource. When such an event happens, the system is unable to achieve higher levels of performance. This article focuses on the following two best practices which have been implemented into systems for better performance:

Best Practice 1: Performance Considerations for Initial Instance Configuration A running Oracle instance can be configured using initialization parameters, which can be found in the initialization parameter file. These parameters play an important role in regulating the behavior of running instance as well as performance. Generally, by changing the settings in the initialization files, performance tuning can be avoided. An exception to this case would be the parameters shown below that have an impact on performance. Parameter COMPATIBLE DB_BLOCK_SIZE SGA_TARGET Description It regulates the compatibility standards of the Oracle server. It sets the size of the Oracle database blocks stored in the database files and cached in the SGA. Specifies the total size of all SGA components.

PGA_AGGREGATE_TARGET Specifies the target aggregate PGA memory available to all server processes attached to the instance. PROCESSES SESSIONS UNDO_MANGEMENT UNDO_TABLESAPCE Sets the maximum number of processes that can be started by that instance. This is set by default from the value of processes. Specifies which undo space management mode the system should use. Specifies the undo tablespace to be used when an instance starts up.

Important Initialization Parameters with Performance Impact Configuring Undo space is another approach for improving performance. In case of the automatic undo management facility provided by the Oracle Corporation, a database in such state transparently creates and manages undo segments. Automatic undo management is strongly recommended by Oracle Corporation as it performs an important operation by simplifying the database management and thus removing the need of manually tuning of undo (rollback) segments. Manual undo management using rollback segments is supported for backward compatibility reasons.

The sizing of the redo log files has an impact on performance as the conduct of the database writer depends on the redo log sizes. Better performance is resulted when the redo log files are larger whereas performance is reduced because of undersized log files which increases checkpoint activity. Specific size recommendation of the redo log files is not possible always, but redo log files in the range of a hundred megabytes to a few gigabytes are considered reasonable. The redo log file (online) should be sized on the basis of the amount of redo the system generates. Best Practice 2: Creating and Maintaining Tables for Good Performance The best way to store heap-organized tables would be in a compressed format that is transparent for any kind of application. Table compression was primarily designed for read-only environments. The database block containing compressed data is self-contained which means that all the information, required for the re-creation of the uncompressed data in a block would be located within that block. A block can be found compressed within buffer cache. Table compression operates by the elimination of value repetitions within individual blocks. Before compressing large tables the expected compression factor should be estimated. The compression factor represents division between the necessary number of blocks for uncompressed form of information storage and necessary number of blocks for compressed from of information storage. The accuracy of the result depends on the number of blocks to be sampled. Special tuning is not required in many cases for Oracle to achieve a descent compression factor. The compression factor can be tuned by reorganizing the records when the compression actually takes place. Tuning has the capability of improving the compression factor from a small to a major extent. Reclaiming Unused Space is another strategy for maintenance of tables that leads to better performance. Usually due to repetitive update and delete operations the segment space becomes fragmented or acquires a lot of unused spaces. As a result the sparsely populated objects may suffer performance degradation during queries and DML operations. Oracle Database provides a remedy to this defect which is a Segment Advisor. This facility advises on the availability of space in an object for reclamation on the basis of the level of space fragmentation within an object.

Article Analysis The Oracle performance improvement methods can be applied until performance goals are met or deemed impossible. This process is highly iterative as some analysis may or may not have any impact on database performance. Time and experience are necessary to develop the skills to accurately and quickly pinpoint critical bottlenecks. But for Oracle 10g Release 2, the above mentioned best practices indeed are the best ones to improve the performance of the huge Oracle Database. In case of initial instance configuration, variable parameters (initialization parameters) are of particular interest to database administrators, because these parameters are used primarily to improve database performance. This is achieved by adjusting the memory structures. A separate redo thread for each instance avoids contention for a single set of redo log files, thereby eliminating a potential performance bottleneck. Creating and maintaining tables on a regular basis and in an orderly manner is one of the effective ways of improving performance. Due to the optimization of the relational data, reduction of disk space is better using Oracle table compression rather than standard compression algorithms. It has virtually no negative impact on the performance of queries against compressed data; in fact, it may have a significant positive impact on queries accessing large amounts of data, as well as on data management operations like backup and recovery. The Segment Advisor identifies segments that have space available for reclamation or the unused spaces. It performs its analysis by examining usage and growth statistics in the Automatic Workload Repository (AWR), and by sampling the data in the segment. Conclusion Tuning saves organization money in several different ways. Buying additional equipment can be avoided if the system is thoroughly tuned. The configuration of the system can be downsized to reap huge savings. The downsized system may give the same or even better performance than the larger or more expensive configuration. Pay for maintenance and for both hardware and software upgrades reduces if one has a less and a cheaper hardware. Saving on computer equipment and support saves a lot of money which can be spent on other resources in the organization. In this case tuning gives the organization a market advantage over its competitors. A high performance, well tuned system would obviously produce faster response times and better throughput within the organization. This increases the productivity of the users. This proves that the number of staff required to achieve same throughput would be halved after tuning the system. Therefore, performance is indeed an important factor in an organization and needs to be taken care of.

Glossary:  Automatic Undo Management- Oracle provides a fully automated mechanism, referred to as automatic undo management, for managing undo information and space. With automatic undo management, the database manages undo segments in an undo tablespace. Redo Log- consists of two or more pre-allocated files that store all changes made to the database as they occur. Every instance of an Oracle Database has an associated redo log to protect the database in case of an instance failure. Initialization Parameters- The initialization parameter file is a text file that contains a list of parameters and a value for each parameter. The file should be written in the client's default character set. Buffer Cache- The buffer cache is part of the SGA. It holds copies of data blocks so as they can be accessed quicker by oracle than by reading them off disk.

References:      Database. Merriam-Webster Online Dictionary. http://www.mw.com/dictionary/database Oracle Corporation. Oracle Database Performance Tuning Guide, 10g Release 1 (10.1). December 2003 Oracle Corporation. Oracle Database Concepts10g Release 2 (10.2). October 2005 Oracle Corporation. The World's Largest Commercial Database Runs Oracle. 05 April. 2006. <http://www.oracle.com/solutions/performance_scalability/winter2005.html>. Oracle Corporation. Client - Server Architecture - Metalink note 62142.1. 29 November 2001. 05 April 2006. <https://metalink.oracle.com>