免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2135 | 回复: 1
打印 上一主题 下一主题

force logging Oracle Dataguard [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-09-15 14:10 |只看该作者 |倒序浏览
force logging并不比一般的logging记录的日志多,
数据库在force logging状态下,nologging选项将无
效,因为nologging将破坏dataguard的可恢复性.
force logging强制数据库在任何状态下必须记录
日志而已。

logical standby允许数据库在恢复的同时进行访问,
physical standby则在恢复时不允许进行访问

logical standby可以使机器的使用最大化




Oracle Dataguard
Chapter 3 - Implementing Standby Databases

Preparing To Create a Physical Standby Database

ALTER DATABASE ARCHIVELOG;

If the “automatic archival” is not enabled, it can be enabled using the following statement:

ALTER SYSTEM ARCHIVE LOG START;

Change the log_archive_start=true parameter in the initialization file so that it will remain enabled on next startup of the database.  

Once the database is in archive log mode, the next step is to put it in FORCE LOGGING mode. This will ensure that all the transactions made on the primary database will be registered in the redo logs of the primary database and can be replicated on standby databases.

FORCE LOGGING Option

The FORCE LOGGING option is the safest method to ensure that all the changes made in the database will be captured and available for recovery in the redo logs. Force logging is the new feature added to the family of logging attributes.

Before the existence of FORCE LOGGING, Oracle provided logging and nologging options. These two options have higher precedence at the schema object level than the tablespace level; therefore, it was possible to override the logging settings at the tablespace level with nologging setting at schema object level.

rollping :
就是说,设置FORCE LOGGING 之后。本来一些可以指定nologging减少redo log的操作 ,虽然不报错,但事实上redo log还是都纪录了。
等于是,没法nologging了



其实nologging与表模式,插入模式,数据库运行模式(archived/unarchived)都有很大的关系。force logging(强制日志)模式通过命令:alter database force logging来使得Oracle无论什么操作都进行redo的写入。

  其实nologging与表模式,插入模式,数据库运行模式(archived/unarchived)都有很大的关系:

  总结如下:

  注意append是一种hint;

  一般我们可以这样来使用

  insert /*+append+/ into mytable values(1,'alan');

  数据库在归档模式下

  当表模式为logging状态时,无论是append模式还是no append模式,redo都会生成。

  当表模式为nologging状态时,只有append模式,不会生成redo.

  数据库在非归档模式下

  无论是在logging还是nologing的模式下,append的模式都不会生成redo,而no append模式下都会生成redo。

  如果我想看一张表是否是logging状态,可以这样

  select table_name,logging from dba_tables where table_name='tablename';

  那么在Oracle内部还存在一个内部参数:_disable_logging 默认是false

  通过更改为true可以让Oracle在修改表中的记录的时候完全不记录redo,这个参数要甚用。平时,我们只作为性能测试用。

  force logging(强制日志)模式:

  通过命令:

  alter database force logging来使得Oracle无论什么操作都进行redo的写入。

  通过select force_logging from v$database可以看到当前数据库强制日志模式的状
http://www.itpub.net/viewthread. ... p;extra=&page=1
http://database.ctocio.com.cn/tips/282/8200782.shtml
http://space.itpub.net/10648374/viewspace-615845

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
2 [报告]
发表于 2011-09-15 14:19 |只看该作者
这样会不会影响DB性能呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP