Oracle视图V$SQLAREA的定义

ZDNet软件频道 时间:2009-02-04 作者:盖国强 | eygle.com 我要评论()
本文关键词:视图 Oracle 11g 盖国强 Oracle Oracle
Oracle中视图V$SQLAREA的定义方法。
racle GV$SQLAREA / V$SQLAREA view Definition,Just record for myself.

This is the definition from Oracle10g 10.2.0.3 :
SELECT inst_id, kglnaobj, kglfnobj, kglobt03,
      kglobhs0 + kglobhs1 + kglobhs2 + kglobhs3 + kglobhs4 + kglobhs5
      + kglobhs6,
      kglobt08 + kglobt11, kglobt10, kglobt01, kglobccc, kglobclc, kglhdlmd,
      kglhdlkc, kglobt04, kglobt05, kglobt48, kglobt35, kglobpc6, kglhdldc,
      SUBSTR (TO_CHAR (kglnatim, "YYYY-MM-DD/HH24:MI:SS"), 1, 19), kglhdivc,
      kglobt12, kglobt13, kglobwdw, kglobt14, kglobwap, kglobwcc, kglobwcl,
      kglobwui, kglobt42, kglobt43, kglobt15, kglobt02,
      DECODE (kglobt32,
              0, "NONE",
              1, "ALL_ROWS",
              2, "FIRST_ROWS",
              3, "RULE",
              4, "CHOOSE",
              "UNKNOWN"
              ),
      kglobtn0, kglobcce, kglobcceh, kglobt17, kglobt18, kglobts4, kglhdkmk,
      kglhdpar, kglnahsh, kglobt46, kglobt30, kglobts0, kglobt19, kglobts1,
      kglobt20, kglobt21, kglobts2, kglobt06, kglobt07,
      DECODE (kglobt28, 0, NULL, kglobt28), kglhdadr,
      DECODE (BITAND (kglobt00, 64), 64, "Y", "N"),
      DECODE (kglobsta,
              1, "VALID",
              2, "VALID_AUTH_ERROR",
              3, "VALID_COMPILE_ERROR",
              4, "VALID_UNAUTH",
              5, "INVALID_UNAUTH",
              6, "INVALID"
              ),
      kglobt31, kglobtt0, DECODE (kglobt33, 1, "Y", "N"), kglhdclt, kglobts3,
      kglobt44, kglobt45, kglobt47, kglobt49, kglobcla, kglobcbca
  FROM x$kglcursor_child_sqlid
WHERE kglobt02 != 0

The fllowing is the definition from Oracle9iR2 9.2.0.4:

SELECT  inst_id, kglnaobj,
        SUM (  kglobhs0
              + kglobhs1
              + kglobhs2
              + kglobhs3
              + kglobhs4
              + kglobhs5
              + kglobhs6
            ),
        SUM (kglobt08 + kglobt11), SUM (kglobt10), SUM (kglobt01),
        COUNT (*) - 1, SUM (DECODE (kglobhs6, 0, 0, 1)),
        DECODE (SUM (DECODE (kglhdlmd, 0, 0, 1)),
                0, 0,
                SUM (DECODE (kglhdlmd, 0, 0, 1)) - 1
                ),
        SUM (kglhdlkc) / 2, SUM (kglobt04), SUM (kglobt05), SUM (kglobpc6),
        SUM (kglhdldc) - 1,
        SUBSTR (TO_CHAR (kglnatim, "YYYY-MM-DD/HH24:MI:SS"), 1, 19),
        SUM (kglhdivc), SUM (kglobt12), SUM (kglobt13), SUM (kglobt14),
        SUM (kglobt15), SUM (DECODE (kglobt09, 0, kglobt02, 0)),
        DECODE (COUNT (*) - 1,
                1, DECODE (SUM (DECODE (kglobt09, 0, kglobt32, 0)),
                            0, "NONE",
                            1, "ALL_ROWS",
                            2, "FIRST_ROWS",
                            3, "RULE",
                            4, "CHOOSE",
                            "UNKNOWN"
                          ),
                "MULTIPLE CHILDREN PRESENT"
                ),
        SUM (DECODE (kglobt09, 0, kglobt17, 0)),
        SUM (DECODE (kglobt09, 0, kglobt18, 0)),
        DECODE (SUM (DECODE (kglhdkmk, 0, 0, 1)),
                0, 0,
                SUM (DECODE (kglhdkmk, 0, 0, 1)) - 1
                ),
        kglhdpar, kglnahsh, kglobts0, kglobt19, kglobts1, kglobt20,
        SUM (kglobt21), SUM (kglobt06), SUM (kglobt07),
        DECODE (kglobt33, 1, "Y", "N"), kglhdclt
    FROM x$kglcursor
GROUP BY inst_id,
        kglnaobj,
        kglhdpar,
        kglnahsh,
        kglnatim,
        kglobts0,
        kglobt19,
        kglobts1,
        kglobt20,
        DECODE (kglobt33, 1, "Y", "N"),
        kglhdclt
  HAVING SUM (DECODE (kglobt09, 0, kglobt02, 0)) != 0

查看本文来源

视图

Oracle 11g

盖国强

Oracle

Oracle


百度大联盟认证黄金会员Copyright© 1997- CNET Networks 版权所有。 ZDNet 是CNET Networks公司注册服务商标。
中华人民共和国电信与信息服务业务经营许可证编号:京ICP证010391号 京ICP备09041801号-159
京公网安备:1101082134