Solved

unix & oracle

Posted on 2002-06-19
9
351 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
[X]
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
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 60
fibonacci ten numbers 4 54
Print Rhino Java Array in Javascript 1 39
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 27
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 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