Home » RDBMS Server » Server Administration » checkpoint causes a commit
checkpoint causes a commit [message #321987] Thu, 22 May 2008 01:09 Go to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Does checkpoint causes a commit? Is this bevaiour same in all the versions?

I know DBWR signalls LGWR to write at checkpoint but does it mark the SCN in the redo log buffer also?

An answer of yes or no would do.
Re: checkpoint causes a commit [message #321991 is a reply to message #321987] Thu, 22 May 2008 01:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Does checkpoint causes a commit?

No. There is no relation between the 2.

Quote:
I know DBWR signalls LGWR to write at checkpoint but does it mark the SCN in the redo log buffer also?

Which SCN are you talking about?

Regards
Michel
Re: checkpoint causes a commit [message #321993 is a reply to message #321987] Thu, 22 May 2008 01:36 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Michel,
These concepts are real confusing.
Docs won't help alone.

SCN is System commit number.

What i want to know is during a checkpoint, whats the first thing that it does?

As oracle guarantees the dirty buffers to be on redo log fiels before datafiles,does checkpoint triggers LGWR before DBWR and hence update the SCN marker?

Please explain!!
Re: checkpoint causes a commit [message #322005 is a reply to message #321993] Thu, 22 May 2008 02:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
What i want to know is during a checkpoint, whats the first thing that it does?

Determining the list of blocks that have to be written.

Quote:
does checkpoint triggers LGWR before DBWR and hence update the SCN marker?

- Checkpoint is a feature, it does not trigger anything.
- DBWR may trigger LGWR to write in log file if some redo verctors that protect blocks of the previous list are not already written
- There is no relation with commit. SCN may increase but this has no relation with commit (in user sense).
SCN is more System Change Number, it ticks many changes, not only commits.

Regards
Michel

Re: checkpoint causes a commit [message #322012 is a reply to message #321987] Thu, 22 May 2008 02:42 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Its a vicious circle.
Quote:
DBWR may trigger LGWR to write in log file if some redo verctors that protect blocks of the previous list are not already written


Ok,so it is not always that DBWR triggers LGWR.It does so only when it finds that the dirty blocks in the redo are not yet written.

Quote:
There is no relation with commit. SCN may increase but this has no relation with commit (in user sense).


WHat i know a commit does is:
- flushes redo to redo log files
-updates the SCN in redo log buffer
-releases locks.

Out of these three two things are happening at checkpoint if need be.
Does locks are also released when LGWR writes at checkpoint on need?

If yes than when DBWR finds some redo not yet written to redo lfiles,then it is not wrong to say a commit occurs at that checkpoint.

This is one scenario.

Second scenario is when LGWR writes to redo log files and requires a logswitch.Now if DBWR has not finished writing dirty blocks to data files that were present at redo log buffer,oracle
cannot reuse that log file and hence it has to wait for DBWR to finish.It is why we get chekcpoint not complete message in the alert log files.

So it is not wrong to say that DBWR and LGWR are not completely independent of each other.

They both rely on each other during there course of action.

Re: checkpoint causes a commit [message #322017 is a reply to message #322012] Thu, 22 May 2008 03:10 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Once again there is no relation between checkpoint and commit, even if some same things may happen during these 2 actions.

Quote:
Does locks are also released when LGWR writes at checkpoint on need?

Locks are released at commit (or rollback) not at checkpoint.
Commits (and rollbacks) are user actions, checkpoint is background action.

LGWR and DBWR works together, they are not independent, it is the opposite, they are tightly linked.

Regards
Michel





Re: checkpoint causes a commit [message #322026 is a reply to message #321993] Thu, 22 May 2008 03:46 Go to previous messageGo to next message
abs_amit
Messages: 59
Registered: January 2006
Location: delhi
Member
checkpoint does not cause a commit;

before making any change in data buffer oracle genrates a redo entry because of "write ahead logging" behavior.

whenever checkpoint occurs it asks DBWn process to write all dirty buffer to the disk (depends on the checkpoin type.
and
before writing dirty buffers, DBWn signals to LGWR process to write all redo entries from redo buffer to redo files.
here "all redo entries" means commited and uncommited both.


checkpoint is just an event which ensure that database is recoverable till that point when checkpoint occurs.it writes everything on the disk commited or uncommited doesn't really matters.

commit/rollback are executed by users. which ensures that changes made by users are permanent now.

So as michel said "There is no relation between checkpoint and commit"

Try to understand them as two different events.

Still have doubt ?

Regards
Amit

[Updated on: Thu, 22 May 2008 03:55]

Report message to a moderator

Re: checkpoint causes a commit [message #322028 is a reply to message #321987] Thu, 22 May 2008 03:56 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
ok,

One more point.

A checkpoint updates the headers of datafiles and controlfiles.
Does incremental checkpoint also does it?


Re: checkpoint causes a commit [message #322029 is a reply to message #322028] Thu, 22 May 2008 04:02 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is no difference between full checkpoint (at shutdown or when alter system is executed or ...) and incremental checkpoint (triggers by one of the fast_start% parameters), only the chekpoint scn differs.

Regards
Michel
Previous Topic: configuring oracle server
Next Topic: query completion time/query completion %
Goto Forum:
  


Current Time: Fri Nov 29 22:52:09 CST 2024