Archive for April, 2009

Java Lock class is great for test casing

Wednesday, April 15th, 2009

OK, so while trying to understand Oracle’s redo latching mechanisms (we have been experiencing a nightmare with log file sync since switching to a new DMX subsystem), I found that java 1.5 has a new Lock class. How cool is that?!!! import java.io.*; import java.util.concurrent.locks.*; import java.net.*; import java.util.*; class MyThread implements Runnable { static Lock l =... »

Posted in Java, Oracle | No Comments »

Standby created without a standby controlfile?!!

Wednesday, April 15th, 2009

Today, a junior DBA created a standby database by copying the controlfile to another host, restoring the 4TB database it serves, and recovering all available logs via RMAN. Sounds good, right? Well, it was until we went into SQL*PLUS and found that a “RECOVER STANDBY DATABASE;” command returned an exception that we were not... »

Posted in Oracle | No Comments »

Read only tablespace requires no outstanding transactions…anywhere…

Wednesday, April 15th, 2009

Nice little gotcha I received yesterday morning. Our intention is to rebuild two large tables from range partitioning to hash partitioning on another server. One of the datafiles for the tablespace that houses one of the tables in question is 1.4TB in size. When we tried to put it in read only mode (we are... »

Posted in Oracle | No Comments »

Oracle function to calculate wait event correlation

Wednesday, April 15th, 2009

Cool little function to provide statistical correlation between two events. This helped us to identify performance drivers in our database. Statistically, anything above 60 is considered “statistically significant”, or correlated. If one goes up, so does the other. create or replace function corr_events (p_event1 in varchar2, ... »

Posted in Oracle | No Comments »

Statistical functions with java

Wednesday, April 15th, 2009

Below is a simple set of classes for performing your own statistical analysis. As noted, they are simple (no multiple regression analysis, etc.) class myStats { double standardDeviation (double array) { double arr = new double; double av = average(array); for (int i = 0; i < array.length; i++) { arr =... »

Posted in Java, Statistics | No Comments »

Control file writes when updating???

Wednesday, April 15th, 2009

I had never seen this before, but while testing a migration strategy for a large table with XMLTYPE’s, almost half our wait time was spent on control file sequential read and control file parallel write waits. Each of these occurred immediately after a “direct path write” wait. When I dug a little further, I found... »

Posted in Oracle | No Comments »

Oracle regular expressions

Wednesday, April 15th, 2009

A recent question on CDOS was regarding how to have only one space at the end of a CSV output row. Below was my response… SQL> create table t1110(c varchar2(10)) 2 / Table created. SQL> insert into t1110 values('1') 2 / 1 row created. SQL> insert into t1110 values('2 ... »

Posted in Oracle | No Comments »

C callouts from MySQL

Wednesday, April 15th, 2009

While I was trying to find a way to use the statistical functions built into MySQL for performance measurement, I discovered the ability to create user defined functions that use C callouts from within the database. I knew you could create your own functions using SQL inside the database, but this allows us to... »

Posted in MySQL | No Comments »

Multicollinearity

Wednesday, April 15th, 2009

The predictors should not correlate. In the stepwise selection one variable might take the prediction of the another variable into the model and the second variable will not be taken in to the model. The variables might get also inconsistent correlation coefficients (negative if the effect is positive). If we use wait events, there will... »

Posted in Statistics | No Comments »

Does correlation help at all?

Wednesday, April 15th, 2009

While studying how we can use statistics to better understand the performance of our applications, I came upon the concept of kurtosis. What this essentially means is that any given distribution is not normal if its kurtosis is very high…OK, that sounds like a fatal disease, what does it mean?!!! A normal distribution just means,... »

Posted in Statistics | No Comments »

Switch to our mobile site