LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2008, 09:57 PM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
Oracle query on windows


I need to be able to run a check from linux to oracle on a Windows server. Im not familiar with Oracle, does someone know what the query statement that can remotely login to oracle on windows is. I wrote something for mysql from linux to linux, which sounds similar to what im looking for which is below:

test=`mysql -P portnum --socket=/var/stanford/mysql/mysql.sock -u userid -ppasswd -e 'use db name; show tables;' | wc -l`
echo "OK - $test tables"
 
Old 11-08-2008, 10:51 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Install the oracle client for Linux, setup the tnsnames.ora file with the address, port and SID of the Oracle DB and you should be able to run sqlplus to connect to the Oracle DB.

http://www.oracle.com/technology/sof...linuxsoft.html
 
Old 11-09-2008, 09:58 AM   #3
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
Not really what i was asking, everything you suggested has been done. Im looking for the actual query that gets run after that from the linux server to oracle on windows.
 
Old 11-10-2008, 07:55 AM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
If sqlplus is installed and everything setup, then it would be something like this:
Code:
$ sqlplus user/password@database @executeThis.sql
The @executeThis.sql is optional, use that is you want to run execute a sql file from the command line.
 
Old 11-26-2008, 11:32 AM   #5
nehaandrew
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
Use a Free SQL IDE like "Oracle SQL Developer". It'll makes your SQL programming life a lot more easier and fun filled!


Linux

Last edited by nehaandrew; 11-30-2008 at 01:20 AM.
 
  


Reply



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
Nagios oracle monitoring on windows investmentbnker75 General 3 04-14-2009 05:01 AM
BLFS - X windows system; a simple query. just.srad Linux From Scratch 2 09-27-2008 08:54 PM
Query Windows RPC to find dynamic ports from linux? humbletech99 Linux - Networking 0 11-08-2007 05:16 AM
Advent 7086 Laptop Windows Re-Install Query linuxponderer7086 Linux - General 1 07-14-2007 01:11 PM
connect to Windows Oracle database turbo_acura Linux - Software 1 11-03-2005 12:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration