Home » RDBMS Server » Server Administration » How do we check oracle database uses java or not (Oracle 9i,10g on Unix Machines)
How do we check oracle database uses java or not [message #467392] Fri, 23 July 2010 13:39 Go to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
Actually in our environment , sysadmins are upgrading java versions on Unix (HP & Solaris) Machines and they have asked the query whether oracle database uses Java or not?

If it uses then all the databases need to be shut down for their planned activities and if not no need to shutdown the databases.

Im the DBA need to confirm them ASAP.

Thanks in Advance
Re: How do we check oracle database uses java or not [message #467394 is a reply to message #467392] Fri, 23 July 2010 13:41 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>whether oracle database uses Java or not?
You need to ask local DBA; not us because we don't know if you do or not.
Java inside Oracle RDBMS is optional.
Re: How do we check oracle database uses java or not [message #467397 is a reply to message #467392] Fri, 23 July 2010 13:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Actually in our environment , sysadmins are upgrading java versions on Unix (HP & Solaris) Machines and they have asked the query whether oracle database uses Java or not?

Oracle rdbms does not use OS Java, it uses its embedded Java engine (if installed).
Some Oracle tools (like OUI) use Java but they use the one that is in Oracle delivery and not the OS one.

Regards
Michel

[Updated on: Fri, 23 July 2010 14:14]

Report message to a moderator

Re: How do we check oracle database uses java or not [message #467401 is a reply to message #467392] Fri, 23 July 2010 14:07 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
Java inside Oracle RDBMS is optional ? what does it mean and I already updated Im the DBA and query at database level .
Please provide me the query to find out whether oracle database is
using Java or not ?
Re: How do we check oracle database uses java or not [message #467402 is a reply to message #467401] Fri, 23 July 2010 14:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Count the java classes in DBA_OBJECTS.

Regards
Michel
Re: How do we check oracle database uses java or not [message #467403 is a reply to message #467397] Fri, 23 July 2010 14:11 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
Seems your updates are true, thanks Micheal
Re: How do we check oracle database uses java or not [message #467406 is a reply to message #467402] Fri, 23 July 2010 14:16 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
How do we count the java classes ? please provide me the query.
Re: How do we check oracle database uses java or not [message #467409 is a reply to message #467406] Fri, 23 July 2010 14:18 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
  1* CREATE OR REPLACE FUNCTION get_java_property (prop IN VARCHAR2) RETURN VARCHAR2 IS LANGUAGE JAVA name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';
SQL> /

Function created.

SQL> SELECT get_java_property('java.version') FROM dual; 

GET_JAVA_PROPERTY('JAVA.VERSION')
--------------------------------------------------------------------------------
1.5.0_10
Re: How do we check oracle database uses java or not [message #467412 is a reply to message #467409] Fri, 23 July 2010 14:23 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
SQL> CREATE OR REPLACE FUNCTION get_java_property (prop IN VARCHAR2) RETURN VARCHAR2 IS LANGUAGE JAVA name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';
2 /

Function created.

SQL> SELECT get_java_property('java.version') FROM dual;
SELECT get_java_property('java.version') FROM dual
*
ERROR at line 1:
ORA-29540: class java/lang/System does not exist
Re: How do we check oracle database uses java or not [message #467414 is a reply to message #467412] Fri, 23 July 2010 14:25 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>ORA-29540: class java/lang/System does not exist
CONGRATULATIONS!
You have your answer
Re: How do we check oracle database uses java or not [message #467415 is a reply to message #467406] Fri, 23 July 2010 14:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
ashfaqhdba wrote on Fri, 23 July 2010 21:16
How do we count the java classes ? please provide me the query.

Have a look at OBJECT_TYPE in DBA_OBJECTS.

Regards
Michel

Re: How do we check oracle database uses java or not [message #467416 is a reply to message #467415] Fri, 23 July 2010 14:40 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
SQL> select distinct object_type from dba_objects;

OBJECT_TYPE
------------------
CLUSTER
CONSUMER GROUP
DATABASE LINK
DIRECTORY
EVALUATION CONTEXT
FUNCTION
INDEX
INDEX PARTITION
LIBRARY
LOB
MATERIALIZED VIEW

OBJECT_TYPE
------------------
OPERATOR
PACKAGE
PACKAGE BODY
PROCEDURE
QUEUE
RESOURCE PLAN
SEQUENCE
SYNONYM
TABLE
TABLE PARTITION
TRIGGER

OBJECT_TYPE
------------------
TYPE
TYPE BODY
VIEW

Re: How do we check oracle database uses java or not [message #467418 is a reply to message #467416] Fri, 23 July 2010 14:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
  1* select object_type , count(*) from dba_objects  group by object_type order by 1
SQL> /

OBJECT_TYPE	      COUNT(*)
------------------- ----------
CLUSTER 		    10
CONSUMER GROUP		    25
CONTEXT 		     7
DESTINATION		     2
DIMENSION		     5
DIRECTORY		     8
EDITION 		     1
EVALUATION CONTEXT	    15
FUNCTION		   303
INDEX			  3914
INDEX PARTITION 	   396

OBJECT_TYPE	      COUNT(*)
------------------- ----------
INDEXTYPE		     9
JAVA CLASS		 22920
JAVA DATA		   328
JAVA RESOURCE		   834
JAVA SOURCE		     2
JOB			    15
JOB CLASS		    13
LIBRARY 		   183
LOB			   921
LOB PARTITION		     1
MATERIALIZED VIEW	     3

OBJECT_TYPE	      COUNT(*)
------------------- ----------
OPERATOR		    55
PACKAGE 		  1310
PACKAGE BODY		  1250
PROCEDURE		   171
PROGRAM 		    19
QUEUE			    40
RESOURCE PLAN		    10
RULE			     1
RULE SET		    23
SCHEDULE		     3
SCHEDULER GROUP 	     4

OBJECT_TYPE	      COUNT(*)
------------------- ----------
SEQUENCE		   230
SYNONYM 		 27805
TABLE			  2892
TABLE PARTITION 	   258
TRIGGER 		   617
TYPE			  2823
TYPE BODY		   243
UNDEFINED		     9
VIEW			  5059
WINDOW			     9
XML SCHEMA		    52

44 rows selected.

Re: How do we check oracle database uses java or not [message #467419 is a reply to message #467418] Fri, 23 July 2010 14:46 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
OBJECT_TYPE COUNT(*)
------------------ ----------
CLUSTER 10
CONSUMER GROUP 4
DATABASE LINK 11
DIRECTORY 1
EVALUATION CONTEXT 1
FUNCTION 47
INDEX 703
INDEX PARTITION 25
LIBRARY 62
LOB 49
MATERIALIZED VIEW 108

OBJECT_TYPE COUNT(*)
------------------ ----------
OPERATOR 2
PACKAGE 336
PACKAGE BODY 328
PROCEDURE 44
QUEUE 8
RESOURCE PLAN 3
SEQUENCE 73
SYNONYM 1957
TABLE 702
TABLE PARTITION 27
TRIGGER 16

OBJECT_TYPE COUNT(*)
------------------ ----------
TYPE 486
TYPE BODY 21
VIEW 2060

25 rows selected.
Re: How do we check oracle database uses java or not [message #467420 is a reply to message #467416] Fri, 23 July 2010 14:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> select object_type, count(*) from dba_objects where object_type like '%JAVA%' group by object_type;
OBJECT_TYPE           COUNT(*)
------------------- ----------
JAVA DATA                  300
JAVA RESOURCE              768
JAVA CLASS               15949


Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel
Re: How do we check oracle database uses java or not [message #467502 is a reply to message #467420] Sun, 25 July 2010 00:05 Go to previous messageGo to next message
ashfaqhdba
Messages: 10
Registered: July 2009
Junior Member
You mean to say that the mentioned sql stmt returns any Java object then the database is using Java.
Re: How do we check oracle database uses java or not [message #467504 is a reply to message #467502] Sun, 25 July 2010 00:28 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>You mean to say that the mentioned sql stmt returns any Java object then the database is using Java.
If JAVA is installed, it does not mean JAVA is required to exist in DB.
Re: How do we check oracle database uses java or not [message #467507 is a reply to message #467502] Sun, 25 July 2010 01:25 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Another way to know if Java is installed is (not available in all versions):
SQL> select value from v$option where parameter = 'Java';
VALUE
----------------------------------------------------------------
TRUE

Regards
Michel

Previous Topic: MGMT_JOB
Next Topic: Error creating ASM instance using DBCA
Goto Forum:
  


Current Time: Fri Nov 29 08:31:03 CST 2024