17,377
社区成员
发帖
与我相关
我的任务
分享
SQL> select name from v$statname where statistic#=339;
NAME
--------------------
bytes received via S
QL*Net from dblink
OPER@tl> select * from v$mystat where statistic#=339;
SID STATISTIC# VALUE
---------- ---------- ----------
138 339 9
OPER@tl> create table test(aaa number);
表已创建。
OPER@tl> select * from v$mystat where statistic#=339;
SID STATISTIC# VALUE
---------- ---------- ----------
138 339 10
--另一会话drop table test;
OPER@tl> create table test(aaa number);
表已创建。
OPER@tl> select * from v$mystat where statistic#=339;
SID STATISTIC# VALUE
---------- ---------- ----------
138 339 11
OPER@tl
OPER@tl> create or replace trigger tr_ddl
2 after create on schema
3 declare
4 v_sql_id varchar2(100);
5 v_sql varchar2(100);
6 begin
7 select sql_id,sql_text into v_sql_id,v_sql
8 from v$sqlarea
9 where sql_id=(select sql_id from v$session
10 where audsid=userenv('sessionid'));
11 dbms_output.put_line('sql_id is:'||v_sql_id);
12 dbms_output.put_line('sqltext is:'||v_sql);
13 end;
14 /
触发器已创建
OPER@tl> create table test(aaa number);
sql_id is:9gkx5dbw15x43
sqltext is:create table test(aaa number)
表已创建。
OPER@tl> select * from v$sqlarea where sql_id='9gkx5dbw15x43';
未选定行
OPER@tl> select * from v$sqltext where sql_id='9gkx5dbw15x43';
ADDRESS HASH_VALUE SQL_ID COMMAND_TYPE PIECE SQL_TEXT
-------- ---------- -------------- ------------ ---------- --------------------------
2483CCFC 4161991811 9gkx5dbw15x43 1 0 create table test(aaa number)
OPER@tl>