请教一个问题,我在学习V$SQLTEXT和V$SQLAREA,对这两视图中的字段‘VERSION_COUNT’ 不是很理解,请解释一下?
xxx
2009/5/19
xxx,你好
VERSION_COUNT | NUMBER | Number of child cursors that are present in the cache under this parent |
oracle使用多个子游标来区分一些SQL,这些SQL语句具有相同的字符,但是不能被共享.因为他们引用了不同的底层对象.
举例来讲,
USER1@dbatest>conn yxyup
Enter password:
Connected.
YXYUP@dbatest>select * from t1 where id=1;
ID NAME
---------- --------
1 yxyup
1 yxyup
1 yxyup
YXYUP@dbatest>select sql_id,sql_text,version_count from v$sqlarea where sql_text like '%select * from t1 where id=%';
SQL_ID SQL_TEXT VERSION_COUNT
------------- ------------------------------------------------------------ -------------
5ag8kthgnvjk2 select * from t1 where id=1 1
YXYUP@dbatest>conn user1/abc123;
Connected.
USER1@dbatest>create table t1 as select * from yxyup.t1;
Table created.
USER1@dbatest>select * from t1 where id=1;
ID NAME
---------- --------
1 yxyup
1 yxyup
1 yxyup
YXYUP@dbatest>select sql_id,sql_text,version_count from v$sqlarea where sql_text like '%select * from t1 where id=%';
SQL_ID SQL_TEXT VERSION_COUNT
------------- ------------------------------------------------------------ -------------
5ag8kthgnvjk2 select * from t1 where id=1 2
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7364032/viewspace-600554/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7364032/viewspace-600554/