ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [答朋友问] version_count的意思

[答朋友问] version_count的意思

原创 Linux操作系统 作者:yxyup 时间:2009-05-20 15:32:38 0 删除 编辑
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 老师:

      请教一个问题,我在学习V$SQLTEXTV$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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2007-12-06

  • 博文量
    163
  • 访问量
    1325892