Home > database >  Questions about the DBWR and commit
Questions about the DBWR and commit

Time:09-27

Inside the original database
Client_id fund_account
100006, 100006,
Question 1: I'll PLSQL respectively carry out the following statement inside the

The update clientrelation set fund_account=100007 where client_id=100006;


Above, wait for 3 seconds, whether to modify the record must have been written into the data file?
Question 2:
The above transactions do not submit, I in the same page select * from clientrelation; Find out query fund_account really has been changed to 100007.
But I open a SQL window again, and then execute the select * from clientrelation; Find out query fund_account did not change, or 100006.
This is because oracle does not allow dirty read, so a new open window of the query is the inside of the undo record? Why before the window inside the select * from clientrelation; Found to change after the record?
Question 3:
I see online said redo is a cache area in SGA, the undo with yao, if update the article a lot of data, redo buffer is not enough, the execution undo redo order what kind of?

CodePudding user response:

After 1, perform the update, just change the data in memory, not written in the database;
2, a session uncommitted data, another session is not available;
3, UNDO enough, there will be a classic error, ORA - 01555

CodePudding user response:

1, not necessarily, but the change may have been written into the log online redo log, unless for some reason, LGWR lost in waiting, because the LGWR 3 seconds will write online redo, of course, this is just one of the conditions of LGWR writes, other and commit/rollback, the log buffer write a third, 1 m writing and so on, as long as the redo persistence and make sure don't lost, then the revision will not be lost;

2, have not been submitted before other session definitely cannot read to modify the record, your idea is right, oracle default transaction isolation level is read commited.

3, reference after 10 g company, it is very complex, not in a few words say clear,

CodePudding user response:

reference 1st floor wmxcn2000 response:
1, after perform the update, just changed the data in memory, not written in the database;
2, a session uncommitted data, another session is not available;
3, UNDO enough, there will be a classic error ORA - 01555


For the first point I have a question that should be a LGWR will redo buffer after the information written to the physical file, DBWR will immediately put the dirty data zone on the hard drive, I have an experience is to insert into an empty table inside 20 w records, insert is slow, but submit the commit soon, I think before the commit data should be updated to the hard disk has been inside the

For the second point, I want to know the update is not submitted within the same session select where to check the data

CodePudding user response:

refer to the second floor minsic78 response:
1, not necessarily, but the change may have been written into the log online redo log, unless for some reason, LGWR lost in waiting, because the LGWR 3 seconds will write online redo, of course, this is just one of the conditions of LGWR writes, other and commit/rollback, the log buffer write a third, 1 m writing and so on, as long as the redo persistence and make sure don't lost, then the revision will not be lost;

2, have not been submitted before other session definitely cannot read to modify the record, your idea is right, oracle default transaction isolation level is read commited.

3, 10 g after reference to the company, it is very complicated, not explained in the qing dynasty,


I mean LGWR 3 seconds will write online redo, should call back DBWN written to disk, except that the other work don't lock the table should be 3 seconds can modify the data update to the hard disk

CodePudding user response:

reference 4 floor dgyig response:
Quote: refer to the second floor minsic78 response:

1, not necessarily, but the change may have been written into the log online redo log, unless for some reason, LGWR lost in waiting, because the LGWR 3 seconds will write online redo, of course, this is just one of the conditions of LGWR writes, other and commit/rollback, the log buffer write a third, 1 m writing and so on, as long as the redo persistence and make sure don't lost, then the revision will not be lost;

2, have not been submitted before other session definitely cannot read to modify the record, your idea is right, oracle default transaction isolation level is read commited.

3, 10 g after reference to the company, it is very complicated, not explained in the qing dynasty,


I mean LGWR 3 seconds will write online redo, should call back DBWN written to disk, except that the other work don't lock the table should be 3 seconds can modify the data update to the hard disk.


Or that answer: not necessarily, journaling and write dirty data is implemented by different background processes, LGWR no command DBWR function, and in this way, can seriously affect the efficiency of LGWR writing blog, on the contrary, DBWR is has the function of the command LGWR instead, LGWR trigger one of them is easy to be forgotten, that is: in one of the redo protection of dirty data is DBWR write data file file before, LGWR must be related to redo from the log buffer brush into the online redo log, the two daemons, actually has its own rhythm, and you lock lock is not completely and the like of things, such as the above mentioned data is not lost of words, want to say is: the oracle is through the log to make sure they don't throw the data changes, as long as the log is written to disk, then the changes will not lost (a premise: hardware damage), at a certain moment of disk data, based on the can apply these kept changing redo, so as to achieve the data changes is not lost,, so to speak, will tell from the function, and the DBWR write not write dirty data completely it doesn't matter,

In fact you can only think: if 3 seconds internal data will be written to the data file, that is how much spending! In a busy system - some of the data block will be frequent access, you update the data in the data block and there may be dozens or even hundreds of records, in access to the data block (note is access, select the same need to read the buffer cache, unless specific scenarios, may direct physical reads, such as open the parallel), if the buffer cache, and then there will be a physical reads, Oracle will be willing to do such a thing?

CodePudding user response:

reference 4 floor dgyig response:
Quote: refer to the second floor minsic78 response:

1, not necessarily, but the change may have been written into the log online redo log, unless for some reason, LGWR lost in waiting, because the LGWR 3 seconds will write online redo, of course, this is just one of the conditions of LGWR writes, other and commit/rollback, the log buffer write a third, 1 m writing and so on, as long as the redo persistence and make sure don't lost, then the revision will not be lost;

2, have not been submitted before other session definitely cannot read to modify the record, your idea is right, oracle default transaction isolation level is read commited.

3, 10 g after reference to the company, it is very complicated, not explained in the qing dynasty,


I mean LGWR 3 seconds will write online redo, should call back DBWN written to disk, except that the other work don't lock the table should be 3 seconds can modify the data update to the hard disk.

No before you commit, just modify memory data,
After a commit, only write the log (log) confirmation,

I finished the same session to update query data, query from memory (session's exclusive memory)

CodePudding user response:

refer to 6th floor wmxcn2000 response:
Quote: refer to 4th floor dgyig response:
Quote: refer to the second floor minsic78 response:

1, not necessarily, but the change may have been written into the log online redo log, unless for some reason, LGWR lost in waiting, because the LGWR 3 seconds will write online redo, of course, this is just one of the conditions of LGWR writes, other and commit/rollback, the log buffer write a third, 1 m writing and so on, as long as the redo persistence and make sure don't lost, then the revision will not be lost;

2, have not been submitted before other session definitely cannot read to modify the record, your idea is right, oracle default transaction isolation level is read commited.

3, 10 g after reference to the company, it is very complicated, not explained in the qing dynasty,


I mean LGWR 3 seconds will write online redo, should call back DBWN written to disk, except that the other work don't lock the table should be 3 seconds can modify the data update to the hard disk.

No before you commit, just modify memory data,
After a commit, only write the log (log) confirmation,

I finished the same session to update query data, query from memory (session's exclusive memory)


Before did not commit, changed data is also likely to have write data files

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related