Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

65

积分

0

好友

31

主题
1#
发表于 2013-6-19 07:25:11 | 查看: 8886| 回复: 4
本帖最后由 etl2007 于 2013-6-19 07:27 编辑

从这3个资料
http://www.xifenfei.com/772.html

http://docs.oracle.com/cd/E11882_01/server.112/e25608/log_arch_dest_param.htm#i83986


http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams100.htm#CHDJDFCJ


VALID_FOR=(redo_log_type, database_role)

Identifies when redo transport services can transmit redo data to destinations based on the following factors:

redo_log_type—whether online redo log files, standby redo log files, or both are currently being archived on the database at this destination

database_role—whether the database is currently running in the primary or the standby role

Example

In the following example, the DB_UNIQUE_NAME parameter specifies boston (DB_UNIQUE_NAME=boston), which is also specified with the DB_UNIQUE_NAME attribute on the LOG_ARCHIVE_DEST_1 parameter. The DB_UNIQUE_NAME attribute on the LOG_ARCHIVE_DEST_2 parameter specifies the chicago destination. Both boston and chicago are listed in the LOG_ARCHIVE_CONFIG=DG_CONFIG parameter.

DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston,denver)'
LOG_ARCHIVE_DEST_1='LOCATION=/arch1/
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
  DB_UNIQUE_NAME=boston'
LOG_ARCHIVE_DEST_2='SERVICE=Sales_DR
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
  DB_UNIQUE_NAME=chicago'


VALID_FOR根据以下的因素来标识Log Transport Service什么时候可以向目的地传送重做数据:
(1)数据库当前运行在主角色还是备用角色下,
(2)当前是否正在该目的地的数据库上归档联机重做日志文件、备用重做日志文件或者这两类文件。
该属性的默认值是VALID_FOR= (ALL_LOGFILES, ALL_ROLES)。
其他的取值包括PRIMARY_ROLE、STANDBY_ROLE、ONLINE_LOGFILES和STANDBY_LOGFILE




我疑问是这样的如果是  PRIMARY_ROLE,那么生效是只能是online_redolog
              如果是  STANDBY_ROLE,那么生效的只可能是STANDBY_LOGFILE
如果基于这个理解,那么
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,STANDBY_ROLE)
是对的

VALID_FOR=(ONLINE_LOGFILES,STANDBY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)     
肯定是不对的,这样理解对吧?         

但是
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
  要如何理解呢?
我的理解者等于同时配置了
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,STANDBY_ROLE)

而不代表对
VALID_FOR=(ONLINE_LOGFILES,STANDBY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)     
也生效

我这样理解对吗
2#
发表于 2013-6-19 21:35:42
学习了解

回复 只看该作者 道具 举报

3#
发表于 2013-9-22 23:27:22
VALID_FOR

Specifies whether redo data will be written to a destination, based on the following factors:

Whether the database is currently running in the primary or the standby role

Whether online redo log files, standby redo log files, or both are currently being archived on the database at this destination

Category        VALID_FOR=(redo_log_type, database_role)
Data Type        String value
Valid values        Not applicable
Default Value        VALID_FOR=(ALL_LOGFILES, ALL_ROLES)
Requires attributes        None
Conflicts with attributes        None
Corresponds to        VALID_NOW, VALID_TYPE, and VALID_ROLE columns in the V$ARCHIVE_DEST view
Usage Notes

The VALID_FOR attribute is optional. However, Oracle recommends that the VALID_FOR attribute be specified for each redo transport destination at each database in an Oracle Data Guard configuration so that redo transport continues after a role transition to any standby database in the configuration.

To configure these factors for each LOG_ARCHIVE_DEST_n destination, you specify this attribute with a pair of keywords: VALID_FOR=(redo_log_type,database_role):

The redo_log_type keyword identifies the destination as valid for archiving one of the following:

ONLINE_LOGFILE—This destination is valid only when archiving online redo log files.

STANDBY_LOGFILE—This destination is valid only when archiving standby redo log files.

ALL_LOGFILES— This destination is valid when archiving either online redo log files or standby redo log files.

The database_role keyword identifies the role in which this destination is valid for archiving:

PRIMARY_ROLE—This destination is valid only when the database is running in the primary role.

STANDBY_ROLE—This destination is valid only when the database is running in the standby role.

ALL_ROLES—This destination is valid when the database is running in either the primary or the standby role.

If you do not specify the VALID_FOR attribute for a destination, by default, archiving online redo log files and standby redo log files is enabled at the destination, regardless of whether the database is running in the primary or the standby role. This default behavior is equivalent to setting the (ALL_LOGFILES,ALL_ROLES) keyword pair on the VALID_FOR attribute.

The VALID_FOR attribute enables you to use the same initialization parameter file for both the primary and standby roles.

回复 只看该作者 道具 举报

4#
发表于 2013-9-24 22:25:49
SERVICE
REOPEN
DELAY
NOREGISTER
MAX FAILURE
ASYNC
AFFIRM
NOAFFIRM
NET_TIMEOUT
VALID_FOR
DB_UNIQUE_NAME
MAX_CONNECTIONS
COMPRESSION

回复 只看该作者 道具 举报

5#
发表于 2013-9-26 15:27:33
“VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,STANDBY_ROLE)

而不代表对
VALID_FOR=(ONLINE_LOGFILES,STANDBY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)     ”

这里我觉得有问题。对于物理dg来说。all logfiles和all roles的确只可能是这两种
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
VALID_FOR=(STANDBY_LOGFILE,STANDBY_ROLE)

但是对于逻辑dg来说。备库有自己的备重做日志和在线日志。这两个都需要归档。所以当这个库切换成备库的时候。如果这里valid for设置的两个参数都是all。那其实相当于。(all_logfiles,standby_role),也就是说。两种日志都需要设置归档地址,如果默认写法。那就是两种日志归档到同一个地方了。


回复 只看该作者 道具 举报

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

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2025-1-6 08:28 , Processed in 0.047061 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569