Configure Oracle Database to support XA resources JAVA_XA

Working with Oracle Database appliance, issue could arise if xa configuration wasn’t chosen during instance creation: In this scenario: OracleDS – The primary IJIS Broker IBTL database data source required for the IJIS Broker application startup/functionality. ODA by default will not have xa configuration. So IJIS broker is configured to point to the hostscandns_name/DBNAME, you get the fatal exception included in the attached log file and the IJIS Broker application will not start/function correctly.

First check the versions of IJIS Broker application/application server software, runtime environment, and drivers related to the IJIS Broker XA Oracle database connection below:

JAVA Application Server: JBoss 5.0.1 GA
JAVA Runtime (JDK/JRE): JAVA 1.6.0_45
Oracle JDBC Thin Driver: OJDBC6.JAR

Solution:
The ODA database may have not be configured to support XA resources as JAVA_XA is missing when checked with the following query:

select * from dba_objects where object_name = ‘JAVA_XA’;   ==> No row selected

no xa  IJIS Broker Connectivity.jpg

There are two ways to configure this:

Method 1: Run initxa.sql (and/ initjvm.sql) package

Execute initxa.sql and initjvm.sql located in $ORACLE_HOME\javavm\install directory. Log into your Oracle Database as SYSOPER or SYSDBA to have the necessary permissions for the scripts to work.

When executed, the initxa.sql script configures the database for XA resources. if it runs successfully, your database is now configured for XA resources.

         Note: The script may run successfully the first time you try. If it does not run successfully, some of the SGA memory components allocations for the database maybe too small and need to be increased. To resolve this, run the initjvm.sql script. It will probably fail too, but in doing so it will indicate which parameters/components needs to be adjusted.

The parameters are stored in the init.ora and spfileSID.ora. Depending on your database configuration, it may require adjusting different parameters. In one of my cases, it indicated increasing the java_pool_size and shared_pool_size parameters which are typically the case when not using ASMM or AMM.

Minimum Value required for these Parameters to configure XA resources are:
java_pool_size 12000000
shared_pool_size 24000000

After successfully performing above execution, rerun the query and it should show you 3 object types and JAVA directories: package, package body and synonym
                 select * from dba_objects where object_name = ‘JAVA_XA’;

Validate DB is configured to support XA resources for IJIS Broker Connectivity.jpg

Method 2: Using DBCA and Most recommended fix

You can also launch the database configuration assistance – DBCA to add this feature. XA is an optional feature that has to be checked in Oracle Database Appliance during database instance creation when using DBCA. Unfortunately, this feature is not often being enabled during creation using oakcli utility:

DBCA > Configure Database Options > Instance_Name >  Next > Advance Option > check XA > Next > Sys_pwd > Finish.

Wait for the creation to complete and rerun above query to see JAVA_XA packages and directories

Leave a comment