2 Replies Latest reply: Jan 15, 2009 12:44 PM by cj RSS

    Can I just issue sqlplus command like a Korn shell does in python?


      I have a question on python as an Oracle DBA. Do I have to have cx_oracle or another similar compenent in order to access Orade database? Can I just do sqlplus like a Korn shell does?

      I am an Oracle DBA. Daily job requires shell scripting. I am skilful at Korn/BASH which I use on a daily basis to interact with database. However, I found them not powerful and flexible enough to handle text and strings. I am new to both Perl and Python. I pick Python because it is easy to read and maintain. Learning curve is not as steep as Perl.

      I am not a developer who cares much about data types compatability or APIs. I do care about how to pass Unix variables in Python. A typical task is like

      set Unix environment variables (each database has a line in a file)
      use sqlplus to connect to each database specified in the file, i.e. looping
      get information I want and store them in files, i.e. logs
      end loop
      do text/string manipulation againt the log file
      if error is found, send email alert to DBA