Wednesday, March 31, 2010

Now with syntax highlighting goodness

Via this excellent post, we now have syntax highlighting.


code goes here



Much better looking than quotes or pre alone.

RMAN duplicate set until clause for variable dates

I've used the following for my rman duplicate scripts to set a specific timestamp for clones.
set until time "to_date('03/29/2010 08:00:00','MM/DD/YYYY HH24:MI:SS')";

However, most of the time I just want to have my data as of an hour ago no matter what time I start the clone and don't want to edit the timestamp each time (less stuff to mess up). Apparently this syntax also works.
set until time "sysdate - 1/24";
You can take this a step further in complication with anything for dates, such as cloning to the most recent archivelog backup (assuming a scheduled archive log backup takes place every hour at 35 after)

set until time "trunc((sysdate - 30/1440),'HH24')+30/1440";

Sunday, March 7, 2010

Comparing files with slight differences


File compile-test.log is an output of a big compile from a database named TEST, and file is stored in TEST subdirectory.


File compile-prod.log is output of a big compile from a database named PROD, file is stored in PROD subdirectory.



diff PROD/compile-prod.log <(sed 's/TEST/PROD/g' ../TEST/compile-test.log