Re: Sql question
Posted in 1997
Below are tab_reads and tab_writes which do what you ask. To
run:
tab_reads <dbname>
tab_writes <db_name>
-- tab_reads
#!/bin/sh
dbaccess sysmaster << END_SQL;
select today a, sitename b,
"This report gives a list of table names and the number of hits " c,
"per table. The purpose is try and determine the most frequently " d,
"accessed tables, to allow move,emt across disks to balance i/o " e,
" Usage: tab_reads <database>" f
from systables
where tabid =
(select max(tabid) from systables);
select tabname[1,15], lockreqs, isreads, iswrites, bufreads, bufwrites
from sysptprof
where dbsname = "$1"
and (isreads>0 or iswrites>0)
order by isreads desc
----------------------------------------------------------
-- tab writes
#!/bin/sh
dbaccess sysmaster << END_SQL;
select today a, sitename b,
"This report gives a list of table names and the number of hits " c,
"per table. The purpose is try and determine the most frequently " d,
"accessed tables, to allow move,emt across disks to balance i/o " e,
" Usage: tab_writes <database>" f
from systables
where tabid =
(select max(tabid) from systables);
select tabname[1,15], lockreqs, isreads, iswrites, bufreads, bufwrites
from sysptprof
where dbsname = "$1"
and (isreads>0 or iswrites>0)
order by iswrites desc
>
> does anyone have a script that will pull out the tables
> in a database that would have the most read/write activity?
>
> tks
> Ed
>
> edbid @ cobe.com
>
--
Bill Ennis Voice: 312-474-7516
SSA Fax: 312-474-7460
500 W. Madison email: ennis@ssax.com ennis@accesschicago.net