How to induce log file sync waits

Doug's Oracle Blog

  • Home
  • Papers
  • Books
  • C.V.
  • Fun
  • Oracle Blog
  • Personal Blog

Apr 22: How to induce log file sync waits

(With my tongue causing a minor gash on the inside of my cheek ....)

I'm working on an application that seems to suffer constant long waits on log file parallel write and, consequently, log file sync. I thought that the 54 ms log file parallel writes where just typical of an early 90s disk configuration, with each file type on a discrete drive, all attached to the same controller and it was timely, given a blog post I read recently.

But no, let's not just slow up the I/O, let's make sure we generate lots of it! I noticed that these two procedures were some of the most frequently executed.

PROCEDURE RL_addLock (
        lockEntity IN d000m.lock_entity_no%TYPE,
        lockEntityKey IN d000m.lock_entity_key%TYPE,
        lockProfileId IN d000m.lock_profile_id%TYPE,
        lockSessionNo IN d000m.lock_session_no%TYPE,
        lockOperatorId IN d000m.lock_operator_id%TYPE,
        lockTaskId IN d000m.lock_task_id%TYPE,
        lockDate IN d000m.lock_date%TYPE,
        lockTime IN d000m.lock_time%TYPE
        )
IS
        PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
        INSERT INTO d000m
        VALUES (lockEntity,
                lockEntityKey,
                lockProfileId,
                lockSessionNo,
                lockOperatorId,
                lockTaskId,
                lockDate,
                lockTime
        );
        COMMIT;
EXCEPTION
        WHEN DUP_VAL_ON_INDEX THEN
        BEGIN
                ROLLBACK;
        END;
END;
/

PROCEDURE RL_delLock (
        lockEntity IN d000m.lock_entity_no%TYPE,
        lockEntityKey IN d000m.lock_entity_key%TYPE,
        lockProfileId IN d000m.lock_profile_id%TYPE,
        lockSessionNo IN d000m.lock_session_no%TYPE
        )
IS
        PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
        DELETE FROM d000m
         WHERE lock_entity_no = lockEntity
           AND lock_entity_key = lockEntityKey
           AND lock_profile_id = lockProfileId
           AND lock_session_no = lockSessionNo;
        COMMIT;
EXCEPTION
        WHEN NO_DATA_FOUND THEN
        BEGIN
                ROLLBACK;
        END;
END;
/


Excellent. Yet another developer implementing their own locking architecture, presumably to make their application database independent. Yes, it is common, but having just moaned about this kind of thing in the footnote to a previous blog post ...

"Why am I still seeing locking problems? I think it's because I often have to support Third-Party "Database-independent" (yuck!) applications, some of which insist on implementing their own locking mechanisms. Sigh."
...this one sent me over the edge.
Posted by Doug Burns Comments: (2) Trackbacks: (0)
Defined tags for this entry: Fun
Related entries by tags:
How to generate more Logical Reads
"People like to have one number they can believe in."
A Miracle Masterclass ...
bstat/estat Fun
Sigh

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

#1 - Niall Litchfield said:
2009-04-22 06:55 - (Reply)

I particularly like the exception handling - is it just me or does it just scream "I ran into a concurrency issue that I hadn't thought about, oh well lets just pretend it never happened"

still, if the developer was writing their own locking mechanism then by definition they want to induce scalability restrictions (to protect integrity) and voila they have. all that's needed now is the report back "all functioning as intended, please can I have my money now?" :-(

sorry I've seen too much of this, and using built in locking is always "too complicated and too much of an overhead" when it's taken to the developer.

Niall

#1.1 - Doug Burns said:
2009-04-22 08:31 - (Reply)

sorry I've seen too much of this, and using built in locking is always "too complicated and too much of an overhead" when it's taken to the developer.

Agreed, and that's why I posted it.

It's far too easy to go around pointing the finger but I feel I'm destined to spend the rest of my 'career' seeing the same old things cause the same old problems.


Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
BBCode format allowed
 
 

Statistics on Partitioned Tables

Contents

Part 1 - Default options - GLOBAL AND PARTITION
Part 2 - Estimated Global Stats
Part 3 - Stats Aggregation Problems I
Part 4 - Stats Aggregation Problems II
Part 5 - Minimal Stats Aggregation
Part 6a - COPY_TABLE_STATS - Intro
Part 6b - COPY_TABLE_STATS - Mistakes
Part 6c - COPY_TABLE_STATS - Bugs and Patches
Part 6d - COPY_TABLE_STATS - A Light-bulb Moment
Part 6e - COPY_TABLE_STATS - Bug 10268597

Comments

Doug Burns about 10053 Trace Files - Different Plan in Different Environments
Tue, 02.04.2013 08:57
You're welcome. Now I just nee d to pull my finger out and ac tually come up [...]
Howard Rogers about 10053 Trace Files - Different Plan in Different Environments
Mon, 01.04.2013 23:08
Makes a big difference, so tha nks for that! With two brow ser windows, o [...]
stelioscharalambides.com about 10053 Trace Files
Sat, 30.03.2013 16:28

Upcoming Presentations

Bookmark

Open All | Close All

Syndicate This Blog

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments
  • Feedburner Feed

Powered by

Serendipity PHP Weblog

Show tagged entries

xml 11g
xml ACE
xml adaptive thresholds
xml ASH
xml Audit Vault
xml AWR
xml Blogging
xml conferences
xml Cuddly Toys
xml Database Refresh
xml DBMS_STATS
xml Direct Path Reads
xml Fun
xml grid control
xml hotsos 2010
xml listener
xml Locking
xml oow
xml oow2009
xml optimiser
xml OTN
xml Parallel
xml Partitions
xml Patching
xml swingbench
xml The Reality Gap
xml time matters
xml ukoug
xml ukoug2009
xml Unix/Shell
xml Useful Links

Disclaimer

For the avoidance of any doubt, all views expressed here are my own and not those of past or current employers, clients, friends, Oracle Corporation, my Mum or, indeed, Flatcat. If you want to sue someone, I suggest you pick on Tigger, but I hope you have a good lawyer. Frankly, I doubt any of the former agree with my views or would want to be associated with them in any way.

Design by Andreas Viklund | Conversion to s9y by Carl