Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to find history of shutdown/startup

Re: How to find history of shutdown/startup

From: Vedran Maler <vedran.maler_at_atosorigin.com>
Date: 24 Jan 2003 04:02:13 -0800
Message-ID: <d80aafef.0301240402.603b804@posting.google.com>


Hi,

another approach would be to create database table for storing such information, in combination with triggers on system events STARTUP/SHUTDOWN.

Here my sample scripts:

CREATE TABLE auditsys.audit_startup (

       startup_time   DATE,
       startup_type   VARCHAR2(8),
       startup_user   VARCHAR2(30),
       instance_num   NUMBER

);

CREATE OR REPLACE TRIGGER tr_audit_startup AFTER STARTUP ON DATABASE
BEGIN    INSERT INTO auditsys.audit_startup (

          startup_time,
          startup_type,
          startup_user,
          instance_num
        ) VALUES (
          SYSDATE,
          ora_sysevent,
          ora_login_user,
          ora_instance_num

);

EXCEPTION
   WHEN others THEN

        NULL;
END;
/

CREATE OR REPLACE TRIGGER tr_audit_shutdown BEFORE SHUTDOWN ON DATABASE
BEGIN    INSERT INTO auditsys.audit_startup (

          startup_time,
          startup_type,
          startup_user,
          instance_num
        ) VALUES (
          SYSDATE,
          ora_sysevent,
          ora_login_user,
          ora_instance_num

);

EXCEPTION
   WHEN others THEN

        NULL;
END; This way it's very comfortable to seach & analyze such information.

Regards,
Vedran Received on Fri Jan 24 2003 - 06:02:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US