Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to find history of shutdown/startup
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