In Oracle PL/SQL, the SUCCESSFUL keyword is used for auditing of successful and unsuccessful operations through the AUDIT statement. The AUDIT statement is used to analyze the impact of SQL statements on subsequent sessions. A SQL statement can be set for audit if it is successful or unsuccessful in a session or by user access. In Oracle PL/SQL, BY SESSION is the default audit mode.
A user must have the AUDIT SYSTEM system privilege to use the AUDIT statement.
audit by session whenever successful;
audit by access whenever not successful;
The AUDIT statement below audits all successful INSERTS in U1.ORDERS table.
The AUDIT statement below audits all unsuccessful SELECT statements on the SCOTT.EMP table.
WHENEVER NOT SUCCESSFUL;