oracle Workspace Manager提供的审计功能非常实用,今天简单测试
了一下。感觉oracle比较强大。
[PHP]
scott@REPENG>conn scott/tiger@repeng
已连接。
scott@REPENG>create table test_au as
2select empno,ename,sal,comm
3from emp;
表已创建。
scott@REPENG>alter table test_au add constraint pk_no
2primary key(empno);
表已更改。
scott@REPENG>select * from tab;
TNAME
TABTYPECLUSTERID
------------------------------ ------- ----------
DEPT
TABLE
EMP
TABLE
BONUS
TABLE
SALGRADE
TABLE
TEST_AU
TABLE
scott@REPENG>EXECUTE DBMS_WM.EnableVersioning ('test_au','VIEW_W_OVERWRITE');
PL/SQL 过程已成功完成。
scott@REPENG>select * from tab;
TNAME
TABTYPECLUSTERID
------------------------------ ------- ----------
DEPT
TABLE
EMP
TABLE
BONUS
TABLE
SALGRADE
TABLE
TEST_AU_BASE
VIEW
TEST_AU_LT
TABLE
TEST_AU
VIEW
TEST_AU_MW
VIEW
TEST_AU_CONS
VIEW
TEST_AU_AUX
TABLE
TEST_AU_HIST
VIEW
TEST_AU_BPKC
VIEW
TEST_AU_PKC
VIEW
TEST_AU_CONF
VIEW
TEST_AU_PKDB
VIEW
TEST_AU_PKDC
VIEW
TEST_AU_PKD
VIEW
TEST_AU_DIFF
VIEW
TEST_AU_LOCK
VIEW
已选择19行。
scott@REPENG>select * from test_au where rownum update test_au set comm=200
2where empno='7369';
已更新 1 行。
scott@REPENG>commit;
提交完成。
scott@REPENG>update test_au set comm=600
2where ename='WARD';
已更新 1 行。
scott@REPENG>commit;
提交完成。
scott@REPENG>delete from test_au where ename='JONES';
已删除 1 行。
scott@REPENG>commit;
提交完成。
scott@REPENG>desc test_au_hist;
名称
是否为空? 类型
----------------------------------------------------- -------- ----------------
--------------------
EMPNO
NUMBER(4)
ENAME
VARCHAR2(10)
SAL
NUMBER(7,2)
COMM
NUMBER(7,2)
WM_WORKSPACE
VARCHAR2(30)
WM_VERSION
NUMBER(38)
WM_USERNAME
VARCHAR2(4000)
WM_OPTYPE
VARCHAR2(1)
WM_CREATETIME
TIMESTAMP(6) WIT
H TIME ZONE
WM_RETIRETIME
TIMESTAMP(6) WIT
H TIME ZONE
scott@REPENG>select count(*) from test_au_hist;
COUNT(*)
----------
11
scott@REPENG>column WM_USERNAME for a20
scott@REPENG>column WM_CREATETIME for a30
scott@REPENG>select empno,comm,WM_USERNAME, WM_OPTYPE,WM_CREATETIME
2from test_au_hist where empno='7369';
EMPNO COMM WM_USERNAME
W WM_CREATETIME
---------- ---------- -------------------- - ------------------------------
7369200 SCOTT
U 13-7月 -07 02.39.19.999000 下
午 +08:00
scott@REPENG>select empno,comm,WM_USERNAME, WM_OPTYPE,WM_CREATETIME
2from test_au_hist where ename='WARD';
EMPNO COMM WM_USERNAME
W WM_CREATETIME
---------- ---------- -------------------- - ------------------------------
7521600 SCOTT
U 13-7月 -07 02.40.09.326000 下
午 +08:00
scott@REPENG>select empno,comm,WM_USERNAME, WM_OPTYPE,WM_CREATETIME
2from test_au_hist where ename='JONES';
EMPNO COMM WM_USERNAME
W WM_CREATETIME
---------- ---------- -------------------- - ------------------------------
7566
SCOTT
D 13-7月 -07 02.41.21.935000 下
午 +08:00
scott@REPENG>EXECUTE DBMS_WM.disableVersioning ('test_au');
PL/SQL 过程已成功完成。
scott@REPENG>select * from tab;
TNAME
TABTYPECLUSTERID
------------------------------ ------- ----------
DEPT
TABLE
EMP
TABLE
BONUS
TABLE
SALGRADE
TABLE
TEST_AU
TABLE
.
[/PHP]
|