OCP 1Z0 052 36

36.  In  your  production  database,  data manipulation  language  (DML)  operations  are  executed  on  the 
SALES  table. You have noticed some dubious values  in the SALES  table during the last  few days. You 
are able to track users, actions taken, and the time of the action for this particular period but the changes 
in data are not tracked. You decide to keep track of both the old data and new data in the table along with 
the user information.  
What action would you take to achieve this task? 
A.Apply fine-grained auditing. 
B.Implement value-based auditing. 
C.Impose standard database auditing to audit object privileges. 
D.Impose standard database auditing to audit SQL statements. 
Answer: B
SQL> show parameter audit
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      D:\APP\ADMINISTRATOR\ADMIN\ORCL\ADUMP
audit_sys_operations                 boolean     FALSE
audit_trail                          string      DB, EXTENDED

SQL> show user
User is "test"

SQL> create table test as select * from scott.emp;
Table created

SQL> update test set sal = 1 where empno = 7788;
1 row updated

SQL> audit all on test;
Audit succeeded

SQL> update test set sal = 2 where empno = 7788;
1 row updated

SQL> delete from test where rownum <=1;
1 row deleted

SQL> insert into emp (empno) values(9999);
1 row inserted

SQL> commit;
Commit complete

SQL> noaudit all on test;
Noaudit succeeded

SQL> col sql_text form a50
SQL> SELECT TIMESTAMP,
  2         owner,
  3         obj_name,
  4         sql_text
  5    FROM dba_audit_trail
  6   WHERE username = 'TEST'
  7     AND obj_name = 'TEST';
TIMESTAMP   OWNER  OBJ_NAME   SQL_TEXT
----------- ------ ---------- --------------------------------------------------
2014-06-11  TEST   TEST       audit all on test
2014-06-11  TEST   TEST       update test set sal = 2 where empno = 7788
2014-06-11  TEST   TEST       delete from test where rownum <=1
2014-06-11  TEST   TEST       noaudit all on test
8 rows selected
注意参数设置audit_trail string DB, EXTENDED

你可能感兴趣的:(OCP 1Z0 052 36)