I recently created some utility functions to startup, mount and stop Oracle via cx_Oracle and thought I would share them. You will want to make sure you have password files setup correctly in order for this stuff to work. # shutdown abort: def shutdown_abort(sid): try: os.environ[’TWO_TASK’]=sid handle=cx_Oracle.connect("sys", "yourpwd", sid, cx_Oracle.SYSDBA) handle.shutdown(mode = cx_Oracle.DBSHUTDOWN_ABORT) return 0… Read more »
Monthly Archives:: March 2008
One of the prerequisites for Slony replication is to be sure that primary keys (or at least suitable columns) are defined for each table to be under replication. This is a simple example script for getting that data in postgresql. This assumes that the intention is to replicate all of the public schema. SELECT tablename… Read more »
I needed to make an assessments of a linux server’s memory footprint consumed by postgresql, however, calculating the exact memory footprint of a postgresql database is not as straightforward as one might think. Since unix utilities like top, and ps tend to show some amount of shared memory usage in their tallies, they are next… Read more »
I just updated the blog toÂ WordPressÂ in order to get a few (ok, a lot) more features, and use the general editing environment. Â I imported some of the popular posts from my old blog as well.
I decided to start futzing with Python and Oracle. I generally use perl for most everything, and sometimes php for web based things, but I wanted to try Python at the urging of colleagues. I downloaded the source fromÂ here,Â and added in cx_Oracle fromÂ hereÂ . The installation on linux was about as smooth as possible. I installed… Read more »
Oracle 10g has some neat features for keeping track of old statistics. Pre-10g It used to be important to backup your statistics before you analyzed a table just in case your plans went crazy. Now Oracle does this for you automatically. There is a great post onÂ Doug’s Oracle BlogÂ that talks about this with some examples…. Read more »