set document off doc $Source: H:\SQL\RCS\db_stat.sql $ $Revision: 1.4 $ $Author: gharriso $ $Date: 1996/02/12 09:56:16 $ This SQL*PLUS script controls how the other stats gathering scripts behave Guy Harrison gharriso@werple.mira.net.au # doc The prefix controls whether the scripts use the sample tables (prefix=gh) or use v$ tables directly (prefix=v) # doc DEV_LIMIT sets the directory depth which defines a physical device. If set to 2, then /db01/fred implies that /db01 is a unique device. DEV_DELIM defines the character which seperates directories or groups. For instance '/' for UNIX '\' for Windows '.' for MVS ? (haven't tried this) # define DEV_LIMIT=3 define DEV_DELIM='/' doc The spool dir directs spooled output to a particular directory # define spool_dir='' doc Our favorite settings # set echo off set verify off set feedback off set pages 56 set newpage 0 set lines 78 set document off doc Get instance and date values # set termout off column instname new_value instance_name noprint column repdate new_value print_date noprint select substr(name,1,20) instname,to_char(sysdate,'DD/MM/YY:HH24:MI') repdate from v$database; column period_comment new_value period_comment_ noprint REM REM Can't read v$instance on some systems and gh$ tables might not exist rem so create a default message first rem select 'Sampled since database startup' period_comment from dual; select 'Sampled between '||to_char(start_time,'DD/MM HH24:MI:SS')||' and ' ||to_char(end_time,'DD/MM HH24:MI:SS') period_comment from gh$control where upper('&prefix')='GH' / select 'Sampled since database startup at '|| to_char(to_date(j.value,'J')+s.value/(24*60*60),'DD/MM:HH24:MI:SS') period_comment from v$instance j, v$instance s, gh$control gh where j.key='STARTUP TIME - JULIAN' and s.key='STARTUP TIME - SECONDS' and upper('&prefix')='GH' and gh.start_time=gh.end_time / select 'Sampled since database startup at '|| to_char(to_date(j.value,'J')+s.value/(24*60*60),'DD/MM:HH24:MI:SS') period_comment from v$instance j, v$instance s where j.key='STARTUP TIME - JULIAN' and s.key='STARTUP TIME - SECONDS' and upper('&prefix')='V' / set termout on