When our developers run their code on Our db( version is 11.2.0.4,OS AIX 7.1.), they hit ORA-29538&ORA-06512 errors.

Here is the error messages:

ORA-29538:Java not installed
ORA-06512:at_konum “XXX.UNZIPPER_PKG”, line 2
ORA-06512:at “XXX.UNZIPPER_PKG”, line 12
ORA-06512:at “XXX.UNZIP”, line 4

Here is the code samples:

CREATE OR REPLACE PACKAGE XXX.unzipper_pkg AS
PROCEDURE UNZIP(src IN BLOB, dst IN OUT CLOB);
FUNCTION UNZIP (src IN BLOB) RETURN CLOB;
END;
/

CREATE OR REPLACE PUBLIC SYNONYM UNZIPPER_PKG FOR XXX.UNZIPPER_PKG;
GRANT EXECUTE ON XXX.UNZIPPER_PKG TO CONNECT;

CREATE OR REPLACE PACKAGE BODY XXX.unzipper_pkg AS
PROCEDURE UNZIP(src IN BLOB, dst IN OUT CLOB)
AS LANGUAGE JAVA
NAME ‘com.oracle.Unzipper.unzipClob(oracle.sql.BLOB, oracle.sql.CLOB[])’;

FUNCTION UNZIP(src IN blob) RETURN clob
IS
lvResult clob;
BEGIN
IF src is not null THEN
DBMS_LOB.createtemporary(lvResult, true, DBMS_LOB.CALL);
UNZIP(src, lvResult);
END IF;
RETURN lvResult;
END UNZIP;
END;
/
CREATE OR REPLACE PUBLIC SYNONYM UNZIPPER_PKG FOR XXX.UNZIPPER_PKG;
GRANT EXECUTE ON XXX.UNZIPPER_PKG TO CONNECT;

So I started to investigate issue :

# sqlplus “/as sysdba”

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> set linesize 1000
SQL> select distinct owner,name from dba_source where lower(NAME)=’dbms_java’;

no rows selected

SQL> select comp_name, version, status from dba_registry;
COMP_NAME VERSION STATUS
————————- —————————— ———————-
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
SQL> select distinct owner,name from dba_source where NAME=’DBMS_JAVA’;

no rows selected

So as you can see there is no Java component on that database. So how we will fix it?

1. Set your env.
2. Go to under $ORACLE_HOME/javavm/install/
3. Connect db as sysdba
4. run initjvm.sql such as @initjvm.sql

You will see lots of line like:
PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Package created.

Package body created.

No errors.
Call completed.

And so on.. When you see SQL prompt again, let us check latest status of components

SQL> select comp_name, version, status from dba_registry
COMP_NAME VERSION STATUS
————————- —————————— ———————-
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
JServer JAVA Virtual Machine 11.2.0.4.0 VALID

As you can see JServer JAVA Virtual Machine has been added to list. After those steps developer team can run code without any error message

Advertisements