Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

389975Jan 14 2009 — edited Jan 15 2009
Hi

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


Thanks,
Kevin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2009
Added on Jan 14 2009
2 comments
7,404 views