S
S
sidor_tank2019-12-11 10:13:46
Oracle
sidor_tank, 2019-12-11 10:13:46

How to get information about the user who called shutdown in the BEFORE SHUTDOWN ON DATABASE trigger and put his name in the table?

Hello everyone, I just started to study triggers in Oracle, I want to enter information about the user who caused the shutdown in the table,
I wrote something like this:
CREATE TABLE user_inf
(
Event_type VARCHAR2(150)
);
CREATE OR REPLACE TRIGGER STOP_SCRIPT BEFORE SHUTDOWN ON DATABASE
BEGIN
insert into user_inf (Event_type) values ​​(SYS_CONTEXT('USERENV', 'OS_USER'));
END;
The trigger for some reason does not fire on shutdown immediate.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question