Previous | Table of Contents | Next

Page 531

whether a query performs a full table scan, you must obtain the query's execution plan. When an execution plan indicates that a full table scan is being performed, consider creating an index that the query can use.

NEW TERM
An execution plan is the method that the Oracle RDBMS uses to perform the tasks for an SQL statement. For example, if a table has no indexes, the execution plan to query the table will require that every row in the table be read; this is known as a full table scan.

Be alert to the possibility of overindexing a table. Remember that Oracle automatically maintains a table's indexes whenever the contents of the table change because of an INSERT, UPDATE, or DELETE statement. Your goal should be to optimize the most frequent queries without forcing Oracle to maintain an inordinate number of indexes.

Tuning an Oracle Database

Oracle performance-tuning efforts can be classified in three ways:

Your best bet is to focus on tuning efforts that have a minimal effect on the existing application.

Increasing the Size of the SGA
Among its other uses, the SGA functions as Oracle's cache. If you increase the number of data block buffers in the SGA, you increase the higher probability that an SQL statement will find the block that it needs in memory—thereby reducing the number of disk reads it needs to locate a block. However, be sure that the SGA isn't so large that it's swapped out of memory by the operating system. The number of database buffers used by an Oracle database is one of the initialization parameters that are used when an Oracle database is started. The new value for an initialization parameter doesn't take effect until the next time the database is started.

Reducing Disk Contention
To tune disk I/O, you must first determine if disk I/O requests are balanced across all the server's disk drives. Use operating system commands and utilities to identify the average

Page 532

number of I/O requests serviced by each disk drive. Your objectives should include the following:

Summary

This lesson covers the following principles regarding the management of Oracle users, database roles and privileges, and performance tuning:

Page 533

What Comes Next?

On Day 20, "Using Oracle Database Designer and Oracle Designer/2000 in Application Development," you will learn about the use two database design tools. Oracle Database Designer is used to develop a logical data model and automatically implement the physical database by generating the SQL DDL statements that create tables, indexes, and other objects. Oracle Designer/2000 is a comprehensive, multi-user design tool that enables you to design and create databases and applications for a large, complex enterprise.

Q&A

Q Can a database role be granted to another database role?
A Yes. You can grant a role to another role or to an Oracle user. However, you should avoid creating an unnecessarily complex set of roles; the use of roles should simplify the management of database privileges, not make it more complex.

Workshop

The purpose of the Workshop is to allow you to test your knowledge of the material discussed in the lesson. See if you can correctly answer the questions in the quiz and complete the exercise before you continue with tomorrow's lesson.

Quiz

  1. True or false? A database role can be granted to both users and other database roles.
  2. True or false? Adding an index to a table always improves the performance of
    an application.
  3. True or false? Any Oracle user can create a public synonym as long as the synonym points to a table that is owned by that user.

Previous | Table of Contents | Next

Используются технологии uCoz