Entradas

Mostrando entradas de diciembre, 2008

Performance - Query Tuning

Veremos aca algo de Tunning, el "QUE", "COMO", y "PARA QUE". Create a plan table @?/rdbms/admin/utlxplan.sql ___________________________________________________ Autotrace To switch it on: column plan_plus_exp format a100 set autotrace on explain # Displays the execution plan only. set autotrace traceonly explain # dont run the query set autotrace on # Shows the execution plan as well as statistics of the statement. set autotrace on statistics # Displays the statistics only. set autotrace traceonly # Displays the execution plan and the statistics ________________________________________________________ Find a query's hash Put something unique in the like clause select hash_value, sql_text from v$sqlarea where sql_text like '%TIMINGLINKS%FOLDERREF%' ______________________________________________________________________ Grab the sql associated with a hash select sql_text from v$sqlarea where hash_value = '&hash' / _____...

Cuanto pesa una BASE DE DATOS.

Este query nos muestro cuanto pesa una base de datos, saca un calculo en base a los data files asignados y los data files free en espacio. col "Database Size" format a20 col "Free space" format a20 col "Used space" format a20 select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size" , round(sum(used.bytes) / 1024 / 1024 / 1024 ) - round(free.p / 1024 / 1024 / 1024) || ' GB' "Used space" , round(free.p / 1024 / 1024 / 1024) || ' GB' "Free space" from (select bytes from v$datafile union all select bytes from v$tempfile union all select bytes from v$log) used , (select sum(bytes) as p from dba_free_space) free group by free.p /