19 October 2007

python + cx_Oracle = <3

Took some time over the past two days to deliberately use python. Much fun was had by all (where all = me).

My first creation used the subprocess module (although I had to install the older separate version since I'm on python 2.3) to call df over ssh and then again locally to make sure that my disk partitions were large enough to hold an rman duplication. Works like a champ, and hopefully I won't have long-running duplications blow up and page me at 2 AM. Subprocess is a really nice module for making system calls as well, I'll let you play around with it before thanking me.

My second creation used the cx_Oracle module to connect to Oracle as the SYSDBA and do some post-duplication tasks for my development databases. Changing flags to note that it isn't production, granting some more privileges to the developers, etc. Thanks to Anthony Tuininga for answering my newbie emails.

1 comment:

  1. Kudus!

    I've been nagging myself to learn Python for a long time, but I'm so comfortable with Perl that I've never found any incentive to do anything with Python. Besides my co-workers are still using ksh, so we don't want getting more languages into the mess.

    ReplyDelete