SELECT NULL FROM DUAL FOR UPDATE NOWAIT

  • From: "Sandra Becker" <sbecker6925@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 3 Jul 2007 08:07:47 -0600

RHEL4, 9.2.0.8

Last Tuesday night we put some new code into production.  The performance
has been slower than usual, but no one seems to believe that it was the new
code.  Then Friday morning when I was out of the office and unreachable,
performance tanked so badly they assumed the database had crashed.  The only
thing my SAs thought to do was make sure the database was still up.  Still
having no backup, no one trapped SQL, looked at the database, etc.
Fortunately, I have been trapping information from sar and vmstat as well as
some database session and process information.  Based on the data I trapped
and statspack reports, it seems the OS was thrashing for about 40 minutes.
I found a couple of really, really bad SQL (4M+ buffer gets each) that were
run only during that period on that Friday morning for the past 32 days.  I
don't have statspack data any older than that.  I also trap FTS info and
found the following statement in my FTS log:

    SELECT NULL FROM DUAL FOR UPDATE NOWAIT;

No one is owning up to writing this code and I can prove it came from the
application.  I've never seen this before and wondered why anyone would do
this.  I do know that this statement was executed near the beginning of the
time that things started to get out of control, but it wasn't the initial
cause.  The two bad SQL came first.

Questions:
1)  Could this statement have contributed to the overall problems?
2)  Is this something I should concern myself with or would I be spinning my
wheels?
3)  Why would anyone write a statement like this?  What would be the point?
Since I don't know which developer wrote it and no one is owning up to it, I
haven't been able to find out what the desired result was supposed to be.

I appreciate any comments/suggestions.

Sandy

Other related posts: