Required Grants For Users to run XA Distributed Transaction.
These are the required grants:
grant select on v$xatrans$ to public; (or to [user])
grant select on pending_trans$ to public;
grant select on dba_2pc_pending to public;
grant select on dba_pending_transactions to public;
grant execute on dbms_system to public; (or to [user])
Granting SELECT Privilege on V$XATRANS$ & DBA_PENDING_TRANSACTIONS Views
In the event that the TM needs to perform recovery, xa_recover will fail if you do not grant the SELECT privilege to the V$XATRANS$ view for all Oracle accounts that XA applications will use. If the view does not already exist in your Oracle installation then it can be manually loaded using the following SQL script which should be included in your Oracle installation:
$ORACLE_HOME/rdbms/admin/xaview.sql
The example below shows an extract from an Oracle XA Library trace file (for details of how to enable Oracle XA Library tracing in an OpenLink driver see here). Oracle returns error ORA-00942 : table or view does not exist because user scott does not have the necessary SELECT privilege on the V$XATRANS$ view.
ORACLE XA: Version 10.1.0.0.0. RM name = 'Oracle_XA'.
113956.2352:536.536.1:
xaoopen: xa_info=ORACLE_XA+Threads=true+SesTm=60+Acc=P/scott/tiger+DB=DB01BA5BF8+SQLNET=ORCL+DbgFl=0x1+LogDir=c:/,rmid=1,flags=0x0
113956.2352:536.536.1:
xaolgn_help: version#: 168821248 banner: Personal Oracle Database 10g Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
113956.2352:536.536.1:
xaoopen: return 0
113959.2352:536.536.1:
xaorecover: xids=0xf8f8f8, count=10, rmid=1, flags=0x1000000
113959.2352:536.536.1:
ORA-00942: table or view does not exist
113959.2352:536.536.1:
xaorecover: xaofetch rtn -3.
113959.2352:536.536.1:
xaoclose: xa_info=DSN=au49-ora10-carlv;UID=scott;PWD=tiger;+DB=DB01BA5BF8, rmid=1769209857, flags=0x0
113959.2352:536.536.1:
xaoclose: rtn 0
The syntax for adding the grant privilege to the 'scott' user would thus be:
grant select on V$XATRANS$ to scott;
In addtion, the "ORA-00942: table or view does not exist" error also occurs if select privileges are not granted on the DBA_PENDING_TRANSACTIONS view , requiring the following command to be executed as a DBA user:
GRANT SELECT ON DBA_PENDING_TRANSACTIONS TO PUBLIC