This forum is currently locked. You can't register or post questions at this time. (read more)

Oracle Architecture concept.

All posts relating to Oracle database administration.

Moderator: Tim...

parkerjohn03
Senior Member
Posts: 107
Joined: Wed May 12, 2010 3:05 am

Oracle Architecture concept.

Postby parkerjohn03 » Fri Oct 12, 2012 1:06 am

Hi Tim,

Question: How the (new/commited) data writes from redo log to user's data file. ? For example: if I update one row in a table and commit it, it will first
goes to log buffer and than LGWR writes log buffer into redolog file . so How the new updated data actually goes to user's data file. ?

This is what I have understand.
Database buffer cache the data block. Server(user) process first read the data from buffer cache.
if server process (user process) doesn't find data into buffer cache, it will read the data from datafile and load into buffer cache and than respond to user's request.


Log buffer hold the all the database changes we made to the database. when transaction occurs, oracle first write chages into log buffer. LGWR writes log buffer to redolog files and when redo log files filled up, ARCH process write data into archive log if database is in ARCHIVE LOG MODE.

Please help

Thanks in advance....

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Oracle Architecture concept.

Postby Tim... » Sat Oct 13, 2012 12:05 pm

Hi.

The stuff you write about the redo processing is correct. Where you have gone wring is that the changes in the redo log are never applied to the datafiles (except in in recovery situations).

The server process makes the DML changes to the blocks in the buffer cache. The blocks are them marked as dirty. Over time the DBWR will write dirty buffer to the datafiles, making sure all the changed buffers are written to disk.

The redo logs are there for protection. In the event of an instance crash, the dirty buffer in the cache will be lost and therefore so will all the changes that have not made it to disk yet. Having the redo logs holding all the changes allows Oracle to replay them in the event of an instance crash, so the changed blocks in the buffer cache can be rebuilt during instance recovery. So under normal running, the redo logs and archived redo logs are never used to write changes to the data files. Only during recovery.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

parkerjohn03
Senior Member
Posts: 107
Joined: Wed May 12, 2010 3:05 am

Re: Oracle Architecture concept.

Postby parkerjohn03 » Mon Oct 15, 2012 10:57 pm

Thank you !!

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Oracle Architecture concept.

Postby Tim... » Mon Oct 15, 2012 11:42 pm

:)
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

parkerjohn03
Senior Member
Posts: 107
Joined: Wed May 12, 2010 3:05 am

Re: Oracle Architecture concept.

Postby parkerjohn03 » Mon Oct 15, 2012 11:48 pm

That means,

Changes are written simultaneously by LGWR, and DBWn into log buffer and buffer cache but LGWR always writes its records to the online redo log file before DBWn writes new or modified data block (dirty buffer) to the data files. when a server process (user process) update/change the data block in buffer cache, oracle parallel writes those database changes into log buffer for protection against instance crash ?

Thanks again..

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: Oracle Architecture concept.

Postby Tim... » Tue Oct 16, 2012 12:18 am

No. The LGWR doesn't write to the log buffer. It writes the contents of the log buffer to the online redo logs. This is all explained in the concepts manual. It would be far more efficient to learn it by reading that manual,

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 5 guests

cron