Intentional reason for ORA-00600 exception in Oracle

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

The database is not empty, it is filled with data from the new installation 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 the reproduction of these scenarios should be automated. We will randomize the occurrence of the problem in order to create a model of a real error system for mastering troubleshooting steps.

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

Note. This question is not about explaining what the ORA-600 error is, or how to fix them. This question is about the intentional occurrence of the ORA-600 error.

+4
source share
4 answers

You cannot call ORA-00600 "naturally"; this is a general exception that covers Oracle internal exceptions. So, if you are not aware of the Oracle error that causes this or wants to intentionally ruin your database, you have no chance.

What you can do is to independently cause an application error that can mimic this 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

SQL, :

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;

:

select raise_600 from dual
+5

:

ORA-600 - , Oracle RDBMS. Oracle . :

  • -,
  • ,
  • , , /,
  • a SELECT FROM DUAL PL/SQL Oracle Forms ( SELECT FROM SYS.DUAL!)

, , , , , , . , , , .

+3

, ...

, :

№1 ( )

create table t(a clob);

insert into t values(utl_raw.cast_to_varchar2('EC'));

№2 ORA-600 , . . , . , , , .

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
+1

(Aunque con 4 años de retraso), , UTL_FILE.PUT_LINE des un un formulario de FORMS.

0

Source: https://habr.com/ru/post/1525010/


All Articles