----This is a modifed script of Original spreport.sql supplied by Oracle Corporation.

This script will take staspack report of the last 19 ---statspack snaps --Author :ANJITH T S --Date :19-11-08 --- Get the current database/instance information - this will be used -- later in the report along with bid, eid to lookup snapshots column snap_id format 9990 heading 'Snap|Id'; column begin_snap heading "Begin Snap" new_value begin_snap format 99999; column end_snap heading "End Snap" new_value end_snap format 99999; column report_name new_value report_name noprint; column inst_num heading "Inst Num" new_value inst_num format 99999; column inst_name heading "Instance" new_value inst_name format a12; column db_name heading "DB Name" new_value db_name format a12; column dbid heading "DB Id" new_value dbid format 9999999999 just c; select d.dbid dbid , d.name db_name , i.instance_number inst_num , i.instance_name inst_name , s.snap_id snap_id , (s.snap_id - 0) end_snap , (s.snap_id - 20) begin_snap , '/db01/' || to_char(snap_time, 'DDMMYY')||'_Statspack_Report.txt' report_name from v$database d, v$instance i, stats$snapshot s where s.snap_id = (select max(snap_id) from stats$snapshot ) and d.dbid = s.dbid and i.instance_number = s.instance_number; @$ORACLE_HOME/rdbms/admin/sprepins .sql exit;

Sign up to vote on this title
UsefulNot useful