ORA-600(17113)错误

又是一个PL/DEVELOPER的bug。
客户数据库是9.2.0.8,告警日志中出现大量下面的错误信息:

Thu DEC 1 08:37:52 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_1995124.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Thu DEC 1 08:37:52 2011
Trace dumping IS performing id=[cdmp_20111201083752]
Thu DEC 1 08:38:21 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_1995124.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Thu DEC 1 08:39:47 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_2982400.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Thu DEC 1 08:41:32 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_1995124.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Thu DEC 1 08:42:13 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_1995124.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Thu DEC 1 08:43:37 2011
Errors IN file /oracle9/app/admin/db/udump/db1_ora_1995124.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []

在详细TRACE文件/oracle9/app/admin/db/udump/db1_ora_1995124.trc中,可以看到这是一个DEVELOPER工具发起的会话:

   O/S info: USER: Administrator, term: PC2011100510, ospid: 2676:2564, machine: WORKGROUP\PC2011100510
              program: plsqldev.exe
    application name: PL/SQL Developer, hash VALUE=1190136663
    action name: Main SESSION, hash VALUE=1773317990

而导致错误的SQL语句为:

DECLARE
  t_owner varchar2(30);
  t_name  varchar2(30);
  PROCEDURE check_mview IS
    dummy INTEGER;
  BEGIN
    IF :object_type = 'TABLE' THEN
      SELECT 1 INTO dummy
      FROM sys.all_objects
      WHERE owner = :object_owner
      AND object_name = :object_name
      AND object_type = 'MATERIALIZED VIEW'
      AND rownum = 1;
      :object_type := 'MATERIALIZED VIEW';
    END IF;
  exception
    WHEN others THEN NULL;
  END;
BEGIN
  :sub_object := NULL;
  IF :deep != 0 THEN
    BEGIN
      IF :part2 IS NULL THEN
        SELECT constraint_type, owner, constraint_name
          INTO :object_type, :object_owner, :object_name
          FROM sys.all_constraints c
         WHERE c.constraint_name = :part1 AND c.owner = USER
           AND rownum = 1;
      ELSE
        SELECT constraint_type, owner, constraint_name, :part3
          INTO :object_type, :object_owner, :object_name, :sub_object
          FROM sys.all_constraints c
         WHERE c.constraint_name = :part2 AND c.owner = :part1
           AND rownum = 1;
      END IF;
      IF :object_type = 'P' THEN :object_type := 'PRIMARY KEY'; END IF;
      IF :object_type = 'U' THEN :object_type := 'UNIQUE KEY'; END IF;
      IF :object_type = 'R' THEN :object_type := 'FOREIGN KEY'; END IF;
      IF :object_type = 'C' THEN :object_type := 'CHECK CONSTRAINT'; END IF;        
      RETURN;
    exception
      WHEN no_data_found THEN NULL;
    END;
  END IF;
  :sub_object := :part2;
  IF (:part2 IS NULL) OR (:part1 != USER) THEN
    BEGIN
      SELECT object_type, USER, :part1
      INTO :object_type, :object_owner, :object_name
      FROM sys.all_objects
      WHERE owner = USER
      AND object_name = :part1
      AND object_type IN ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
      AND rownum = 1;
      IF :object_type = 'SYNONYM' THEN
        SELECT s.table_owner, s.table_name
          INTO t_owner, t_name
          FROM sys.all_synonyms s
         WHERE s.synonym_name = :part1
           AND s.owner = USER
           AND rownum = 1;
        SELECT o.object_type, o.owner, o.object_name
          INTO :object_type, :object_owner, :object_name
          FROM sys.all_objects o 
         WHERE o.owner = t_owner
           AND o.object_name = t_name
           AND object_type IN ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
           AND rownum = 1;
      END IF;
      :sub_object := :part2;
      IF :part3 IS NOT NULL THEN
        :sub_object := :sub_object || '.' || :part3;
      END IF;
      check_mview;
      RETURN;
    exception
      WHEN no_data_found THEN NULL;
    END;
  END IF;
  BEGIN
    SELECT s.table_owner, s.table_name
      INTO t_owner, t_name
      FROM sys.all_synonyms s
     WHERE s.synonym_name = :part1
       AND s.owner = 'PUBLIC'
       AND rownum = 1;
    SELECT o.object_type, o.owner, o.object_name
      INTO :object_type, :object_owner, :object_name
      FROM sys.all_objects o 
     WHERE o.owner = t_owner
       AND o.object_name = t_name
       AND object_type IN ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
       AND rownum = 1;
    check_mview;
    RETURN;
  exception
    WHEN no_data_found THEN NULL;
  END;
  :sub_object := :part3;
  BEGIN
    SELECT o.object_type, o.owner, o.object_name
      INTO :object_type, :object_owner, :object_name
      FROM sys.all_objects o
     WHERE o.owner = :part1
       AND o.object_name = :part2
       AND object_type IN ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
       AND rownum = 1;
    check_mview;
    RETURN;
  exception
    WHEN no_data_found THEN NULL;
  END;
  BEGIN
    IF :part2 IS NULL AND :part3 IS NULL
    THEN
      SELECT 'USER', NULL, :part1
      INTO :object_type, :object_owner, :object_name
      FROM sys.all_users u
      WHERE u.username = :part1
      AND rownum = 1;
      RETURN;
    END IF;
  exception
    WHEN no_data_found THEN NULL;
  END;
  BEGIN
    IF :part2 IS NULL AND :part3 IS NULL AND :deep != 0
    THEN
      SELECT 'ROLE', NULL, :part1
      INTO :object_type, :object_owner, :object_name
      FROM sys.session_roles r
      WHERE r.role = :part1
      AND rownum = 1;
      RETURN;
    END IF;
  exception
    WHEN no_data_found THEN NULL;
  END;
  :object_owner := NULL;
  :object_type := NULL;
  :object_name := NULL;
  :sub_object := NULL;
END;

这显然是DEVELOPER在获取数据字典源数据时执行的SQL,关于这个错误的描述可以参考文档:ORA-00600: internal error code, arguments: [17113] using pl/sql developer [ID 396326.1]。
Oracle针对这个问题的解决方案只有一句,把pl/sql developer升级到最新版本。

This entry was posted in BUG and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *