johnson.18 发表于 2013-10-14 17:19:32

什么时候会刷新备库控制文件refresh the standby database control f...

我的问题:standby database在什么情况下会刷新控制文件?

Data Guard通过合理的设置,对于Primary的绝大数操作,都是可以传递到Physical Standby,对于datafile rename操作,必须进行手工处理。官方文档E25608-04《Data Guard Concepts and Administration 11 g Release 2 (11.2) 》的9.3.4 Renaming a Datafile in the Primary Database章节有明确的描述。

对于9.3.4节最后的说明如下:
If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages
similar to the following in the alert log:
ORA-00283: recovery session canceled due to errors
ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'
也就说如果STANDBY_FILE_MANAGEMENT设置为auto, 如果主库有rename datafile操着,备用库如果不做人工干预,在刷新备用库控制文件时会报错的,不明白的是,standby database在什么情况下会refresh  control file。

控制文件保存如下信息:
■ The database name and database unique identifier (DBID)
■ The time stamp of database creation
■ Information about data files, online redo log files, and archived redo log files
■ Tablespace information
■ RMAN backups
按照我的理解,只要控制文件信息有变化就算是刷新控制文件,通过实验发现,在主库上把一个google.dbf文件rename为google1.dbf,无论做什么操作,备用库一直运作正常,除非主库再次添加一个同名的google.dbf,才会触发备用库报错。

实验环境
OS:Red Hat Enterprise Linux AS release 4
DB:racle Database 10g Enterprise Edition Release 10.2.0.4.0

1、更改主库google表空间的数据文件名称SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
TEMP
GOOGLE

6 rows selected.

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/oracle/product/10.2.0/oradata/orcl/system01.dbf
/u01/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf
/u01/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf
/u01/oracle/product/10.2.0/oradata/orcl/users01.dbf
/u01/oracle/product/10.2.0/oradata/orcl/google.dbf

SQL> alter tablespace google offline normal;

SQL> ! mv /u01/oracle/product/10.2.0/oradata/orcl/google.dbf /u01/oracle/product/10.2.0/oradata/orcl/google1.dbf

SQL> alter database rename file '/u01/oracle/product/10.2.0/oradata/orcl/google.dbf' to '/u01/oracle/product/10.2.0/oradata/orcl/google1.dbf';


SQL> alter tablespace GOOGLE online;

SQL> alter system archive log current;此时查看备库日志正常,无异常信息。

2、为主库google表空间在添加个数据文件,同样standby也会为google表空间添加数据文件。SQL> alter tablespace google add datafile '/u01/oracle/product/10.2.0/oradata/orcl/google2.dbf' size 10m;

Tablespace altered.

SQL> alter system archive log current;此时查看备库仍然没有异常信息。这时我们在主库为google表空间添加个google.dbf文件看会出现什么情况?
---主库添加数据文件
SQL>alter tablespace google add datafile '/u01/oracle/product/10.2.0/oradata/orcl/google.dbf' size 10m;
SQL> alter system archive log current;
这时备用库终于出现异常File #7 added to control file as 'UNNAMED00007' because it was
created under name already used in this database. Creation name:
'/u01/oracle/product/10.2.0/oradata/orcl/google.dbf'
Errors with log /u01/arch/1_61_724530650.dbf
MRP0: Background Media Recovery terminated with error 1537除了这种情况,standby database还会在什么情况下刷新控制文件呢?

johnson.18 发表于 2013-10-14 17:28:08

第一次发帖,发错类别了,应该发在oracle管理区,我还以为oracle技术资料是个问题类别呢?吐血。
页: [1]
查看完整版本: 什么时候会刷新备库控制文件refresh the standby database control f...