본문 바로가기

빅데이터과정/WORKSHOP 1

#21_140711_WSHOP_AUDIT

728x90

# AUDIT




1.     감사기능을 활성화
audit_trail
1)     false : 감사 모니터링 안하겠다
2)     db : 감사 로그를 database에 저장하겠다
3)     os : 감사 로그를 OS에 저장하겠다
4)     XM : 감사 로그를 xml 형태로 os에 저장하겠다.



2.     scott 계정 audit 조회

show parameter audit;  audit 을 킨다

SELECT username, action_name, TIMESTAMP, terminal FROM DBA_AUDIT_TRAIL

WHERE username='SCOTT';    audit 을 조회



SQL> show parameter audit;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/dbdb/adu
                                                 mp
audit_sys_operations                 boolean     FALSE
audit_syslog_level                   string
audit_trail                          string      DB



휴지통 확인(sys는 기능없음)
SQL> show recyclebin
ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
---------------- ------------------------------ ------------ -------------------
DEPT             BIN$/b1B4BhdnrzgQAB/AQAv2Q==$0 TABLE        2014-07-09:14:48:27
EMP              BIN$/ecrFqE/OyrgQAB/AQA0GA==$0 TABLE        2014-07-11:16:48:34
EMP              BIN$/b0zoEt9mF7gQAB/AQA0Rg==$0 TABLE        2014-07-09:14:44:29
SALGRADE         BIN$/edIECV+drTgQAB/AQA0Og==$0 TABLE        2014-07-11:16:56:40
SQL> flashback table emp to before drop;
flahsback 으로 휴지통에서 살릴 수 있음


table 감사


SQL> audit select any table;
SQL> select ename, sal
  2  from emp
  3  where ename='KING';
ENAME             SAL
---------- ----------
KING             5000