Category: Development

cx_Oracle cursor fetching behaviour

I have noticed this over the past few months, and think I still may be missing something. Given the following code… #!/home/oracle/local/bin/python import cx_Oracle import sys con = cx_Oracle.connect(“howards”,”******”,”perfrac”) con.cursor().execute(“alter session set events ‘10046 trace name context forever, level 12′”);…

JDBC connection timeout

While testing a remote data center today, we had some network connectivity issues. We twiddled our thumbs while waiting for connections to throw an exception due to a network block. I found the setLoginTimeout() method on the DriverManager class. You…

Poor man’s parallel DML

We were recently required to get rid of 250 million rows in a partitioned audit table. While the table is partitioned, we have global indexes that would be rendered unusable after dropping or truncating a partition. The UPDATE GLOBAL INDEXES…

Port checker

This was useful when we testing a migration between database servers. import socket import sys for i in range(1,5): try: HOST = “foo” + str(i) PORT = 2484 print HOST + ” ” + str(PORT) sock = socket.socket() sock.connect((HOST, int(PORT)))…

Python based stress tester

I often find myself building something in anticipation of needing it at some point.  This is one of those cases 🙂  Below is a template (a real working one for my needs) that you can edit to build a simple…