日志持久化

[复制链接]
查看11 | 回复9 | 2013-6-14 13:16:17 | 显示全部楼层 |阅读模式
"有时候当需要更多的日志缓冲区时,LWGR在一个事务提交前就将日志项写出,而这些日志项仅当在以后事务提交后才永久化"不太理解这里说的“仅当在以后事务提交后才永久化”,那“事务提交前就将日志项写出”不是写到日志文件中?请指教,谢谢!

回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Where did you read this? It's better to find Oracle's official document to support this claim. But maybe we're not understanding the "永久化" here correctly.
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yong Huang 发表于 2014-8-9 03:01
Where did you read this? It's better to find Oracle's official document to support this claim. But m ...

《OCA/OCP Oracle Database 11g All-in-One Exam Guide(Exams 1Z0-051,1Z0-052,and 1Z0-053)》这本书,确实可能对于他说的“永久化”的理解,应该不是写入日志文件这种含义。
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Thanks. I don't have that book. Could you show us the exact sentence? I suppose it's a book in English? Who's the author?
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yong Huang 发表于 2014-8-10 01:03
Thanks. I don't have that book. Could you show us the exact sentence? I suppose it's a book in Engli ...

hi,Mr. Huang
I got the statement in Oracle doc mentioned before.
Original Sentence:
"LGWR can write redo log entries to disk before a transaction commits. The redo entries become permanent only if the transaction later commits."
如果LGWR在COMMIT之前就写入redo日志文件中,那怎么能判断当交易commit操作后才让redo entries持久化?
谢谢您
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yong Huang 发表于 2014-8-10 01:03
Thanks. I don't have that book. Could you show us the exact sentence? I suppose it's a book in Engli ...

Another similar sentence:
"The redo log record contains the change to the data block and the change to the rollback
block. These changes may go to disk before a transaction is committed."
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
There's no magic about the word "permanent" here. It simply means the redo entries associated with the transaction will have a new record later marking the transaction commited instead of rolled back. Since redo entris are written in one-way, and never deleted, it's always: write some redo, followed by either mark it committed or mark it rolled back. "Become permanent" just means create a new record for commit.
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yong Huang 发表于 2015-1-21 01:31
There's no magic about the word "permanent" here. It simply means the redo entries associated with t ...

“It simply means the redo entries associated with the transaction will have a new record later marking the transaction commited instead of rolled back”
"create a new record" means new area in redo log buffer or redo log files?
In my mind, it means a new area is a new area in redo log files.
"followed by either mark it committed or mark it rolled back"
also means mark in the redo log file?
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yes and yes. A new redo record saying the transaction is committed or rolled back will be created in log buffer and later written to the redo logfiles.
回复

使用道具 举报

千问 | 2013-6-14 13:16:17 | 显示全部楼层
Yong Huang 发表于 2015-1-21 01:31
There's no magic about the word "permanent" here. It simply means the redo entries associated with t ...

Thanks a lot for your kindly reply.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行