Databases Reference
In-Depth Information
having trouble creating tables, so she decides to turn on auditing to see how often
the new user's CREATE TABLE statements are failing:
audit create table by scrawford
whenever not successful;
Audit succeeded.
In the next few days, the user SCRAWFORD runs a variety of CREATE TABLE
statements, such as the following:
create table temp_emp
(employee_id number(6),
email varchar2(25));
Table created.
create table temp_emp
(employee_id number(6),
email varchar2(25));
ERROR at line 1:
ORA-00955: name is already used by an existing object
The user's second attempt failed because the table already exists.
Janice could review the SYS.AUD$ table, but she knows that the data dictio-
nary view called DBA_AUDIT_TRAIL formats the records from SYS.AUD$ into a
more readable format. She checks that view:
select username, obj_name, timestamp, action_name from
dba_audit_trail;
USERNAME OBJ_NAME TIMESTAMP ACTION_NAME
------------- ------------ --------- ------------
SCRAWFORD TEMP_EMP 26-OCT-02 CREATE TABLE
1 row selected.
The OBJ_NAME column contains the name of the object affected by the state-
ment, and the ACTION_NAME column contains the type of statement executed.
Because Janice is auditing only unsuccessful uses of the CREATE TABLE statement,
there is only one row inserted into SYS.AUD$, even though two CREATE TABLE
statements were executed.
Search WWH ::




Custom Search