Saturday, November 17, 2007

How to enable XA transactions in Oracle

Thanks to David P. for this guide.

You need to login to the oracle server as the sys user:

my-server# sqlplus SYS as SYSDBA

and run the sql included in these two files:

$ORACLE_HOME/javavm/install/initxa.sql
$ORACLE_HOME/javavm/install/initjvm.sql

From sqlplus it looks like:
SQL> @/opt/oracle/10.2.0/javavm/install/initxa.sql
SQL> @/opt/oracle/10.2.0/javavm/install/initjvm.sql

It is possible that initjvm.sql has already been run by installer so second script may fail with such warning.

You then need to run the following grant statements:

grant select on pending_trans$ to public;
grant select on dba_2pc_pending to public;
grant select on dba_pending_transactions to public;

Then execute the following grant statement once for each oracle user you want to participate in XA transaction

grant execute on dbms_system to ;

where is your username (don't include the angle brackets)

No comments: