LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-04-2011, 01:42 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
Question Check an Oracle database


Hi all

I need to check with nagios an oracle database that is located on a server.
There are a lot of plugins that are provided, but can someone pls help me with this? the problem is that the database is located on a remote server (i have an hostaddress) and then i need to log on the database (i have username and pass)

So i only need to have a plugin that connects to that hostaddress and logs on, but i can't find any plugin which does that..?!
Can someone help me, i'm not familiar with this (database and etc.)

Greetings
 
Old 05-04-2011, 01:59 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello Björn,

I've set this up almost a year ago so might be missing some points in my explanation. As I recall it, you'll need to install the Oracle client for the version of your Oracle database server. That will provide you with the sqlplus client. Next you'll need to setup your TNS name file correctly pointing to your server/database. From then on you should be able to connect using sqlplus from the command line. If that works then you can use the plugins from NagiosExchange I believe you've already encountered . That's the raw procedure, there's lots of information about this on the internet so happy surfing

Have a look at this one for example.

Kind regards,

Eric
 
Old 05-04-2011, 02:43 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
So that Oracle client and sqlplus, i need to install it on my monitoring host? the database is version 10g
If not, i can't install anything on the server where the database is located on?!

But i'll sure take a look

Thanks again my good friend ^^

P.S.: i'll keep this thread updated, but i don't have much time, it's kinda busy, so i'll do my best

Last edited by brownie_cookie; 05-04-2011 at 02:45 AM.
 
Old 05-04-2011, 02:47 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

Correct! You install the client on your monitoring host (nagios server) and don't need to install anything (if only monitoring Oracle databases) on the Oracle server. You're welcome buddy. Good luck and happy surfing!!

Kind regards,

Eric
 
Old 05-04-2011, 03:06 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
okay, first encouter...

I'm following the website you've provided link

I've downloaded and unzipped the zip files, so i've got that one folder and i did also the three following commands
Code:
sudo cp instantclient_10_2/sdk/include/*.h /usr/include
sudo cp instantclient_10_2/sqlplus         /usr/bin
sudo cp instantclient_10_2/*.so*           /usr/lib
everything is fine until now...
i want to do the following command
Code:
sudo cp tnsnames.ora /etc
but i don't have a tnsnames.ora ...
i also don't have sqlplus installed for the following command
Code:
/usr/bin/sqlplus scott/tiger@myoracle
can you help me out?
 
Old 05-04-2011, 03:11 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

What's the output of
Code:
which sqlplus
You stated you copied the extracted files following the guide. Did you check permissions on those files? There is a sqlplus in the output you posted for the copy command, so most likely the permissions are off.

The tnsnames.ora you can copy from the Oracle server (if you have access), that's the easiest way and the best way to avoid typing errors. Also, executing the sqlplus command of course needs your credentials.

Kind regards,

Eric
 
Old 05-04-2011, 03:16 AM   #7
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
Code:
# which sqlplus
/usr/bin/which: no sqlplus in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
how can i check that i have access to the oracle server?
I have a login and pass for it (dev user) but i can't connect to it through e.g. PuTTy
 
Old 05-04-2011, 03:22 AM   #8
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Check if the file sqlplus exists in /usr/bin and check the permissions. If it doesn't then you did something wrong or forgot something.

You can check connectivity to the Oracle database with the tnsping command if I recall correctly, it should be part of the Oracle client package. Of course you'll need the tnsnames.ora file in order to try if I'm not mistaking.

Kind regards,

Eric
 
1 members found this post helpful.
Old 05-04-2011, 03:25 AM   #9
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
Code:
# ll | grep sqlplus
-rw-r--r-- 1 root   root       7741 May  4 10:02 sqlplus
Code:
# chmod 755 sqlplus
# which sqlplus
/usr/bin/sqlplus
so this is working thx

but i don't know how to get that ORA file

Last edited by brownie_cookie; 05-04-2011 at 03:30 AM.
 
Old 05-04-2011, 03:43 AM   #10
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Glad you got that part solved, I was almost sure it were the permissions not set correctly. If you don't have access to the Oracle server to get the tnsnames.ora file, ask the database admin to provide it. The syntax in that file is like such:
Code:
net_service_name= 
 (DESCRIPTION= 
   (ADDRESS=(protocol_address_information))
   (CONNECT_DATA= 
     (SERVICE_NAME=service_name)))
which points to the server : port and database instance if I recall correctly.

Kind regards,

Eric
 
Old 05-04-2011, 03:48 AM   #11
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
okay, but that can take a while

but while i'm waiting, let's review what i should do next.
when i copied that file to /etc
i can test it like so
Code:
/usr/bin/sqlplus scott/tiger@myoracle
but i don't think scott/tiger@myoracle will work, can you tell me what those parts mean?

as i follow the site, i think when i can succesfully test that command, i can use the plugin check_oracle which is provided with the set of plugins from nagios?
 
Old 05-04-2011, 03:53 AM   #12
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

The sqlplus command uses the tnsnames.ora file to connect to the database instance in your example using the user scott with password tiger and connecting to database instance myoracle. I never tried connecting directly without tnsnames.ora but found this thread on the internet talking about the same thing. Maybe you can find out how there.

Kind regards,

Eric
 
Old 05-04-2011, 04:00 AM   #13
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
okay, i'm trying and failing lol

Code:
# sqlplus user/pass@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))(CONNECT_DATA=(SID=sid)))'
-bash: /usr/bin/sqlplus: cannot execute binary file
what does that mean?

Last edited by brownie_cookie; 05-04-2011 at 04:03 AM.
 
Old 05-04-2011, 04:08 AM   #14
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

What version of the Oracle client did you download (32 or 64bit) and what version of OS are you running (32 or 64 bit)?

Kind regards,

Eric
 
Old 05-04-2011, 04:10 AM   #15
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
hmmm now you say i think i've downloaded the wrong zip files...

link which are for 64 bit i think
and i have a 32 bit...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need to configure autostart of oracle database and oracle soa suite on linux bootup sumit.tambekar Linux - Newbie 2 01-24-2011 07:35 PM
Oracle database help baks Programming 2 07-23-2007 02:55 AM
LXer: Oracle(R) Database Standard Edition One and Oracle Enterprise Linux on HP Set New World Record for Price Performance with TPC-C Benchmark LXer Syndicated Linux News 0 06-12-2007 05:01 PM
Difference between Oracle Server and Oracle Database ganninu Programming 3 02-27-2007 01:06 AM
Oracle database. chuck77 Linux - General 1 03-02-2006 08:24 AM


All times are GMT -5. The time now is 07:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration