DCOracle

Darren Young youngd at digiship.com
Thu Apr 27 15:54:00 EDT 2000


Question for all,

I have a module with the following text:

import SICKvars
import sys
sys.path.append('/usr/lib/python1.5/DCOracle')

from DCOracle import Connect

# Check for the database
#
def checkdb(dbuser, dbpass):
     try:
          connectString = dbuser + '/' + dbpass + '@' +
SICKvars.dbinfo["server"]
          dbc = Connect(connectString)
          con = dbc.cursor()
          dbc.execute("SELECT table_name FROM user_tables where table_name =
'SICKAUTH'")
          check = dbc.fetchall()
          dbc.close()
          return len(check)
     except:
          print "Caught exception: ", sys.exc_type, sys.exc_value

I have another script tha#!/usr/bin/env python
#
import os
import sys
import glob
import time
import string
import shutil
import oradbinstall


dbuser = ""
dbpass = ""
#
#  If the password is blank, we'll assume that there isn't one..(untested)
#  NOTE: Oracle might not allow that
#
while not dbuser:
     dbuser=raw_input("What is your database admin username? [root]: ")
     if not dbuser:
          dbuser = "root"
     os.system("stty -echo")
     dbpass = raw_input("What is the admin's password?: ")
     os.system("stty echo")

redo=""

try:
     isinstalled = oradbinstall.checkdb(dbuser, dbpass)
except:
     isinstalled = 0

if isinstalled:
     print "\n\nIt appears that the database is already there..."
     redo=raw_input("Would you like me to remove and re-install it? (y/n) ")
else:
     print "\n\nIt's not installed."t looks like this:

When I run it I get this:
[root at linsrv01 SICKnotes-0.6c]# ./orainstall
What is your database admin username? [root]: cm
What is the admin's password?:

It's not installed.
Segmentation fault (core dumped)
[root at linsrv01 SICKnotes-0.6c]#

No matter what I try, it cores out on me...



---------------------
Darren Young
Digiship
312-527-9440
---------------------





More information about the Python-list mailing list