Cannot connect to oracle 11g

9 views
Skip to first unread message

donkeyx

unread,
Mar 20, 2010, 5:56:04 AM3/20/10
to sqlpython
Hey Guys,

I am trying to connect to an oracle 11g database. I have used sqlplus
for a while and it is working nicely with all the env vars that are
required for sqlplus to work. As an example here is a connection to
the same database using tnsnames.ora:

<code>
[me@MacBook software]$ sqlplus $db_username/$db_password@my-database
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 20 19:43:46 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit
Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL>

</code>

And for sqlpython :

<code>
[me@MacBook software software]$ sqlpython oracle://$db_username/$db_password@my-database
/bin/sh: xclip: command not found
/usr/bin/vim
Connection failure.
Opens the DB connection. Some sample valid connection strings:

connect oracle://user:password@SID
connect postgres://user:password@hostname/dbname
connect user/password@SID (Oracle is the default RDBMS
target)
connect --postgres --hostname=hostname dbname username
connect --mysql dbname username
Usage: connect [options] arg

Options:
-h, --help show this help message and exit
-a, --add add connection (keep current connection)
-c, --close close connection {N} (or current)
-C, --closeall close all connections
--postgres Connect to postgreSQL: `connect --postgres
[DBNAME
[USERNAME]]`
--oracle Connect to an Oracle database
--mysql Connect to a MySQL database
-H HOSTNAME, --hostname=HOSTNAME
Machine where database is hosted
-p PORT, --port=PORT Port to connect to
--password=PASSWORD Password
-d DATABASE, --database=DATABASE
Database name to connect to
-U USERNAME, --username=USERNAME
Database user name to connect as

SQL.No_Connection>
</code>

I have tried the connection will every combination that I can think of
but still the same thing. Even if i type in asdfasdfadsf as the tns
entry it will still do the same with no error? I am a developer that
constantly works on oracle dbs and would love to use the functionality
described for this script but so far unsuccessful ;( .

Also here is my tns entry that i am trying to connect to :

MY-DATABASE.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(HOST = b19e02s14-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL= TCP)(HOST = b87e02s14-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER =DEDICATED)
(SERVICE_NAME = MOODLET)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)

Any help would be greatly appreciated before i try one of the other
options, since this offers the most usability ;)

cheers Dave


William McVey

unread,
Mar 21, 2010, 12:04:13 PM3/21/10
to sqlp...@googlegroups.com, donkeyx
On Sat, Mar 20, 2010 at 5:56 AM, donkeyx <donke...@gmail.com> wrote:
> [me@MacBook software software]$ sqlpython oracle://$db_username/$db_password@my-database
<snip>

>        connect oracle://user:password@SID
>        connect postgres://user:password@hostname/dbname
>        connect user/password@SID  (Oracle is the default RDBMS
> target)
>        connect --postgres --hostname=hostname dbname username

> Any help would be greatly appreciated before i try one of the other
> options, since this offers the most usability ;)

Note that for Oracle urls to be used for SQLPython, the username and
the password are delimited with a colon, not a slash, as they are with
sqlpython.

-- William

Reply all
Reply to author
Forward
0 new messages