Trigger before shutdown on Database with alter system command
Hi,
I'm trying to create a trigger "before shutdown on database" that gets the user who is sending the shutdown command and before the shutdown ends the Oracle does a checkpoint and a backup of controlfile. The informations about the user are save in the table, however, the Oracle does not wait the "execute immediate" to finish and kills the session that is executing the "execute immediate"
CREATE OR REPLACE TRIGGER BSHUT2
BEFORE SHUTDOWN ON DATABASE
BEGIN
insert into shutdowns values (dbms_standard.login_user, dbms_standard.client_ip_address, SYS_CONTEXT('USERENV','IP_ADDRESS'), SYS_CONTEXT('USERENV', 'HOST'), SYS_CONTEXT('USERENV', 'AUTHENTICATION_METHOD'), SYS_CONTEXT('USERENV', 'CLIENT_IDENTIFIER'), SYS_CONTEXT('USERENV', 'CLIENT_INFO'), SYS_CONTEXT('USERENV', 'CURRENT_SQL'), SYS_CONTEXT('USERENV', 'INSTANCE'), SYS_CONTEXT('USERENV', 'MODULE'), SYS_CONTEXT('USERENV', 'OS_USER'), SYS_CONTEXT('USERENV', 'TERMINAL'), SYSDATE);