建立Standby之前一定要在primary db上操作
SQL> ALTER DATABASE FORCE LOGGING; 主要是为了防止一些特殊的改变不能写入redo log 而导致primary db和standby 上的数据不一致 。 比如nologging 定义的table 使用 /*+append*/ 时候插入的数据不会写redo log 。还有比如 create index nologging 在第一次创建索引数据时,不会生成REDO,但是会在SYS.OBJ$等系统表中插入一行表示索引存在,这个插入动作会记入日志 ( 但是最初向磁盘写索引结构的操作不会记录到日志 ) 。而以后对表的数据进行insert,update,delete时,都会生成该索引操作的REDO (这些后面的redo会导致以前的备份失去效用)。 所以一般建议nologging操作之后都要重新进行数据库备份 。
一般下命令 ALTER DATABASE FORCE LOGGING 之后数据库会一直出于force logging状态,不管是否有重新启动过。 他将记录除了temporary 外的所有数据库中的更改 ,不过如果你重建控制文件,除非你在 create controlfile 指定FORCE LOGGING, 否则数据库将恢复到没有执行force logging的状态。
FORCE LOGGING
Use this clause to put the database into FORCE LOGGING mode. Oracle will log all changes in the database except for changes in temporary tablespaces and temporary segments. This setting takes precedence over and is independent of any NOLOGGING or FORCE LOGGING settings you specify for individual tablespaces and any NOLOGGING settings you specify for individual database objects.
FORCE LOGGING mode is persistent across instances of the database. That is, if you shut down and restart the database, the database is still in FORCE LOGGING mode. However, if you re-create the control file, Oracle will take the database out of FORCE LOGGING mode unless you specify FORCE LOGGING in the CREATE CONTROLFILE statement.
In FORCE LOGGING mode, Oracle Database logs all changes in the database except changes in temporary tablespaces and temporary segments. This setting takes precedence over and is independent of any NOLOGGING or FORCE LOGGING settings you specify for individual tablespaces and any NOLOGGING settings you specify for individual database objects.
If you specify FORCE LOGGING, Oracle Database waits for all ongoing unlogged operations to finish.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-584594/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/35489/viewspace-584594/
本文介绍了在Oracle数据库中使用ALTER DATABASE FORCE LOGGING命令的重要性,此命令确保所有更改(除临时表空间外)都被记录,避免因未记录的更改导致主备数据库数据不一致的问题。文章还特别提到了在某些特定情况下,如使用nologging定义的表或创建无日志索引时,可能引发的数据一致性问题,并强调了在这种操作后进行数据库备份的必要性。
1223

被折叠的 条评论
为什么被折叠?



