SQL Tuning

Problém se startem RAC na AIX

Po restartu clusteru na AIX OS se nám nedařilo nahodit druhý nód. Problém se nakonec ukázal v neexistenci bpf zařízení, byly pouze 4, na ostatních strojích jich bylo vždy 20. Stačilo na druhém nódu pod rootem smazat všechny bpf zařízení a zase je vytvořit. 

Popsáno v dokumentech Doc ID 2381091.1 Doc ID 1988276.1

rm /dev/bpf* 
/usr/sbin/tcpdump -D

Jak zjistit verzi PSU na databazi

Pro zjisteni verze PSU nainstalovane na SW pouzijeme :

opatch lsinv -bugs_fixed | grep -i psu

pro zjisteni verze nainstalovane na db pouzijeme tento select (prihlaseni pod sysem)

 

select substr(action_time,1,30) action_time, substr(id,1,10) id, substr(action,1,10) action,
substr(version,1,8) version, substr(BUNDLE_SERIES,1,6) bundle,substr(comments,1,20) 
comments from registry$history;

Zjisteni velikosti flashback logu

SELECT trunc(b.begin_interval_time),
round(sum(GREATEST( ((SELECT d.value FROM dba_hist_sysstat d WHERE d.snap_id=a.snap_id+1
AND d.instance_number=a.instance_number
AND d.stat_name = 'flashback log write bytes') - a.value),0)/1024/1024)) FROM dba_hist_sysstat a,dba_hist_snapshot b
WHERE a.snap_id=b.snap_id AND a.instance_number=b.instance_number AND a.stat_name = 'flashback log write bytes'
GROUP BY trunc(b.begin_interval_time) ORDER BY 1 ;

Jak zjistit log file sync

Jednoduché je zjištění hodnoty log file sync z AWR reportu, ale pokud si chcete zobrazit hodnotu log file sync v čase tak je to jednoduché pomocí AWR tabulek

select c.BEGIN_INTERVAL_TIME,((b.time_waited_micro-a.time_waited_micro)/1000)/(b.TOTAL_WAITS-a.TOTAL_WAITS) "log file sync (ms)" 
from dba_hist_system_event a ,dba_hist_system_event b,dba_hist_snapshot c 
where a.SNAP_ID=c.SNAP_ID and a.DBID=c.DBID and a.INSTANCE_NUMBER=c.INSTANCE_NUMBER 
and a.SNAP_ID=b.SNAP_ID-1 and a.DBID=b.DBID and a.INSTANCE_NUMBER=b.INSTANCE_NUMBER 
and a.EVENT_ID=b.EVENT_ID and a.EVENT_NAME='log file sync' order by 1;
Home