Another one
Kumar, May 03, 2002 - 8:48 am UTC
so if 100 user connected to oracle ,100 jvm instance will be there ,is that right?
May 03, 2002 - 11:18 am UTC
there is one real JVM, each session will get their own VJVM (a virtual java virtual machine). The all share the same "big" jvm. They each have their own "session" however (I cannot see your globals/static data and such)
How many no VJVM?
Kumar, May 03, 2002 - 5:13 pm UTC
How will i know how many no VJVM is running?
May 03, 2002 - 7:31 pm UTC
I don't know what you mean.
JVM
Vijays, May 04, 2002 - 3:20 am UTC
How do we know which version of JVM running ?
May 04, 2002 - 1:14 pm UTC
create or replace and compile java source named "props" as
public class props {
public static void show_props() {
System.getProperties().list(System.out);
}
}
/
show errors
create or replace procedure java_props
as language java name 'props.show_props()';
/
show errors
exec dbms_java.grant_permission( user, 'java.util.PropertyPermission','*','read,write' );
set serveroutput on size 10000
exec dbms_java.set_output(10000)
exec java_props
will do it:
ops$tkyte@ORA817DEV.US.ORACLE.COM> exec java_props
-- listing properties --
java.specification.name=Java Platform API Specification<b>
java.version=1.2.1</b>
oracle.aurora.mts.INIT=oracle.aurora.mts.rdbms.INIT
user.timezone=EST
JVM Performance
phil, August 23, 2004 - 2:59 am UTC
Hi Tom,
We have come to a point where we are seeing the Oracle JVM running java code more than 10 times slower than running the java code outside of Oracle. I have read a number of threads on Metalink where other users see similar issues. There seems to be no response from Oracle on these threads. Unfortunalty I cannot find where I can optimise this. We have altered database parameters in many ways to see if we can get changes, but to no avail.
Could you comment on your own experience with this. Is the Oracle JVM really inefficient ?
many thanks
August 23, 2004 - 7:32 am UTC
i cannot respond as I would never actually run any truly intense java inside my database.
if I could not do it in sql, i would do it in plsql. and if i could not do it in plsql -- I would use the smallest, tiniest piece of java possible called from plsql.
but given you give me nothing to actually *look at* here, i don't have that much to say.
continuation of above
phil, August 23, 2004 - 4:08 am UTC
sorry ..
the version of Oracle we are using is 9i r2. Also the java code we are testing with receives an object from a plsql stored procedure, this object is an array of about 5000 rows of data. The java returns a clob which is of XML. We have tried similar tests , whereby we just call the java passing the object and returning a string. The performance was the same.
many thanks
August 23, 2004 - 8:10 am UTC
no benchmark, no comment. something small, concise, yet 100% complete -- that we could all give a go with.
something to go on
phil, August 24, 2004 - 3:02 am UTC
appologies...
something simple ...
create or replace and compile
java source named "Mysp"
as
public class Mysp extends Object {
public static double test() {
double d = 0.0;
long p = System.currentTimeMillis();
for (int i=0; i<10000000; i++) {
d= d+ (i+0.1)*2;
}
long p2 = System.currentTimeMillis();
return d;
}
}
/
create or replace function test return number as
language java name 'Mysp.test() return double';
user@db> declare
2 n long;
3 begin
4 dbms_output.put_line(to_char(sysdate, 'dd/mm/yy hh:mi:ss'));
5 select test() into n from dual;
6 dbms_output.put_line(to_char(sysdate, 'dd/mm/yy hh:mi:ss'));
7 end;
8 /
24/08/04 06:15:50
24/08/04 06:15:58
PL/SQL procedure successfully completed.
as pure java .... 78 miliseconds
import java.util.Date;
public class My
{
public static void main(String[] args)
{
Date start = new Date();
double d = 0.0;
long p = System.currentTimeMillis();
for (int i = 0; i < 10000000; i++)
{
d = d + (i + 0.1) * 2;
}
long p2 = System.currentTimeMillis();
System.out.println((p2 - p) / 1000.0);
System.out.println(d);
Date end = new Date();
System.out.println( "diff " +(end.getTime() - start.getTime()) );
}
}
==============
0.078
9.999999201065402E13
diff 78
August 24, 2004 - 7:51 am UTC
guess you could try native compilation (or C)
How to find JVM (Java) Version in Oracle
Prasad Gunaratne, September 21, 2004 - 7:45 pm UTC
what do u mean by procedures and y do we go for it ?
Balaji, December 17, 2004 - 9:04 am UTC
where can i get a detailed description for procedures ?
December 17, 2004 - 2:43 pm UTC
?
guess I would start with the plsql documentation?
java oracle
Amit Kumar, January 18, 2007 - 4:59 am UTC
how to pass sysdate from java funtion to the oracle table