sql - When does DBwn update buffers in Database buffer cache to database disk? -
i learning basic knowledge oracle database architecture, , there 2 examples.
- the steps involved in executing data manipulation language (dml) statements.
- the steps involved in executing commit command.
the steps follows:
- the server process receives statement , checks library cache shared sql area contains similar sql statement. if shared sql area found, server process checks user’s access privileges requested data, , existing shared sql area used process statement. if not, new shared sql area allocated statement, can parsed , processed.
- if data , undo segment blocks not in buffer cache, server process reads them data files buffer cache. server process locks rows modified.
- the server process records changes made data buffers undo changes. these changes written redo log buffer before in-memory data , undo buffers modified. called write-ahead logging.
- the undo segment buffers contain values of data before modified. undo buffers used store before image of data dml statements can rolled back, if necessary. data buffers record new values of data.
- the user gets feedback dml operation (such how many rows affected operation).
the steps follows:
- the server process places commit record, along system change number (scn), in redo log buffer. scn monotonically incremented , unique within database.
- the lgwr background process performs contiguous write of redo log buffer entries , including commit record redo log files.
- if modified blocks still in sga, , if no other session modifying them, database removes lock-related transaction information blocks.
- the server process provides feedback user process completion of transaction.
first question: server process or background process move or migrate redo log files data files? if yes, how process?
thanks nicholas krasnov & jsapkota comments. there doesn't exist kind of "migration" process because serve different purposes. data files data of database , redo log files used recover database. dbwn responsible writing data data files , lgwr write redo log buffer active redo log file on disk.
my second question: when dbwn(database writer process) modify buffers in cache database disk? update database disk before commit or after commit.
dbwn dose not write database files because of issuing commit
statement. commit
means end of transaction. locks on table or rows released, scn incremented, , lgwr
writes scn , changes online redolog file.
the database buffer cache has 2 list
1) write list 2) least-recently-used (lru) list
least-recently-used (lru) list has dirty buffer. dirty buffer buffers modified. commit indirectly make buffer dirty. in buffer been accessed.
dbwn
neither writes in datafile before commit nor after. has own scenarios when checkpoint happens or dirty buffers reaches threshold or there no free buffer etc.
i hope, answered question. thank you.
Comments
Post a Comment