Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I had experience with mysql before, but know completely nothing about Oracle DB.

Recently, I'm assigned to add a simple feature to an existing system.
Albeit simple, I need to connect to the db and get some knowledge about the existing database. But I simply don't know how to do that. I have ssh access with su privilege on a debian remote machine that can connect to the database server.

Below is the java code I received that should be db accessing part. I think it might help you understand my problem (I'm a really a newbie):

        String url = "jdbc:oracle:thin:@aaa.bbb.ccc.ddd:port/price";
        Properties info = new Properties();
        info.setProperty("user", "username");
        info.setProperty("password", "password");

So, how can I connect to Oracle db from linux command line?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Use sqlplus. SQL*Plus FAQ, SQL*Plus Documentation

share|improve this answer

The code you've provided is not intended to be run from the shell - it looks java.

SQLPlus is the usual client used for interacting with an Oracle DBMS from a terminal session - but IIRC its not bundled in the basic instant client package. There are lots of other tools which you could use. If you want an interactive client runing in a terminal session, you could use sqlplus, or gqlplus (which has better curses integration). There's also pysql, yasql.

There's lots and lots of GUI clients (and because they run on the XWindow system, running them on a remote display is trivial) including Tora and SQLDeveloper.

share|improve this answer
    
Thanks. Yes, its java. I provided it here just in case I had misunderstanding on the basics of database. If so, you may point it out as I posted the code. –  Haozhun Jan 27 '11 at 14:49
    
I got sqlplus by installing Oracle XE Client 10. –  Haozhun Jan 27 '11 at 14:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.