You are on page 1of 2

1. What DBA activities did you to do today?

Wow, this is a loaded question and almost begs for you to answer it with "What D
BA activities do you LIKE to do on a daily basis?." And that is how I would answ
er this question. Again, do not get caught up in the "typical" day-to-day operat
ional issues of database administration. Sure, you can talk about the index you
rebuilt, the monitoring of system and session waits that were occurring, or the
space you added to a data file, these are all good and great and you should conv
ey that you understand the day-to-day operational issues. What you should also t
hrow into this answer are the meetings that you attend to provide direction in t
he database arena, the people that you meet and talk with daily to answer adhoc
questions about database use, the modeling of business needs within the database
, and the extra time you spend early in the morning or late at night to get the
job done. Just because the question stipulates "today" do not take "today" to me
an "today." Make sure you wrap up a few good days into "today" and talk about th
em. This question also begs you to ask the question of "What typical DBA activit
ies are performed day to day within X Corporation?"
1) Check the DB Cache Hit Ratio
################# Script ###################################################
set feedback off;
select instance_name from v$instance
/
set serveroutput on;
DECLARE
libcac number(10,2);
rowcac number(10,2);
bufcac number(20,2);
redlog number(10,2);
spsize number;
sprsize number;
blkbuf number;
logbuf number;
BEGIN
select value into redlog from v$sysstat
where name = 'redo log space requests';
select 100*(sum(pins)-sum(reloads))/sum(pins) into libcac from v$librarycache;
select 100*(sum(gets)-sum(getmisses))/sum(gets) into rowcac from v$rowcache;
select 100*(cur.value + con.value - phys.value)/(cur.value + con.value) into buf
cac
from v$sysstat cur,v$sysstat con,v$sysstat phys,v$statname ncu,v$statname nco,v$
statname nph
where cur.statistic# = ncu.statistic#
and ncu.name = 'db block gets'
and con.statistic# = nco.statistic#
and nco.name = 'consistent gets'
and phys.statistic# = nph.statistic#
and nph.name = 'physical reads';
select value into spsize from v$parameter where name = 'shared_pool_size';
select value into sprsize from v$parameter where name = 'shared_pool_reserved_si
ze';
select value into blkbuf from v$parameter where name = 'db_cache_size';
select value into logbuf from v$parameter where name = 'log_buffer';
dbms_output.put_line(' SGA CACHE STATISTICS');
dbms_output.put_line(' ********************');
dbms_output.put_line(' SQL Cache Hit rate = '||libcac);
dbms_output.put_line(' Dict Cache Hit rate = '||rowcac);
dbms_output.put_line(' Buffer Cache Hit rate = '||bufcac);
dbms_output.put_line(' Redo Log space requests = '||redlog);
dbms_output.put_line(' ');
dbms_output.put_line(' INIT.ORA SETTING');
dbms_output.put_line(' ****************');
dbms_output.put_line(' Shared Pool Size = '||spsize||' Bytes');
dbms_output.put_line(' Shared Pool Reserved Size = '||sprsize||' Bytes');
dbms_output.put_line(' DB Cache Size = '||blkbuf||' Blocks');
dbms_output.put_line(' Log Buffer = '||logbuf||' Bytes');
dbms_output.put_line(' ');
if
libcac < 99 then dbms_output.put_line('*** HINT: Library Cache too low!
Increase the Shared Pool Size.');
END IF;
if
rowcac < 85 then dbms_output.put_line('*** HINT: Row Cache too low! Inc
rease the Shared Pool Size.');
END IF;
if
bufcac < 90 then dbms_output.put_line('*** HINT: Buffer Cache too low!
Increase the DB Cache Size value.');
END IF;
if
redlog > 100 then dbms_output.put_line('*** HINT: Log Buffer value is ra
ther low!');
END IF;
END;
/
################# Script ###################################################

You might also like