RAC环境STANDBY数据库只能有一个实例在进行日志恢复工作
2011-04-22 20:51
537 查看
11g的STANDBY数据库可以在应用日志的同时打开数据库,但是对于RAC环境,这里有一些小的问题。
即使是RAC环境,STANDBY数据库也只能有一个实例在进行日志恢复工作。但是STANDBY的两个节点是可以同时打开进行READ ONLY访问的。而且11g还支持在进行恢复的时候打开数据库。那么Oracle是否支持在恢复的时候,同时打开两个节点进行只读访问呢。根据测试发现,这种操作是被禁止的:SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 1.7108E+10 bytes
Fixed Size 2101632 bytes
Variable Size 3344420480 bytes
Database Buffers 1.3757E+10 bytes
Redo Buffers 4431872 bytes数据库装载完毕。
SQL> set pages 100 lines 120
SQL> column unique_db_name format a15
SQL> column primary_db_unique_name format a25
SQL> select name,
2 open_mode,
3 database_role,
4 guard_status,
5 db_unique_name,
6 primary_db_unique_name
7 from v$database;
NAME OPEN_MODE DATABASE_ROLE GUARD_S DB_UNIQUE_NAME PRIMARY_DB_UNIQUE_NAME
--------- ---------- ---------------- ------- ------------------------------ -------------------------
RAC11G MOUNTED PHYSICAL STANDBY NONE rac11g_s rac11g
SQL> select instance_name, status from gv$instance;
INSTANCE_NAME STATUS
---------------- ------------
rac11g1 MOUNTED
SQL> alter database recover managed standby database disconnect from session;
数据库已更改。
而实例2尝试启动数据库则会报错:SQL> startup
ORACLE 例程已经启动。
Total System Global Area 1.7108E+10 bytes
Fixed Size 2101632 bytes
Variable Size 3478638208 bytes
Database Buffers 1.3623E+10 bytes
Redo Buffers 4431872 bytes数据库装载完毕。
ORA-01187: 由于验证测试失败而无法从文件 1 读取
ORA-01110: 数据文件 1: '+DATA/rac11g/rac11g_system_1_1g'
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
rac11g2
如果说这个错误不是很明确,那么alert文件里面的错误信息就清楚多了:Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 1 failed verification tests
ORA-01108: file 1 is in backup or media recovery
ORA-01110: data file 1: '+DATA/rac11g/rac11g_system_1_1g'
File 1 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 2 failed verification tests
ORA-01108: file 2 is in backup or media recovery
ORA-01110: data file 2: '+DATA/rac11g/rac11g_sysaux_1_1g'
File 2 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 3 failed verification tests
ORA-01108: file 3 is in backup or media recovery
ORA-01110: data file 3: '+DATA/rac11g/rac11g_undotbs1_1_4g'
File 3 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 4 failed verification tests
ORA-01108: file 4 is in backup or media recovery
ORA-01110: data file 4: '+DATA/rac11g/rac11g_undotbs2_1_4g'
File 4 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 5 failed verification tests
ORA-01108: file 5 is in backup or media recovery
ORA-01110: data file 5: '+DATA/rac11g/rac11g_users_1_4g'
File 5 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 6 failed verification tests
ORA-01108: file 6 is in backup or media recovery
ORA-01110: data file 6: '+DATA/rac11g/rac11g_ndmain_1_32g'
File 6 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 7 failed verification tests
ORA-01108: file 7 is in backup or media recovery
ORA-01110: data file 7: '+DATA/rac11g/rac11g_ndmain_2_32g'
File 7 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 8 failed verification tests
ORA-01108: file 8 is in backup or media recovery
ORA-01110: data file 8: '+DATA/rac11g/rac11g_ndmain_3_32g'
File 8 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 9 failed verification tests
ORA-01108: file 9 is in backup or media recovery
ORA-01110: data file 9: '+DATA/rac11g/rac11g_ndmain_4_32g'
File 9 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 10 failed verification tests
ORA-01108: file 10 is in backup or media recove
ca94
ry
ORA-01110: data file 10: '+DATA/rac11g/rac11g_ndmain_5_32g'
File 10 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 11 failed verification tests
ORA-01108: file 11 is in backup or media recovery
ORA-01110: data file 11: '+DATA/rac11g/rac11g_ndmain_6_32g'
File 11 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 12 failed verification tests
ORA-01108: file 12 is in backup or media recovery
ORA-01110: data file 12: '+DATA/rac11g/rac11g_undotbs1_2_32g'
File 12 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 13 failed verification tests
ORA-01108: file 13 is in backup or media recovery
ORA-01110: data file 13: '+DATA/rac11g/rac11g_undotbs2_2_32g'
File 13 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 14 failed verification tests
ORA-01108: file 14 is in backup or media recovery
ORA-01110: data file 14: '+DATA/rac11g/rac11g_perfstat_1_8g'
File 14 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 201 failed verification tests
ORA-01122: database file 201 failed verification check
ORA-01110: data file 201: '+DATA/rac11g/rac11g_temp_1_4g'
ORA-01203: wrong incarnation of this file - wrong creation SCN
File 201 not verified due to error ORA-01122
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 202 failed verification tests
ORA-01122: database file 202 failed verification check
ORA-01110: data file 202: '+DATA/rac11g/rac11g_temp_2_16g'
ORA-01206: file is not part of this database - wrong database id
File 202 not verified due to error ORA-01122
ORA-1187 signalled during: ALTER DATABASE OPEN...
显然Oracle不允许一个实例进行恢复的时候,另外一个实例只读打开。不过Oracle11g是允许当前实例进行恢复的同时打开数据库的,而且这个实例只读打开数据库后,另外一个实例也可以只读打开。具体的过程可以参考:但是这种情况下,Oracle会自动停止后台的恢复过程。而且似乎一旦这种情况发生过,下次就没有办法再次在恢复的时候打开数据库,这时会报错:SQL> alter database open;
alter database open
*第 1 行出现错误:
ORA-01154: 数据库忙。现在不允许打开, 关闭, 装载和卸装
现在还不清楚为什么会出现这个ORA-1154的错误,怀疑是bug导致的,但是这个错误的出现意味着无法在恢复的时候只读打开了。下面从另一个方面验证这种情况:SQL> alter database recover managed standby database cancel;
数据库已更改。
SQL> alter database open;
数据库已更改。
把另一个节点也打开:SQL> alter database open;
数据库已更改。
下面在实例1关闭数据库,并尝试进行恢复:SQL> alter database close;
数据库已更改。
SQL> alter database recover managed standby database disconnect from session;
数据库已更改。
似乎成功了,但是通过查询V$DATAGUARD_STATUS就可以看到,实际上恢复过程报错停止了:SQL> select message from v$dataguard_status
2 where message_num > (select max(message_num) - 2 from v$dataguard_status);
MESSAGE
--------------------------------------------------------------------------------------
MRP0: Background Media Recovery terminated with error 1153
MRP0: Background Media Recovery process shutdown
通过下面的命令也可以看到,实际上当前并没有进行恢复:SQL> alter database recover managed standby database cancel;
alter database recover managed standby database cancel
*第 1 行出现错误:
ORA-16136: 受管备用恢复未激活
可以看到,Oracle虽然在11g支持了应用归档的时候只读打开。但是对于另外一个节点,仍然是无法访问的。而且存在bug,会导致本节点在应用归档日志的时候也无法只读打开数据库。
即使是RAC环境,STANDBY数据库也只能有一个实例在进行日志恢复工作。但是STANDBY的两个节点是可以同时打开进行READ ONLY访问的。而且11g还支持在进行恢复的时候打开数据库。那么Oracle是否支持在恢复的时候,同时打开两个节点进行只读访问呢。根据测试发现,这种操作是被禁止的:SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 1.7108E+10 bytes
Fixed Size 2101632 bytes
Variable Size 3344420480 bytes
Database Buffers 1.3757E+10 bytes
Redo Buffers 4431872 bytes数据库装载完毕。
SQL> set pages 100 lines 120
SQL> column unique_db_name format a15
SQL> column primary_db_unique_name format a25
SQL> select name,
2 open_mode,
3 database_role,
4 guard_status,
5 db_unique_name,
6 primary_db_unique_name
7 from v$database;
NAME OPEN_MODE DATABASE_ROLE GUARD_S DB_UNIQUE_NAME PRIMARY_DB_UNIQUE_NAME
--------- ---------- ---------------- ------- ------------------------------ -------------------------
RAC11G MOUNTED PHYSICAL STANDBY NONE rac11g_s rac11g
SQL> select instance_name, status from gv$instance;
INSTANCE_NAME STATUS
---------------- ------------
rac11g1 MOUNTED
SQL> alter database recover managed standby database disconnect from session;
数据库已更改。
而实例2尝试启动数据库则会报错:SQL> startup
ORACLE 例程已经启动。
Total System Global Area 1.7108E+10 bytes
Fixed Size 2101632 bytes
Variable Size 3478638208 bytes
Database Buffers 1.3623E+10 bytes
Redo Buffers 4431872 bytes数据库装载完毕。
ORA-01187: 由于验证测试失败而无法从文件 1 读取
ORA-01110: 数据文件 1: '+DATA/rac11g/rac11g_system_1_1g'
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
rac11g2
如果说这个错误不是很明确,那么alert文件里面的错误信息就清楚多了:Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 1 failed verification tests
ORA-01108: file 1 is in backup or media recovery
ORA-01110: data file 1: '+DATA/rac11g/rac11g_system_1_1g'
File 1 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 2 failed verification tests
ORA-01108: file 2 is in backup or media recovery
ORA-01110: data file 2: '+DATA/rac11g/rac11g_sysaux_1_1g'
File 2 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 3 failed verification tests
ORA-01108: file 3 is in backup or media recovery
ORA-01110: data file 3: '+DATA/rac11g/rac11g_undotbs1_1_4g'
File 3 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 4 failed verification tests
ORA-01108: file 4 is in backup or media recovery
ORA-01110: data file 4: '+DATA/rac11g/rac11g_undotbs2_1_4g'
File 4 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 5 failed verification tests
ORA-01108: file 5 is in backup or media recovery
ORA-01110: data file 5: '+DATA/rac11g/rac11g_users_1_4g'
File 5 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 6 failed verification tests
ORA-01108: file 6 is in backup or media recovery
ORA-01110: data file 6: '+DATA/rac11g/rac11g_ndmain_1_32g'
File 6 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 7 failed verification tests
ORA-01108: file 7 is in backup or media recovery
ORA-01110: data file 7: '+DATA/rac11g/rac11g_ndmain_2_32g'
File 7 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 8 failed verification tests
ORA-01108: file 8 is in backup or media recovery
ORA-01110: data file 8: '+DATA/rac11g/rac11g_ndmain_3_32g'
File 8 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 9 failed verification tests
ORA-01108: file 9 is in backup or media recovery
ORA-01110: data file 9: '+DATA/rac11g/rac11g_ndmain_4_32g'
File 9 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 10 failed verification tests
ORA-01108: file 10 is in backup or media recove
ca94
ry
ORA-01110: data file 10: '+DATA/rac11g/rac11g_ndmain_5_32g'
File 10 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 11 failed verification tests
ORA-01108: file 11 is in backup or media recovery
ORA-01110: data file 11: '+DATA/rac11g/rac11g_ndmain_6_32g'
File 11 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 12 failed verification tests
ORA-01108: file 12 is in backup or media recovery
ORA-01110: data file 12: '+DATA/rac11g/rac11g_undotbs1_2_32g'
File 12 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 13 failed verification tests
ORA-01108: file 13 is in backup or media recovery
ORA-01110: data file 13: '+DATA/rac11g/rac11g_undotbs2_2_32g'
File 13 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 14 failed verification tests
ORA-01108: file 14 is in backup or media recovery
ORA-01110: data file 14: '+DATA/rac11g/rac11g_perfstat_1_8g'
File 14 not verified due to error ORA-01108
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 201 failed verification tests
ORA-01122: database file 201 failed verification check
ORA-01110: data file 201: '+DATA/rac11g/rac11g_temp_1_4g'
ORA-01203: wrong incarnation of this file - wrong creation SCN
File 201 not verified due to error ORA-01122
Errors in file /data/oracle/diag/rdbms/rac11g_s/rac11g2/trace/rac11g2_dbw0_1093.trc:
ORA-01186: file 202 failed verification tests
ORA-01122: database file 202 failed verification check
ORA-01110: data file 202: '+DATA/rac11g/rac11g_temp_2_16g'
ORA-01206: file is not part of this database - wrong database id
File 202 not verified due to error ORA-01122
ORA-1187 signalled during: ALTER DATABASE OPEN...
显然Oracle不允许一个实例进行恢复的时候,另外一个实例只读打开。不过Oracle11g是允许当前实例进行恢复的同时打开数据库的,而且这个实例只读打开数据库后,另外一个实例也可以只读打开。具体的过程可以参考:但是这种情况下,Oracle会自动停止后台的恢复过程。而且似乎一旦这种情况发生过,下次就没有办法再次在恢复的时候打开数据库,这时会报错:SQL> alter database open;
alter database open
*第 1 行出现错误:
ORA-01154: 数据库忙。现在不允许打开, 关闭, 装载和卸装
现在还不清楚为什么会出现这个ORA-1154的错误,怀疑是bug导致的,但是这个错误的出现意味着无法在恢复的时候只读打开了。下面从另一个方面验证这种情况:SQL> alter database recover managed standby database cancel;
数据库已更改。
SQL> alter database open;
数据库已更改。
把另一个节点也打开:SQL> alter database open;
数据库已更改。
下面在实例1关闭数据库,并尝试进行恢复:SQL> alter database close;
数据库已更改。
SQL> alter database recover managed standby database disconnect from session;
数据库已更改。
似乎成功了,但是通过查询V$DATAGUARD_STATUS就可以看到,实际上恢复过程报错停止了:SQL> select message from v$dataguard_status
2 where message_num > (select max(message_num) - 2 from v$dataguard_status);
MESSAGE
--------------------------------------------------------------------------------------
MRP0: Background Media Recovery terminated with error 1153
MRP0: Background Media Recovery process shutdown
通过下面的命令也可以看到,实际上当前并没有进行恢复:SQL> alter database recover managed standby database cancel;
alter database recover managed standby database cancel
*第 1 行出现错误:
ORA-16136: 受管备用恢复未激活
可以看到,Oracle虽然在11g支持了应用归档的时候只读打开。但是对于另外一个节点,仍然是无法访问的。而且存在bug,会导致本节点在应用归档日志的时候也无法只读打开数据库。
相关文章推荐
- oracle技术之利用STANDBY将单实例数据库升级为RAC环境(三)
- oracle技术之利用STANDBY将单实例数据库升级为RAC环境(一)
- oracle技术之利用STANDBY将单实例数据库升级为RAC环境(二)
- oracle技术之利用STANDBY将单实例数据库升级为RAC环境(四)
- RAC环境下通过connect 到数据库的实例,做备份与恢复的方法
- 12C RAC中的一个数据库实例自动crash并报ORA-27157、ORA-27300等错误
- 单实例数据库迁移到rac环境(四)上
- RAC环境下如何利用冷备份进行恢复
- 阿里云数据库实例的一个db被开发人员删除了 如何恢复
- 如何恢复一个非用户sa创建的数据库,且使用原用户创建者进行访问
- RAC 数据库安装完成后,使用sql连接 提示连接到一个空实例
- Log4j记录日志到数据库的一个实例
- RMAN备份恢复系列1: Oracle 10g rac asm数据库恢复到10g单实例数据库
- 1.说说你个人理解的存储解决方案的发展趋势,作图描述。 11.png 2.画一张说明ASM实例同数据库实例协同工作的原理图,并给出语言描述。 14.png 一个监听器可以为多个实例
- RAC 环境中最常见的 5 个数据库和/或实例性能问题 (文档 ID 1602076.1)
- 使用rman异地恢复数据库试验(RAC恢复到单实例数据库)
- 将oracle冷备份恢复到另外一个数据库实例中
- Oracle 远程访问配置 在 Windows Forms 和 WPF 应用中使用 FontAwesome 图标 C#反序列化XML异常:在 XML文档(0, 0)中有一个错误“缺少根元素” C#[Win32&WinCE&WM]应用程序只能运行一个实例:MutexHelper Decimal类型截取保留N位小数向上取, Decimal类型截取保留N位小数并且不进行四舍五入操作
- 数据库崩溃,利用备份和日志进行灾难恢复
- RAC 环境中最常见的 5 个数据库和/或实例性能问题 (文档 ID 1602076.1)