0

我在 11.2.0.3 数据库上遇到了一个问题,一个奇怪的查询占了总数据库活动的 47.42%。

该应用程序是使用 Flex 开发的,前端是 Apache Tomcat 6.0.35,Java 版本为 1.6.0_27。

我在几个网站上搜索过,发现其他人有同样的问题,即使在这个网站上(神秘的 SQL 阻止我的存储过程在 ORACLE 上执行),但到目前为止没有找到解决方案:-(

查询是:

     SELECT package_name AS procedure_cat,
            owner AS procedure_schem,
            object_name AS procedure_name,
            argument_name AS column_name,
            DECODE(position,
                     0, 5,
                        DECODE(in_out,
                                 'IN',     1,
                                 'OUT',    4,
                                 'IN/OUT', 2,
                                           0)) AS column_type,
            DECODE (data_type,
                      'CHAR', 1,
                      'VARCHAR2', 12,
                      'NUMBER', 3,
                      'LONG', -1,
                      'DATE', 91,
                      'RAW', -3,
                      'LONG RAW', -4,
                      'TIMESTAMP', 93,
                      'TIMESTAMP WITH TIME ZONE', -101,
                      'TIMESTAMP WITH LOCAL TIME ZONE', -102,
                      'INTERVAL YEAR TO MONTH', -103,
                      'INTERVAL DAY TO SECOND', -104,
                      'BINARY_FLOAT', 100,
                      'BINARY_DOUBLE', 101,
                                       1111) AS data_type,
            DECODE(data_type,
                     'OBJECT', type_owner || '.' || type_name,
                               data_type) AS type_name,
            DECODE (data_precision,
                      NULL, data_length,
                            data_precision) AS precision,
            data_length AS length,
            data_scale AS scale,
            10 AS radix,
            1 AS nullable,
            NULL AS remarks,
            sequence,
            overload,
            default_value
  FROM all_arguments
  WHERE owner LIKE :1 ESCAPE '/'
        AND object_name LIKE :2 ESCAPE '/'
        AND package_name IS NULL
        AND (argument_name LIKE :5 ESCAPE '/'
             OR (argument_name IS NULL
                 AND data_type IS NOT NULL))
  ORDER BY procedure_schem, procedure_name, overload, sequence

我想知道是否有人找到了解决方案?

4

1 回答 1

1

您的代码是否使用了 Spring 的 SimpleJdbcCall 类?此类尝试获取有关存储过程的信息并缓存结果。因此,请确保您将 SimpleJdbcCall 类实例化一次,并在每次调用存储过程时重用它。

或者,您可以在构造 SimpleJdbcCall 对象时调用 withoutProcedureColumnMetaDataAccess()。

于 2016-01-08T22:43:25.053 回答