|
Re: 创建函数索引的TRACE
最初由 dba_mx 发布
[B][php]
CREATE TABLE TEST.TT (STR VARCHAR2(5));
INSERT INTO TEST.TT SELECT 'TTT' || LPAD(ROWNUM,2,'0') FROM DUAL CONNECT BY ROWNUM<=5;
COMMIT;
ALTER SESSION SET SQL_TRACE=TRUE;
CREATE INDEX TEST.FIDX_TT_STR ON TEST.TT(SUBSTR(STR,4));
ALTER SESSION SET SQL_TRACE=FALSE;
..
[/php]
从trace文件中根本看不到向表中添加隐藏字段的步骤,或者说我没有看出来。 [/B]
Earlier you said the hidden *update* on the hidden column is not shown. I said there *isn't* any need to have a separate SQL to update that. Now you say the hidden column *creation* is not shown.
I didn't read your trace file since I don't have WinRar installed on this computer. But you can clearly see the 向表中添加隐藏字段的步骤. Here's my test, done on 10.1.0.3.1 (but likely to be reproducible on 9i).
alter system flush shared_pool;
alter session set events = '10046 trace name context forever, level 4';
create index fbi_testfbi on testfbi (upper(name));
I use 10046 event level 4 just to see the bind value. Here's the trace file:
insert into col$(obj#,name,intcol#,segcol#,type#,length,precision#,scale,null$,offset,fixedstorage,segcollength,deflength,default$,col#,property,charsetid,charsetform,spare1,spare2,spare3)values(:1,:2,:3,:4,:5,:6,decode(:7,0,null,:7),decode(:5,2,decode(:8,-127/*MAXSB1MINAL*/,null,:8),178,:8,179,:8,180,:8,181,:8,182,:8,183,:8,231,:8,null),:9,0,:10,:11,decode(:12,0,null,:12),:13,:14,:15,:16,:17,:18,:19,:20)
END OF STMT
PARSE #10:c=15625,e=5765,p=0,cr=84,cu=0,mis=1,r=0,dep=1,og=4,tim=1227079990
BINDS #10:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=0001 size=24 offset=0
bfp=05c206f4 bln=22 avl=04 flg=05
value=68541
bind 1: dty=1 mxl=32(12) mal=00 scl=00 pre=00 oacflg=18 oacfl2=0001 size=32 offset=0
bfp=28d47a1e bln=32 avl=12 flg=09
value="SYS_NC00002$"
...
It's about adding a column, with obj# bound at runtime to 68541 and name to "SYS_NC00002$"... Isn't that clear?
I flush shared pool just to show recursive SQLs. Otherwise since dictionary cache already has some data dictionary info, some recursive SQLs wouldn't be run. But in this case, it's a DML against a data dictionary table. This flush may not be necessary.
Yong Huang |
|