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
> 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