Home » RDBMS Server » Server Administration » Continously changing data blocks (Oracle 10g)
Continously changing data blocks [message #488613] Mon, 10 January 2011 04:13 Go to next message
sekar52
Messages: 141
Registered: May 2010
Location: Mumbai
Senior Member
Hi
If the data blocks in the buffer continously get updated such that they never reach the Least used list of LRU,then when will they be written to disk?
Re: Continously changing data blocks [message #488614 is a reply to message #488613] Mon, 10 January 2011 04:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
When a (incremental) checkpoint is executed by DBWR or your process (during a truncate for instance).

Regards
Michel

[Updated on: Mon, 10 January 2011 04:20]

Report message to a moderator

Re: Continously changing data blocks [message #488615 is a reply to message #488614] Mon, 10 January 2011 04:20 Go to previous messageGo to next message
sekar52
Messages: 141
Registered: May 2010
Location: Mumbai
Senior Member
So when I use a 'ALTER SYSTEM CHECKPOINT' or checkpoint occurs after 3 seconds ,are all the dirty buffers are written to disk even if they are at the most recently used end of LRU???
Re: Continously changing data blocks [message #488616 is a reply to message #488615] Mon, 10 January 2011 04:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ALL means including those that are in any place, isn't it? Smile
By the way, Incremental checkpoint does not mean ALL buffers, only the oldest ones (in term of modifications not read access, so no relation with LRU algorithm).

Regards
Michel
Re: Continously changing data blocks [message #488617 is a reply to message #488615] Mon, 10 January 2011 04:26 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
always:

provided that LGWR has flushed the corresponding redo to log files,DBWR goes ahead and writes
Re: Continously changing data blocks [message #488618 is a reply to message #488616] Mon, 10 January 2011 04:28 Go to previous messageGo to next message
sekar52
Messages: 141
Registered: May 2010
Location: Mumbai
Senior Member
so do u mean in 10g incremental checkpoint is followed????So a block may remain in cache say for 1 hour without being written to disk if it is continuosly updated(Only redo will be generated)??????
Re: Continously changing data blocks [message #488619 is a reply to message #488618] Mon, 10 January 2011 04:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, I didn't mean anything like that.
The main point is that there is NO relation between LRU list and checkpoint or flush onto disk.
There are many lists in buffer cache: LRU lists, dirty buffer lists, segment lists...
DBWR checkpoint uses dirty buffer kind list to flush out the buffers as it handles the modified buffers, NOT the LRU lists which handles the accessed (any kind of access including read only) buffers.

Regards
Michel

[Updated on: Mon, 10 January 2011 04:34]

Report message to a moderator

Re: Continously changing data blocks [message #488620 is a reply to message #488619] Mon, 10 January 2011 04:37 Go to previous messageGo to next message
sekar52
Messages: 141
Registered: May 2010
Location: Mumbai
Senior Member
SO if a block is in cache for 1 hour and only redo data is generated and then instance crashes wont it take a long time to recover from redo data
Re: Continously changing data blocks [message #488621 is a reply to message #488620] Mon, 10 January 2011 04:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It depends on your settings. Who say the blocks will not be flushed onto disk?
If your settings are correct and a modified block has not been flushed out for 1 hour then it means there is a low modification rate and so few logs to apply in case of crash.

Regards
Michel
Re: Continously changing data blocks [message #488623 is a reply to message #488621] Mon, 10 January 2011 04:46 Go to previous messageGo to next message
sekar52
Messages: 141
Registered: May 2010
Location: Mumbai
Senior Member
For the redo log to be used again ,should all the data blocks protected by the redo be flushed to disk(Even if they are updated)?/
Re: Continously changing data blocks [message #488624 is a reply to message #488623] Mon, 10 January 2011 04:48 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, this is the reason why a log switch triggers DBWR to write the associated dirty buffers.

Regards
Michel
Re: Continously changing data blocks [message #488627 is a reply to message #488624] Mon, 10 January 2011 04:54 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
LGWR should have flushed corresponding redo to disk,,,,this is the necessary and sufficient condition for DBWR to write.

and it does so whenever told by CKPT.

as you only pointed out
Quote:
For the redo log to be used again ,should all the data blocks protected by the redo be flushed to disk(Even if they are updated)?/


"data blocks protected by redo"
Re: Continously changing data blocks [message #488633 is a reply to message #488627] Mon, 10 January 2011 05:26 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
LGWR should have flushed corresponding redo to disk,,,,this is the necessary and sufficient condition for DBWR to write.

Sufficient but NOT necessary.

Quote:
and it does so whenever told by CKPT.

As far as I know CKPT does call neither LGWR nor DBWR (your sentence is ambiguous, don't know what you mean who calls who).

Regards
Michel
Re: Continously changing data blocks [message #488665 is a reply to message #488613] Mon, 10 January 2011 07:30 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
when checkpoint occurs oracle updates all the datafiles,controlfiles to record the "checkpoint".
the DBWR is hence implicitly rushed ,to write,so as to match/catch-up upto this "checkpoint".

yea,CKPT does not actually "call" DBWR.
it does knowingly/unknowingly cause the DBWR to write.

please suggest if this understanging of mine is correct.

Quote:
Sufficient but NOT necessary.


can you please elaborate
below does suggest that it is necessary

Quote:
Before DBWn can write a modified buffer, all redo records associated with the changes to the buffer must be written to disk (the write-ahead protocol). If DBWn finds that some redo records have not been written, it signals LGWR to write the redo records to disk and waits for LGWR to complete writing the redo log buffer before it can write out the data buffers.
Re: Continously changing data blocks [message #488667 is a reply to message #488665] Mon, 10 January 2011 07:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
when checkpoint occurs oracle updates all the datafiles,controlfiles to record the "checkpoint".
the DBWR is hence implicitly rushed ,to write,so as to match/catch-up upto this "checkpoint".

Checkpoint is executed by DBWR, you cannot say that the checkpoint "rushes" DBWR to write up to this checkpoint as this is DBWR that makes/generates/... the checkpoint. Then DBWR asks CKPT to write the current SCN as the checkpoint SCN into file headers and does it itself for the control file.

Quote:
Quote:
Sufficient but NOT necessary.

can you please elaborate

Checkpoints can occur in other circonstances than log switch, so log switch is not necessary to have a checkpoint.
(Note that I assume that you mean log switch when you say "LGWR should have flushed corresponding redo to disk" which is not the same and is obviously wrong (hopefully) that checkpoint occurs at each flush of log buffer into log file on disk.)

Quote:
below does suggest that it is necessary

No, it explain another case.

You can have:
- log switch, LGWR call DBWR to make a checkpoint
- DBWR make a checkpoint (for instance based on time) and need some redo data to be flush, so call LGWR.

Regards
Michel

Re: Continously changing data blocks [message #488675 is a reply to message #488667] Mon, 10 January 2011 08:19 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
no,,,,i was never referring to a log switch !!!!

i was refering to LGWR writing from redo log buffer to online redo log files
-every 3 secs
-when buffer 1/3rd full
-when asked by DBWR

"before the data is written to disk by DBWR ,it is necessary that LGWR has written corresponding redo records from redo log buffer into online redo log files"
i guess we can conclude on that /forum/fa/1598/0/

and never suggested "checkpoint occurs at each flush of log buffer into log file on disk" !

Quote:
you cannot say that the checkpoint "rushes" DBWR to write up to this checkpoint as this is DBWR that makes/generates/... the checkpoint


sorry,my bad,,,,

Quote:
Then DBWR asks CKPT to write the current SCN as the checkpoint SCN into file headers and does it itself for the control file.


dbwr writes to controlfile??!!!!
Re: Continously changing data blocks [message #488679 is a reply to message #488675] Mon, 10 January 2011 08:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, it writes checkpoint scn (and other stuff about checkpoint).

Regards
Michel
Re: Continously changing data blocks [message #488686 is a reply to message #488679] Mon, 10 January 2011 10:05 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
srry,but can you please point me to some documentation that says so

foll doesnt reflect that DBWR updates controlfile

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/img/cncpt154.gif

http://www.orafaq.com/wiki/CKPT

Quote:
CKPT

CKPT (Oracle Checkpoint Process) is an Oracle background process that timestamps all datafiles and control files to indicate that a checkpoint has occurred.

Re: Continously changing data blocks [message #488688 is a reply to message #488686] Mon, 10 January 2011 10:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
OK, it seems you are right CKPT now also updates control files (which was DBWR in some previous versions).

This does not change the rest of my posts and the most important part regarding what is checkpoint and when it occurs, above all concerning modified blocks which was the original question.

Regards
Michel
Re: Continously changing data blocks [message #488690 is a reply to message #488688] Mon, 10 January 2011 10:53 Go to previous message
knight
Messages: 111
Registered: January 2009
Senior Member
ok
Previous Topic: Archive log file generating
Next Topic: Oracle Database 10.1.0.2.0 on windows 2003 server 64 bit
Goto Forum:
  


Current Time: Wed May 08 14:48:31 CDT 2024