No great genius has ever existed without some touch of madness.

Monday 23 March 2015

Oracle Multimedia , JAVAM and XML components , ora-04031

To install Oracle Multimedia, first you need to check for the existence of  JAVAM and XML components into database.


"Where to Find the Information to Install, Upgrade, Downgrade and Deinstall interMedia/Oracle Multimedia? (Doc ID 337415.1)"


"How to Reload the JVM in 11.2.0.x (Doc ID 1112983.1)" and use "Javavm Component Invalid and ORA-04031 Reported for "java pool" (Doc ID 1448032.1)" to troubleshoot error coming while installing JVM


-- Start of File full_rmjvm.sql
> spool full_rmjvm.log
> set echo on
> connect / as sysdba
> startup mount
> alter system set "_system_trig_enabled" = false scope=memory;
> alter system enable restricted session;
> alter database open;
> @?/rdbms/admin/catnoexf.sql
> @?/rdbms/admin/catnojav.sql
> @?/xdk/admin/rmxml.sql
> @?/javavm/install/rmjvm.sql
truncate table java$jvm$status;
select * from obj$ where obj#=0 and type#=0;
delete from obj$ where obj#=0 and type#=0;
commit;
select owner, count(*) from all_objects
where object_type like '%JAVA%' group by owner;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
select o1.name from obj$ o1,obj$ o2
where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.type#=29;
shutdown immediate
set echo off
spool off
exit
-- End of File full_rmjvm.sql





Please note that @?/javavm/install/initjvm.sql can fail if java_pool_size is small,so as per docs it has to be increased to atleast a value of 150M

-- Start of File full_jvminst.sql
> spool full_jvminst.log;
> set echo on
> connect / as sysdba
> startup mount
> alter system set "_system_trig_enabled" = false scope=memory;
> alter database open;
> select obj#, name from obj$
   where type#=28 or type#=29 or type#=30 or namespace=32;
> @?/javavm/install/initjvm.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
> @?/xdk/admin/initxml.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
> @?/xdk/admin/xmlja.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
> @?/rdbms/admin/catjava.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
> @?/rdbms/admin/catexf.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
> shutdown immediate
> set echo off
> spool off
> exit
-- End of File full_jvminst.sql


Please validate :
> select version, status from dba_registry where comp_id='JAVAVM';
VERSION                        STATUS
------------------------------ -----------
11.2.0.3.0                     VALID

> select version, status from dba_registry where comp_id='XDB';
VERSION                        STATUS
------------------------------ -----------
11.2.0.3.0                     VALID

> select version, status from dba_registry where comp_id='XML';
VERSION                        STATUS
------------------------------ -----------
11.2.0.3.0                     VALID






Now, proceeding to ORACLE MULTIMEDIA Installation steps :

Installation steps for Oracle Multimedia can be found at : $ORACLE_HOME/ord/im/admin/README.txt
"Verifying an Installed Version of Oracle Multimedia (Doc ID 458228.1)"

Installing Oracle Multimedia
============================
Oracle Multimedia is installed and configured with Oracle Database.
If you need to configure Oracle Multimedia manually, follow the
instructions in this section.
        1 Installation Decisions
        2 Pre-Installation Steps
        3 Installation Steps
1 Installation Decisions
------------------------
  The installation procedure creates the users ORDSYS, ORDPLUGINS,
  SI_INFORMTN_SCHEMA, ORDDATA, and MDSYS.  These user are created with
  the privileges required for Oracle Multimedia.
  Decision 1: Decide which tablespace to use for Oracle Multimedia users
  (ORDSYS, ORDPLUGINS, SI_INFORMTN_SCHEMA, and ORDDATA), and which
  tablespace to use for the Oracle Spatial/Oracle Multimedia Location
  Services user (MDSYS).  Oracle recommends using the SYSAUX tablespace
  for both.

2 Pre-Installation Steps
------------------------
  For more instructions on installing on your system and setting
  up your environment, see the Oracle Installation Guide for your
  operating system.
  Perform the following pre-installation tasks prior to manually
  installing and configuring Oracle Multimedia:
 
  2.1 Install Oracle Database, including PL/SQL, Oracle JVM, Oracle XML
      Database, and Oracle XDK.
  2.2 Create the database.
  2.3 Start the database.
  2.4 Verify that required software is installed and valid.
      To verify that required software is correctly installed, run SQL*Plus,
      connect AS SYSDBA, and enter the following queries:
      SQL> select version, status from dba_registry where comp_id='JAVAVM';
      SQL> select version, status from dba_registry where comp_id='XDB';
      SQL> select version, status from dba_registry where comp_id='XML';
      Ensure that the versions are correct and the status values are 'VALID'.

3 Installation Steps
--------------------
  Perform the following mandatory configuration steps. These steps are
  required ONLY if you are configuring Oracle Multimedia manually.
  You do NOT need to perform these steps if you use the Database
  Configuration Assistant.
  References to <ORACLE_HOME> in these instructions represent the Oracle
  home directory.

3.1 Use the Oracle Universal Installer to install the files that make
    up Oracle Multimedia on your system.
3.2 Create the users and grant the appropriate privileges.
    1) Start SQL*Plus and connect as SYSDBA.
    2) Invoke ordinst.sql with two parameters for the Oracle
       Multimedia tablespace and the Oracle Location Services
       tablespace.
       SQL> @<ORACLE_HOME>/ord/admin/ordinst.sql SYSAUX SYSAUX (on Linux/UNIX)
            @<ORACLE_HOME>\ord\admin\ordinst.sql SYSAUX SYSAUX (on Windows)
3.3 Install Oracle Multimedia types and packages.
    1) Start SQL*Plus and connect as SYSDBA.
    2) Invoke catim.sql
       SQL> @<ORACLE_HOME>/ord/im/admin/catim.sql (on Linux/UNIX)
            @<ORACLE_HOME>\ord\im\admin\catim.sql (on Windows)

After these mandatory installation steps have been completed, Oracle
Multimedia is ready for use.
                        =======================

Verifying the Oracle Multimedia Installation
============================================
After you have installed or upgraded Oracle Multimedia, you can verify the
Oracle Multimedia installation by invoking the Oracle Multimedia validation
procedure.
To run the Oracle Multimedia validation procedure, connect as SYSDBA and
execute the procedure validate_ordim as follows:
    1) Start SQL*Plus and connect AS SYSDBA.
    2) Execute SYS.validate_ordim
       SQL> execute SYS.validate_ordim;
   
    The validation procedure silently  sets the Oracle Multimedia registry
    entry to 'VALID' if Oracle Multimedia is valid.  If there are invalid
    objects detected, the validation procedure lists the first few invalid
    objects and sets the registry entry to 'INVALID'.
    To query the registry entry for Oracle Multimedia, run SQL*Plus, connect
    AS SYSDBA, and enter the following query:
       SQL> select version, status from dba_registry where comp_id='ORDIM';

Ensure that the version is correct and the status is 'VALID'.