Sie sind auf Seite 1von 4

Performance Improvement by tuning Disk Input/Output

Nearly every action that accurse in the Database will result in some type of logical or physical input/output. By proper tuning the components of SGA you can minimize the physical I/O. The Main goal while tuning physical I/O are generally to :1. Minimize physical I/O whenever possible by proper sizing the SGA 2. Perform any remaining I/O as fast as possible. 3. The database blocks that make up database datafile, are read into the database buffer cache by each users server process. Measuring Datafile Input/Output:Physical I/O of datafile can be measured by using v$filestat and v$datafile or by using output of report.txt. V$filestat and v$datafile can be used to measure the read and write activity against datafile and tablesapce in the database. Select name,phyrds,phywrts,avgiotim, miniotim, maxiowtm,maxiortm from V$filestat,v$datafile where v$filestat.file#=v$datafile.file#; Following are the description of columns in the above query. Phyrds :No. of physical reads done to the datafile. Phywrts :No. of physical writes done to the datafile, Avgiotim : Average time in 100th of second, spent performing input /output on that datafile. Miniotim:Minimum time in 100th of second spent performing I/O on that datafile. Maxiowtm :- Maximum time in 100th of second spent writing to that datafile, Maxiortm:Max time in 100th of second spent reading from that datafile, The majority of physical read and write are accruing on the system tablespace datafile.It often accurse because the data dictionary tables that oracle uses to perform recursive SQL are located in the system tablespace. But a excessive write activity to the system tablespace may indicate that non-data dictionary segment are stored there. Improving datafile Input/Output. The easiest way to balance the Input/output between the segments in the database is ti allocate the storage for those segments to the appropriate tablespace. At minimum it asks for separating the major components of the database in to their own tablespace and making sure that users are not having system as there default tablespace.

Suggested minimum tablespace configuration. Tablespace System :Tools:Users:Temp:RBS:Appl_data:Appl_idx:Description Objects owned by user SYS (data dictionary) Default tablespace for user system. Default tablespace for all other databse users. Location for temporary segments used for sorting. Location for rollback segments, Location for application table/Schema. Location for index.

Separating application tables from their associated indexes helps improve performance on busy OLTP system, when table or index are simultaneously having blocks read and inserted. A further extension of this concept can be segregating segments by functional area like separating accounting tables and indexes from sales table and indexes or separating by size. Performing datafile input/output quickly This can be done in 4 ways:1. 2. 3. 4. By placing high I/O datafile on separate disk drives. Datafile striping. Using Locally managed Tablespace. Tuning the Db_file_multiblock_read_count init.ora parameter.

Datafile Striping The Idea of separating datafile into distinct devices can be extended further through technique called striping. When a datafile is striped it is stored across several devices not just one, this increases I/O performance because multiple set of disk drives heads are brought in to use when a read or write of the datafile is required. The easiest way to strip a datafile is to store the datafile in RAID device, A RAID or Redundant array of independent disks consists of several physical disks that can be managed and accessed as if they were one or more physical devices. Therefore placing a datafile on a RAID device implicitly causes the file to be striped across all the devices in the raid. Datafile can also be manually striped across devices in the absence of a RAID array. Manual striping is created by creating a tablespace made up of several datafile and placing each datafile on a saperatee physical device. Next a segment is created so that it extents are stored in each of the datafile associated with the tablespace. Effectively striping the segments across the available devices.

Following is an example of SQL statement used to accomplish this for a table,

STEP 1 :Create the EMP table initial extent:Create Table EMP( Emp_id number, First_name Varchar2(30), Last_name varchar2(30)) storage ( Initial 4M, next 4M ,PCTincrease 0) Tablespace Appl_data; Step 2:Next, Add two additional datafile to the tablespace each located on a saperate devices. SQL> Alter tablespace Appl_data 2 add datafile /u02/oradata.prod/appl_data02.dbf 3. size 5M; SQL> Alter tablespace Appl_data 2 add datafile /u02/oradata.prod/appl_data03.dbf 3. size 5M; Step 3 :Manually allocate two new extents for the emp table using the datafile that were created SQL> alter table emp 2 allocate extent 3 (datafile /u02/oradata.prod/appl_data02.dbf size 4M); SQL> alter table emp 4 allocate extent (datafile /u02/oradata.prod/appl_data03.dbf size 4M); Locally Managed Tablespace:Datafile input/output can also be educed by use of Locally managed tablespace(LMT). A LMT uses a bitmap stored in the header of tablespaces datafile instead of data dictionary to manage the allocation of space with in the tablespace,This makes space allocation /de-allocation much faster as access to data dictionary is system tablespace is not required. DB_FILE_MULTIBLOCK_READ_COUNT Init.ora Parameter. This init.ora parameter determines the max number of database blocks that are read by a users server process when ever full table scan read operation is performed .

The default value is 8 setting this value to greater then 8 benefits most when database blocks are being accessed by full table scan, By setting this high more blocks are accessed for each read thus reducing the total no. of I/0. To determine how often you application is performing FTS. Use following Query. SQL> select names,value from V$sysstat where name =table scan(long tables); High vaue for this statistics indicate that your application is performing frequent FTS.and may benefit from increasing above parameter value. The Behavior of CBO is also affected by this parameter. If fewer I/O are required to access all the data of table via FTS then CBO may now choose to access table using FTS instead of Previously used index. ******* END *********

Das könnte Ihnen auch gefallen