Tips: Minimum install for Oracle

I'm working currently from my six year old laptop. I needed access to Oracle but I don't have much space, here's what I figure out.

Download Oracle Instant Client, which I found at:

To complete the install you'll need to register with Oracle (it's free), if you haven't already.

Unzip the files into c:\oracle, total size about 84 meg.

Modify your PATH environment variable to point to c:\ORACLE.

Add TNS_ADMIN environment variable to point to C:\ORACLE.

Create a text file called C:\ORACLE\SQLNET.ORA with the following contents:
Create (or copy from someplace) a text file called c:\ORACLE\TNSNAMES.ORA with contents like:
(PORT= 1521)
(CONNECT_DATA= (SID= abc123))
Now, in my minimum install I'm going to use Python, so I'll need cx_Oracle.

Write a program like this (say
import cx_Oracle

aTSN = 'abc123'
user = 'scott'
password = 'tiger'
conn = cx_Oracle.connect(user, password, aTSN)

cur = conn.cursor()

cur.execute("SELECT * from MYTABLE")
for row in cur:
print row

From what I've gathered cx_Oracle uses the oci.dll which is found via the PATH environment variable. This dll looks at TNS_ADMIN and loads up the SQLNET.ORA file looking for NAMES.DIRECTORY_PATH line, which basically says to use TNSNAMES. Then it knows to look for TNSNAMES.ORA in the same directory and parse that.
Piece of cake.


Anonymous said…
...molte, molte, molte grazie.


Popular posts from this blog

Seven Segment Display in Inkscape

Shortest Sudoku solver in Python