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

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

0

积分

1

好友

1

主题
1#
发表于 2013-10-14 17:19:32 | 查看: 2184| 回复: 1
我的问题: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表空间的数据文件名称
  1. SQL> select name from v$tablespace;

  2. NAME
  3. ------------------------------
  4. SYSTEM
  5. UNDOTBS1
  6. SYSAUX
  7. USERS
  8. TEMP
  9. GOOGLE

  10. 6 rows selected.

  11. SQL> select name from v$datafile;

  12. NAME
  13. --------------------------------------------------------------------------------
  14. /u01/oracle/product/10.2.0/oradata/orcl/system01.dbf
  15. /u01/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf
  16. /u01/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf
  17. /u01/oracle/product/10.2.0/oradata/orcl/users01.dbf
  18. /u01/oracle/product/10.2.0/oradata/orcl/google.dbf

  19. SQL> alter tablespace google offline normal;

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

  21. 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';


  22. SQL> alter tablespace GOOGLE online;

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

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

  2. Tablespace altered.

  3. 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;
这时备用库终于出现异常
  1. File #7 added to control file as 'UNNAMED00007' because it was
  2. created under name already used in this database. Creation name:
  3. '/u01/oracle/product/10.2.0/oradata/orcl/google.dbf'
  4. Errors with log /u01/arch/1_61_724530650.dbf
  5. MRP0: Background Media Recovery terminated with error 1537
复制代码
除了这种情况,standby database还会在什么情况下刷新控制文件呢?

2#
发表于 2013-10-14 17:28:08
第一次发帖,发错类别了,应该发在oracle管理区,我还以为oracle技术资料是个问题类别呢?吐血。

回复 只看该作者 道具 举报

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

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

GMT+8, 2024-5-2 23:46 , Processed in 0.045467 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

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