26 June 2011

Oracle 11g Express Edition bug?

Of course you know that Oracle has released 11g Express Edition, still in Beta though. That is probably why I ran into something weird -must be a bug- while playing with it. Here is what I did:

SQL> set echo on
SQL> col "Current_Edition" format a20
SQL> col object_name format a20
SQL>
SQL> select sys_context('userenv'
2 ,'current_edition_name'
3 ) "Current_Edition"
4 from dual
5 /

Current_Edition
--------------------
ORA$BASE

1 row selected.

SQL>
SQL> create or replace
2 procedure hello
3 is
4 begin
5 dbms_output.put_line ('Hello World');
6 end hello;
7 /

Procedure created.

SQL>
SQL> begin
2 hello;
3 end;
4 /
Hello World

PL/SQL procedure successfully completed.

SQL>
SQL> select object_name
2 , object_type
3 , edition_name
4 from user_objects_ae
5 where object_name = 'HELLO'
6 /

OBJECT_NAME OBJECT_TYPE EDITION_NAME
-------------------- ------------------- ------------------------------
HELLO PROCEDURE

1 row selected.

SQL>


Notice how the Edition_name column is empty...
That is not right, it should show the name of the edition, which it does in Oracle Enterprise Edition as can be seen here.
UPDATE How wrong I was,... of course this is correct; the user wasn't Edition Enabled.
Let's continue and see what happens when you introduce a new edition.

SQL>
SQL> create edition R1 as child of ora$base
2 /

Edition created.

SQL>
SQL>
SQL> alter session set edition = R1
2 /

Session altered.

SQL>
SQL> create or replace
2 procedure hello
3 is
4 begin
5 dbms_output.put_line ('Hello Universe');
6 end hello;
7 /

Procedure created.

SQL>
SQL> begin
2 hello;
3 end;
4 /
Hello Universe

PL/SQL procedure successfully completed.

SQL>
SQL> select object_name
2 , object_type
3 , edition_name
4 from user_objects_ae
5 where object_name = 'HELLO'
6 /

OBJECT_NAME OBJECT_TYPE EDITION_NAME
-------------------- ------------------- ------------------------------
HELLO PROCEDURE

1 row selected.

The procedure works as expected, showing the right information but there is something really weird going on.
There should be two entries in the USER_OBJECTS_AE, one for ORA$BASE and one for R1...

What if we were to retire the ORA$BASE edition? Let's try that.

SQL>
SQL> conn sys/oracle@xe11 as sysdba
Connected.
SQL>
SQL> ALTER DATABASE DEFAULT EDITION = r1
2 /

Database altered.

SQL> drop edition ora$base cascade
2 /

Edition dropped.

And now for the ORA-00600...

After a shutdown (of my VM), I get this message when using DBMS_OUTPUT:

SQL> begin
2 hello;
3 end;
4 /
begin
*
ERROR at line 1:
ORA-22303: type "SYS"."DBMSOUTPUT_LINESARRAY" not found
ORA-00600: internal error code, arguments: [kkaegen_get_edition_name_1], [], [], [], [], [], [], [], [], [], [], []
ORA-06508: PL/SQL: could not find program unit being called: "PUBLIC.DBMS_OUTPUT"
ORA-06512: at "ALEX.HELLO", line 4
ORA-06512: at line 2


By looking at it, I get a feeling that it has something to do with EBR...
UPDATE: After contacting Bryn Llewellyn, PL/SQL product manager, a bug was filled: 12758386.

Links


Retiring Editions
Oracle Database 11.2 Express Edition Beta

No comments:

Post a Comment