Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Base de Datos
17.5%
Sistema
2.5%
Source: ORACLE Performance Tuning1
1000
800
600
SGA Size
400 OS Memory
200
0
Oracle5 Oracle6 Oracle7 Oracle8
Meta # 1: tenemos suficiente
memoria localizada para Oracle ?
DB_BLOCK_BUFFERS
SHARED_POOL_SIZE
SORT_AREA_SIZE
Meta#1: tenemos suficiente
memoria localizada para Oracle ?
Valores del parmetro KEY INIT.ORA :
select name, substr(value,1,40)
from v$parameter where name in
('db_block_buffers','db_block_size','shared_po
ol_size','sort_area_size');
Nombre Valor
db_block_buffers 4000
db_block_size 4096
shared_pool_size 7000000
sort_area_size 262144
A. DB_BLOCK_BUFFERS
Buffer_gets SQL_TEXT
300,219 select order#,cust_no, from
orders where division = 1
Encontrando el codigo PL/SQL
select text
from user_source
where name = PROCESS_DATE
order by line;
TEXT___________________________
procedure process_date is
test_num number;
begin
test_num := 10;
if test_num = 10 then
update order_main
set process_date = sysdate
where order_num = 12345;
end if;
end;
Encontrar USER que bloquean
a otros.
Select a.serial#, a.sid, a.username, b.id1, c.sql_text
from v$session a, v$lock b, v$sqltext c
where b.id1 in
(select distinct e.id1
from v$session d, v$lock e
where d.lockwait = e.kaddr)
and a.sid = b.sid
and c.hash_value = a.sql_hash_value
and b.request = 0;
Mate al USER del problema
El Optimizers
Usando Histograms
Driving Tables
Partitions
Parallel Query
El Optimizers
En General:
Las estadsticas son generadas con el comando
ANALYZE
Deben generarse estadsticas de Cost Based
Optimization
PURPOSE:
To perform one of these functions on an index, table, or
cluster:
To collect statistics about the object used by the
optimizer and store them in the data dictionary
To delete statistics about the object from the data
dictionary
To validate the structure of the object
To identify migrated and chained rows of the table or
cluster
ANALYZE Ejemplos:
Tracefile.trc Output.txt
User_dump_dest
TKPROF Statistics
Count:Number of execution calls
CPU: CPU seconds used
Elapsed: Total elapsed time
Disk: Physical reads
Query: Logical reads for consistent read
Current: Logical reads in current mode
Rows: Rows processed
SQL*Plus Autotrace
Create the plan_table Table
Create and grant the plustrace role
@$oracle_home/sqlplus/admin/plustrce.sql
Grant plustrace To scott;