format vmstat output

- Posted in Uncategorized by
Everytime I watch vmstat output I have a strong urge to align those numbers. Here is a simple perl oneliner that does exactly that: # r b w swap free re mf pi po fr de sr s0 s1 s2 s3 in sy cs us sy Read more

efficient distinct queries

- Posted in Uncategorized by
For some use cases distinct queries can be written more efficiently than by simply using select distinct... Conditions that should be met: you are dealing with a "large" table, otherwise you might Read more

huge in clauses

- Posted in Uncategorized by
Let's imagine we are given a 5000 record file and need to match ids from it to a 1 million row table and retrieve values from that table. What options do we have? select values from our record table Read more

Check last_analyzed age distribution

- Posted in Uncategorized by
Find below a simple query that let's you quickly check how old your table statistics are. def agelimit = 30 column age format a3 column cnt format 99999 column graph format a10 set pagesize 999 set Read more

host based trigger authentication

- Posted in Uncategorized by
Preventing certain machines from connecting to your database can be accomplished by triggers. Oracle however has some safety measures to prevent you from locking yourself. First you cannot keep Read more
Page 1 of 4