We had an issue in a development database where a group of developers were not using a connection manager, but trying to manage their own connections. This did not end well. To limit our exposure and the impact on other…
Category: Database
Multiple threads using same physical connection
This just doesn’t sound good. Having multiple threads use the same physical connection sounds like an exercise in frustration. Although the OracleDataSource connection object is thread safe, there is really no need to create a smaller number of connections than…
Python row copier
Below is a script I wrote to copy a set of tables from one schema (or database) to another. It simply takes every table in the source schema and builds up an array based copy for it, with the usage…
Running procedures?
You can use what is below to print out each session that is currently executing (or has pinned) a given stored procedure column owner format a20 column name format a30 column type format a15 set lines 255 trims on SELECT…
How much can I shrink my datafile?
Periodically, we will need to shrink a datafile. In Oracle, you can only shrink a file to the point occupied by the “highest” block in the file. The SQL below will provide you with the SQL to execute for each…
Getting started with map reduce
Map Reduce is a computer technology algorithm that is built on the age old concept of functional programming. The goals of functional programming can be simplistically described as: every program returns a value “map” lists of values to functions Map…
MySQL mysqlbinlog vs. Oracle logmnr
MySQL provides the mysqlbinlog utility to parse binary transaction logs for any number of purposes which may include replication, auditing, or troubleshooting. Oracle also provides this functionality through a PL/SQL package called dbms_logmnr, more commonly referred to as “Log Miner”.…
Accessing ASM via FTP
This is a documented feature, but I wanted to post my notes so I could reference them if needed. All you basically have to do to set this up is: install XML DB (package dbms_xdb). This is installed if you…
Automatically switching connections over with Dataguard and zero code changes
In 10.2.0.4, I tested the ability of off the shelf code to automatically connect to a database that has been “switched over to”. A switchover is a graceful exchange of database responsibilities that prevents a split brain scenario where two…
Format output of crsctl status for RAC 11gR2 (and now 12c)
crs_stat -t in 10g was great because you could just print it out and grep for OFFLINE or UNKNOWN to determine if there was a problem. 11g deprecated the use of crs_stat -t. It’s not just that you shouldn’t use…