Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to enable oracle xa support?

Posted on 2006-06-26
12
4,085 Views
Last Modified: 2013-12-11
Hi ,

I need to enable oracle xa support for my 9.2.0.6 database. I think that for that ,at the db side 2 scripts need to be run right?

ie. initjvm.sql and initxa.sql. what is the order here- i mean which script to run first? also does this require any restart of oracle server?

awaiting to know..

thanks,
Nirav
0
Comment
Question by:Nirav_a_shah
  • 6
  • 6
12 Comments
 
LVL 16

Expert Comment

by:MohanKNair
ID: 16986590
Run the following as sysdba

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

Author Comment

by:Nirav_a_shah
ID: 16990265
Assuming that jvm is already installed, does running initjvm.sql cause any problems?

Thanks,
Nirav
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 16990292
You can verify that Oracle JVM is correctly installed by running SQL*Plus, connecting as SYSDBA, and issuing the following query

SQL> select version, status from dba_registry where comp_id='JAVAVM';

Ensure that the version is correct and the status is VALID. If it is correctly installed then there is no need to install again.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Nirav_a_shah
ID: 16990470
Mohan,

Thanks a lot! Running your query, I get no rows returned:
SQL>  select version, status from dba_registry where comp_id='JAVAVM';

no rows selected

Does this mean that in addition to initjvm.sql I need to run some other scripts as well to set up the oracle jvm?

0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 16990562
Did you install JVM?

See the links
How to Install Java on Oracle 8i
http://www.dbaoncall.net/references/ht_install_java.html

Oracle/Java FAQ
http://www.orafaq.com/faqjdbc.htm

Java Installation and Configuration
http://www.stanford.edu/dept/itss/docs/oracle/10g/java.101/b12021/config.htm#BABECEID
0
 

Author Comment

by:Nirav_a_shah
ID: 16990876
Mohan,

Sorry I must be sounding dumb..but since this is an environment where 30 guys are working..I wanted to be sure..

the question is:
given the details, to do the xa set up(and set up the jvm etc), do i need to run only initjvm.sql and initxa.sql or do i need to run other scripts too..

in this area I am new hence I am not risking any of my vague understanding..so could ou please help me again with answer to my above question. (is only initjvm.sql and initxa.sql needed to run or are other scripts needed too..)

Can not thank enough..
Nirav
0
 
LVL 16

Accepted Solution

by:
MohanKNair earned 500 total points
ID: 16990962
Minimal and recommended JVM related database memory parameters:

  shared_pool_size >= 60Mb       ->   recommended 65 MB
  java_pool_size>= 30Mb             ->   recommended 50 MB

  java_soft_sessionspace_limit            default 1 MB is used,  
  java_max_sessionspace_size            default of 4GB is used

Execute initjvm.sql script as sysdba

To determine Java status for the database we can query v$option dynamic view:

SQL > Select * from v$option;
SQL> SELECT count(*) FROM dba_objects  WHERE object_type LIKE '%JAVA%';
SQL> select count(*), owner from all_objects where object_type like '%JAVA%' group by owner;
SQL>  Describe DBMS_JAVA


Include ORACLE_HOME/jdbc/lib/classes12.zip in the classpath and this will expose all client side XA classes.

Load the following Java class using loadjava
ORACLE_HOME/javavm/lib/aurora.zip

Run initxa.sql
0
 

Author Comment

by:Nirav_a_shah
ID: 16991081
Mohan,

Thanks a ton! I am not sure on how to set the classpath..and using the loadjava.. we only have the path variable set..how to set the classpath?
should it be set to <Ora_home>/jdbc/lib in the .profile? what is the syntax of loading the aurora.zip class?

Thanks again
Nirav
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 16991169
LOADJAVA is a command line utility

loadjava -user <username>/<password> <classfile>


Loading and Dropping Java Objects
http://www.oracle-training.cc/teas_elite_util9.htm


Oracle and Java Stored Procedures
http://www.developer.com/db/article.php/10920_3337411_1



The database replacement for CLASSPATH is schema. All classes loaded within the database are referred to as class schema objects and are loaded within certain schemas. All JVM classes, such as java.lang.*, are loaded within PUBLIC. For example, if your schema is SCOTT, the database resolver (the database replacement for CLASSPATH) searches the SCOTT schema before PUBLIC. The listing of schemas to search is known as a resolver spec. Resolver specs are for each class, whereas in a classic Java virtual machine, CLASSPATH is global to all classes.

To make searching for dependent classes easier, Oracle provides a default resolver and resolver spec that searches first the definer's schema and then PUBLIC. This covers most of the classes loaded within the database. However, if you are accessing classes within a schema other than your own or PUBLIC, you must define your own resolver spec.

loading using Oracle's default resolver, which searches the definer's schema and PUBLIC:
loadjava -resolve
 

loading using your own resolver spec definition containing the SCOTT schema, OTHER schema, and PUBLIC:
loadjava -resolve -resolver "((* SCOTT)(* OTHER)(* PUBLIC))"

http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/java.920/a96659/02_load.htm
0
 

Author Comment

by:Nirav_a_shah
ID: 16991314
Mohan,

This is awesome! I am just a novice as far as java is related.. could you please provide me just the syntax i need to give.

e.g. after running the initjvm.sql, do i have to specify:

loadjava -user  ORACLE_HOME/javavm/lib/aurora.zip

(what value i have to specify for user. is it sys?)

also the question about classpath, how to set it?
thanks a lot!
Nirav
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 16991385
The USER is the same user running initxa.sql

loadjava -user sys/<passwd> ORACLE_HOME/javavm/lib/aurora.zip

Oracle will search for java classees in the current schema. Schema is the database replacement for CLASSPATH.
0
 

Author Comment

by:Nirav_a_shah
ID: 16991744
Thanks Mohan this is such a great help to me!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to recover a database from a user managed backup

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question