/********************************************************************** * File: sp_shutdown.sql * Type: SQL*Plus script * Author: Tim Gorman (Evergreen Database Technologies, Inc.) * Date: 05Jan04 * * Description: * SQL*Plus script containing the DDL to create a database-level * BEFORE SHUTDOWN event trigger to make one last STATSPACK.SNAP * call prior to NORMAL/IMMEDIATE database shutdown, so as not * to lose any info stored in the V$ views. * * Of course, a BEFORE SHUTDOWN trigger does not fire during * SHUTDOWN ABORT... * * Modifications: *********************************************************************/ set echo on feedback on timing on verify on spool sp_shutdown create or replace trigger sp_shutdown before shutdown on database begin perfstat.statspack.snap; end sp_shutdown; / show errors spool off