Friday, December 20, 2013

scary smart short piece of plsql code ( from Jonathan Lewis of course )

For anyone living in the Oracle DBA/Developer world the last couple of years everyone has their own copy of Jonathan Lewis's "Oracle Core Essential Internals for DBAs and Developers" right?  Well if not sorry but wow you are missing out big time ... Xmas time so get it fixed asap!

OK ... being honest I did get the book shortly after publication but did not read it in depth.  Still have not made it through all of the book ( I am really a slacker apparently ) but several chapters I have read several times.

Anyhow while doing my research/prep for Hotsos 2014 I went through Chapter 7 "Parsing and Optimizing" several times.  In that chapter ... almost at the end ... I found the most amazing piece of PLSQL ... short and simple and scary.  Who else would think of doing something like this?

create or replace procedure self_deadlock as
begin
   execute immediate 'alter procedure self_deadlock compile';
end;
/

Of course no piece of PLSQL is written without a purpose.  This one has several ... get the book and read the chapter!

No comments:

Post a Comment