Previous Table of Contents Next


Table 11.10 Excerpts from MY_SID instance B-E lib stats last 40 days (07/08/96). Reparse ratio > .01 Increase SHARED_POOL_SIZE.
B/Estat Execution Pins Reloads Reparse Ratio
96/06/28 FRI 09:23-09:24 728 21 .0288
96/06/28 FRI 09:28-16:00 36,330 742 .0204
96/07/01 MON 08:00-07:36 1,123,808 315 .0003
96/07/02 TUE 09:18-09:30 7,315 70 .0096
96/07/03 WED 08:00-09:30 994 0 .0000
96/07/04 THU 08:00-09:30 700 0 .0000
96/07/05 FRI 08:00-09:30 660 0 .0000
————— ———— ———
Average 167,219 164 .0084

Table 11.11 Excerpts from Table/Index extents (07/08/96 13:40). TRANP table report > 80 Extents or new extents data for the last 7 days.
SID Owner TS Table Size (KB) Next (K) Old Ext New Ext
TRANP HOCK USERS_01 LOBHOCK11 7,606 352 67 69
RPT USERS_01 USER_TABLES_RPT   660 0 12 15

Table 11.12 Excerpts from Tablespace report (07/12/96). OIDB instance data file storage in Oracle megabytes (1,048,576 bytes).
Date Tablespace Tablesp Pieces Tablesp Mbytes Free Mbytes Free Mbytes Percent Free
03-JUL-96 INDEXG 5 600   20   17   3  
03-JUL-96 GSA_DATA 4 600   61   57   10  
03-JUL-96 INDEXH 1 200   21   21   10  
03-JUL-96 INDEXE 3 400   42   38   10  
03-JUL-96 PROSPECTING01 1 900   99   99   11  
03-JUL-96 PERSON 1 200   30   30   15  
03-JUL-96 PROSPECTING02 7 750   165   82   22  
03-JUL-96 ADDRESS 1 200   49   49   24  
03-JUL-96 INDEXB 2 400   114   62   29  
03-JUL-96 RESPONSIBILITY 1 150   45   45   30  
03-JUL-96 TOOLS 2 10   3   3   32  
03-JUL-96 ORGANIZATION 1 300   121   121   40  

Tablespace And Table Data Gathering

While the estat-bstat utilities are great for measuring memory usage, the DBA may still want to capture information about Oracle tables and tablespaces. For example, an alert report can easily be generated that shows all tables and indexes that have extended more than twice in the past 24 hours. A tablespace alert report could be written to display all tablespaces that have free space less than 10 percent of the tablespace size.

A routine can easily be written to interrogate all tablespaces and dump the information into a statistical table (Listing 11.7), and this tablespace information can be tracked to predict the rate of growth and the time when it will become necessary to add a data file to the tablespace.

Listing 11.7 A tablespace data gathering script.

INSERT INTO tablespace_stat VALUES (
SELECT   dfs.tablespace_name,
         round(sum(dfs.bytes)/1048576,2),
         round(max(dfs.bytes)/1048576,2)
FROM     sys.dba_free_space dfs
GROUP BY dfs.tablespace_name
ORDER BY dfs.tablespace_name);

Tables are usually tracked to provide information on unexpected growth. A high growth rate can indicate that the table was undersized on the next parameter, or it can indicate an upturn in end-user processing. In either case, the DBA wants to be informed whenever any table extends more than twice within any 24 hour period.

Gathering the table extent information is a simple matter, as shown in Listing 11.8. This script can be attached to a cron process to gather the extent information at a specified time interval.

Listing 11.8 A table data gathering script.

INSERT INTO tab_stat VALUES(
SELECT  ds.tablespace_name,
        dt.owner,
        dt.table_name,
        ds.bytes/1024,
        ds.extents,
        dt.max_extents,
        dt.initial_extent/1024,
        dt.next_extent/1024,
        dt.pct_increase,
        dt.pct_free,
        dt.pct_used
FROM    sys.dba_segments ds,
        sys.dba_tables dt
WHERE   ds.tablespace_name = dt.tablespace_name
AND   ds.owner = dt.owner
AND   ds.segment_name = dt.table_name
ORDER BY 1,2,3);


Previous Table of Contents Next