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

unix & oracle

Posted on 2002-06-19
9
350 Views
Last Modified: 2010-03-31
hi all,
I need to nkow what is the most simply
way to know (from a java program),
if oracle server is installed on the machine (unix machine).
thanks Eran
0
Comment
Question by:raichel
9 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 20 total points
ID: 7092234
A quick and dirty way would be to do the following:
1. Find out the name of the executable on the box it's installed on ('oracle' ?)
2. Execute a shell command from java e.g. find -name <name of executable>
0
 
LVL 1

Expert Comment

by:howesd
ID: 7092244
The find approach might be a bit iffy - it can only search in directories which you've got permission to look in. If the executeable is in a directory you can look in, find won't find it.

Unfortunately, I haven't got any better ideas .......
0
 

Author Comment

by:raichel
ID: 7092261
come on!
u can do better!!!
:-)
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 9

Expert Comment

by:Venci75
ID: 7092269
you can check wheher there is a process listening on port 1521. but this won't work in all cases
0
 
LVL 4

Expert Comment

by:jos010697
ID: 7092443
You could try and load the oracle supplied JDBC driver; if it throws an exception, most likely ClassDefNotFound, the database probably isn't there ...

kind regards
0
 
LVL 1

Accepted Solution

by:
MaxMaxic earned 30 total points
ID: 7093343
Hi.
STEP 1.
You can check if there is a file /etc/oratab.
The last line of that file contains the following line:
*:/usr/local/public/OraHome1:N
the ':' is a separator, so you can extract the second field -- /usr/local/public/OraHome1 -- this is an installation directory of Oracle.
STEP 2.
Now to be sure that this is an Oracle server installation, you should do as following:
check if there is a directory /usr/local/public/OraHome1/dbs exists.
It it doesn't and "STEP 1" was "true" it is an installtion of ORACLE client.
I checked this on RedHat 7.2 and Oracle 8.1.5.

I hope it helps.


0
 
LVL 1

Expert Comment

by:chdba
ID: 7093834
Hi

A long time ago I worked with Oracle on Unix.

To MaxMaxic's suggestion:
in oratab can be several "last"-lines (for every instance one line):
Dxyz:/usr/local/public/OraHome1:N
Txyz:/usr/local/public/OraHome1:N
Pxyz:/usr/local/public/OraHome1:Y
Exyz:/usr/local/public/OraHome1:N

The first field tells you the Instance-Name (* = all),
The second field tells you the home-directory of oracle
The third field tells you if the database-instance will be startet up at unix-startup (N=no, Y=yes).
So if you'll find there a "Y" then this will definitive be an oracle server installation. Otherwise you can still look for the directory MaxMaxic mentioned. - But on my client installations there was usually also a directory .../OraHome1/dbs.

The default value of the third field is "N". So if the database administrator did not modify this file, it gets a little bit triggy to figure out "server installation or not".

A running oracle you can find with "ps -ef | grep oracle"

I hope this helps also
chdba
0
 
LVL 35

Expert Comment

by:girionis
ID: 8860567
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this
question is:

- split points between CEHJ and MaxMaxic

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Title # Comments Views Activity
custom annotations 9 42
ejb stateless example 2 25
Need Help! Getting a syntax error and don't understand why 3 31
jsp error 6 26
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

829 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