00600 exception in Oracle

For testing purposes I need a couple of SQL scripts that will cause an ORA-00600 error in Oracle, version 11.1.0.7.

The database is not empty, it is filled with the data of a fresh install of Vision Demo E-Business Suite.

This system is a training ground for students studying Oracle. It will be used to develop their troubleshooting skills. Why SQL? Because this scripts reproduction should be automated. We will randomize the issue occurrence to create a model of a real bugging system for mastering troubleshooting activity.

What exactly I need is 4-5 different ways to cause ORA-00600 error.


You can't cause an ORA-00600 "naturally"; it's a generic exception that covers internal Oracle exceptions. So, unless you know of an Oracle bug that causes this or want to deliberately corrupt your database you've got no chance.

What you can do is raise an application error yourself, which can mimic that exception:

declare
   internal_exception EXCEPTION;
   PRAGMA EXCEPTION_INIT( internal_exception, -600 );
begin
  raise internal_exception;
end;
/
declare
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], [], [], [], [], []
ORA-06512: at line 5

If you have to do this from SQL you can convert the above into a function:

create or replace function raise_600 return number is
   internal_exception EXCEPTION;
   PRAGMA EXCEPTION_INIT( internal_exception, -600 );
begin
  raise internal_exception;
  return 1;
end;

Then just call it:

select raise_600 from dual

As per here:

ORA-600 is an internal error generated by the generic kernel code of the Oracle RDBMS software. It is different from other Oracle errors in many ways. Possible causes include:

  • time-outs,
  • file corruption,
  • failed data checks in memory, hardware, memory, or I/O messages,
  • incorrectly restored files
  • a SELECT FROM DUAL statement in PL/SQL within Oracle Forms (you have to use SELECT FROM SYS.DUAL instead!)
  • So, in order to generate these errors, you probably need to cause some serious damage to your database, not something I'd advise. The last bullet point above may be a way to do it so I'd test that first.


    May be all toghether we can find good examples for you ...

    Just to start a collection:

    №1 (found here)

    create table t(a clob);
    
    insert into t values(utl_raw.cast_to_varchar2('EC'));
    

    №2 Didn't return ORA-600 to client, just drops connection. But this error may be found in server logs. This case must be verified because I don't have access to test environment at the moment. Please, add a comment to indicate if such cases are interesting.

    create table t1(id number);
    create table t2(id number);
    
    insert into t1(id) values(1);
    insert into t1(id) values(2);
    insert into t2(id) values(1);
    insert into t2(id) values(2);
    
    select 
      ta.id
    from 
      t1 ta
      join (
        select id 
        from t2 
        start with id = 1 connect by prior id + 1= id 
      ) tb 
        on prior ta.id = tb.id
    start with 
      ta.id = 2
    connect by 
      prior ta.id - 1 = ta.id
    
    链接地址: http://www.djcxy.com/p/6300.html

    上一篇: 将Oracle DATE列修改为TIMESTAMP时必须考虑的事项

    下一篇: Oracle中的00600异常