If you have several users waiting on a library cache lock, they are normally blocked by one user that is waiting on a library cache pin. You have to find out who is blocking the user waiting on the library…
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′”);…
sudo and LD_LIBRARY_PATH … never the twain shall meet
While writing something for our operations support team to use when running a particular process, I found that sudo does not recognize a previously exported value for LD_LIBRARY_PATH. It also won’t use what is in the .bashrc or .profile for…
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…
How long will my flashback database command take?!!
Oracle 10g introduced the wonderful (and I mean wonderful) ability to “rewind” a database back to a point in time, rather than restoring a backup and rolling it forward in time using transaction logs. This technology is called flashback database,…
How close am I to realtime with dataguard and maximum performance (asynchronous) mode?
Oracle supplies two views to monitor how up to date your standby database is when compared to your primary database. One view is v$dataguard_stats, and the other is v$standby_apply_snapshot. Each of these views is only updated every 30 seconds, or…
Manually subscribing to Oracle FAN events
JDBC and dot Net clients are the recommended way to automatically subscribe to high availability events in an Oracle clustered environment, AKA, a RAC. I was curious as to how this could be implemented using your own code behind the…
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…