This discussion is archived
1 2 Previous Next 26 Replies Latest reply: Jun 14, 2009 3:00 PM by 706417 RSS

flush buffer cache

706712 Newbie
Currently Being Moderated
Hi

I issue a simple insert
and perform "flush buffer cache" immediately.

I notice that I can query the new inserted data !!!!
Why?
  • 1. Re: flush buffer cache
    ivw Journeyer
    Currently Being Moderated
    it is as good as querying first time...
  • 2. Re: flush buffer cache
    706713 Newbie
    Currently Being Moderated
    Hi,

    I am not sure what you have said. You mean have inserted some data and now you can query it. Yes you can but that has no connection with flush buffer cache. I would advise you to read the concepts guide for a better understanding;

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/memory.htm#sthref1372

    Please rephrase your question.

    Ex Senior DBA

    Experts Read Documentation
  • 3. Re: flush buffer cache
    Aman.... Oracle ACE
    Currently Being Moderated
    user6300587 wrote:
    Hi

    I issue a simple insert
    and perform "flush buffer cache" immediately.

    I notice that I can query the new inserted data !!!!
    Why?
    "Why not" he should see the newly inserted data? If you tell us this, probably the discussion would be more better.

    HTH
    Aman....
  • 4. Re: flush buffer cache
    706712 Newbie
    Currently Being Moderated
    When I first insert a row,
    Row will be inserted into buffer cache not disk (until checkpoint).

    When I issue flush buffer cache, everything inside of the buffer cache should be deleted, so my row should be deleted.
    Therefore I cannot be able to see it.
    However I can see it...Why?
  • 5. Re: flush buffer cache
    sb92075 Guru
    Currently Being Moderated
    When I issue flush buffer cache,
    EXACTLY how do you do this?
    Why do you do this?
    everything inside of the buffer cache should be deleted, so my row should be deleted.
    Why do you make incorrect statement above?
  • 6. Re: flush buffer cache
    706712 Newbie
    Currently Being Moderated
    create table temp..

    insert into temp..

    commit;

    alter system flush buffer cache

    select * from temp

    Even I flush buffer cache, I can see the data...
  • 7. Re: flush buffer cache
    SomeoneElse Guru
    Currently Being Moderated
    the buffer cache should be deleted, so my row should be deleted.
    Huh?

    You've commited the row.

    Why do you think flushing the buffer cache should delete a committed row in a table?

    Sounds like you need a date with the Concepts Manual.
  • 8. Re: flush buffer cache
    706712 Newbie
    Currently Being Moderated
    When I commit;

    It will be written to redologs.
    Suppose no checkpoint (The data is still in buffer cache not in datafiles).

    When I flush buffer cache,this will be deleted from buffer cache and therefore this shouldnt not be written to datafiles.
  • 9. Re: flush buffer cache
    Aman.... Oracle ACE
    Currently Being Moderated
    I amnot sure how did you make up this concept ? Anyways, read this thread where I have shown exactly what you said and explained the "why" for that too!

    Hot Backup Mechanism

    HTH
    Aman....
  • 10. Re: flush buffer cache
    Aman.... Oracle ACE
    Currently Being Moderated
    crazyblood1903 wrote:
    When I commit;

    It will be written to redologs.
    Suppose no checkpoint (The data is still in buffer cache not in datafiles).

    When I flush buffer cache,this will be deleted from buffer cache and therefore this shouldnt not be written to datafiles.
    Define what do you mean by "deleted" ? If its not going to stay in the buffer cache and won't be send to the data files, where else do you think that data would go? Checkpoint or no checkpoint, oracle would clean the buffer cache and preserve the images on th disk, to make sure that there is space in the buffer cache.

    Read teh thread that I have given in my last reply.

    HTH
    Aman....
  • 11. Re: flush buffer cache
    706712 Newbie
    Currently Being Moderated
    Hi aman
    I read your demo,
    As far as I understand,
    When I issue "alter system flush buffer cache"
    checkpoint occurs, and data in buffer cache is written to disk.

    Is that right?
  • 12. Re: flush buffer cache
    sb92075 Guru
    Currently Being Moderated
    SQL > alter system flush buffer_cache;
    – flush shared pool to clear recently created sql parse and execution plan
  • 13. Re: flush buffer cache
    Aman.... Oracle ACE
    Currently Being Moderated
    Zapotocny wrote:
    Hi aman
    I read your demo,
    As far as I understand,
    When I issue "alter system flush buffer cache"
    checkpoint occurs, and data in buffer cache is written to disk.

    Is that right?
    Nop, its wrong. Flushing of cache just does what it says, flush contets to disk. It has nothing to do with checkpointing.

    HTH
    Aman....
  • 14. Re: flush buffer cache
    sb92075 Guru
    Currently Being Moderated
    http://www.adp-gmbh.ch/ora/concepts/checkpoint.html
    Events that trigger a checkpoint
    The following events trigger a checkpoint.
    
        * Redo log switch
        * LOG_CHECKPOINT_TIMEOUT has expired
        * LOG_CHECKPOINT_INTERVAL has been reached
        * DBA requires so (alter system checkpoint) 
    
    Additionally, if a tablespace is hot backuped, a checkpoint for the tablespace in question is taking place.
    While redo log switches cause a checkpoint, checkpoints don't cause a log switch. 
    NONE of the events that trigger a checkpoint include ALTER SYSTEM FLUSH BUFFER CACHE.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points