What does this trigger do?

Examine this code:
CREATE OR REPLACE PROCEDURE audit_action
(p_who VARCHAR2)
AS
BEGIN
INSERT INTO audit(schema_user) VALUES(p_who);
END audit_action;
/
CREATE OR REPLACE TRIGGER watch_it
AFTER LOGON ON DATABASE
CALL audit_action(ora_login_user)
/
What does this trigger do?

Examine this code:
CREATE OR REPLACE PROCEDURE audit_action
(p_who VARCHAR2)
AS
BEGIN
INSERT INTO audit(schema_user) VALUES(p_who);
END audit_action;
/
CREATE OR REPLACE TRIGGER watch_it
AFTER LOGON ON DATABASE
CALL audit_action(ora_login_user)
/
What does this trigger do?

A.
The trigger records an audit trail when a user makes changes to the database.

B.
The trigger marks the user as logged on to the database before an audit statement is issued.

C.
The trigger invoked the procedure audit_action each time a user logs on to his/her schema and adds the username to the audit table.

D.
The trigger invokes the procedure audit_action each time a user logs on to the database and adds the username to the audit table.

Explanation:
This trigger fires after a user connects to a database and inserts a record into the audit table.
Incorrect Answers

A: This Trigger is not defined as a DML Trigger
B: This does not make any sense
C: If you specified to AFTER LOGON ON SCHEMA this would be the correct answer.



Leave a Reply 0

Your email address will not be published. Required fields are marked *