Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2833387
  • 博文数量: 599
  • 博客积分: 16398
  • 博客等级: 上将
  • 技术积分: 6875
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-30 12:04
个人简介

WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606

文章分类

全部博文(599)

文章存档

2014年(12)

2013年(56)

2012年(199)

2011年(105)

2010年(128)

2009年(99)

分类: Oracle

2009-12-25 15:57:16

这篇文章描述为RAC环境创建STANDBY数据库。

由于篇幅限制,加上碰到了很多的bug,只能将文章拆分成多篇。

由于错误太多,导致一篇文章无法完全记录下来,创建STANDBY数据库问题汇总的第三部分。

RAC数据库建立STANDBY(一):http://yangtingkun.itpub.net/post/468/484988

RAC数据库建立STANDBY(二):http://yangtingkun.itpub.net/post/468/485013

RAC数据库建立STANDBY(三):http://yangtingkun.itpub.net/post/468/485054

RAC数据库建立STANDBY(四):http://yangtingkun.itpub.net/post/468/485090


刚刚在进行RAC环境的DUPLICATE DATABASE的时候,就碰到了很多问题,由于二者命令比较相似,本来认为这次不会碰到太多的问题,没有想到的是,这次碰到的问题居然比DUPLICATE碰到的问题多出一倍。而且基本上所有碰到的问题都是DUPLICATE操作时不曾遇到的。

bash-3.00$ rman target sys/test@rac11g auxiliary sys/test@rac11g1_s

Recovery Manager: Release 11.1.0.6.0 - Production on Tue Sep 9 17:38:58 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: RAC11G (DBID=1712482917)
connected to auxiliary database: RAC11GS (not mounted)

RMAN> run
2> {
3> allocate channel c1 device type disk connect sys/test@rac11g1;
4> allocate channel c2 device type disk connect sys/test@rac11g2;
5> allocate auxiliary channel ac1 device type disk connect sys/test@rac11g1_s;
6> allocate auxiliary channel ac2 device type disk connect sys/test@rac11g1_s;
7> duplicate target database for standby
8> dorecover
9> from active database;
10> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=621 instance=rac11g1 device type=DISK

allocated channel: c2
channel c2: SID=236 instance=rac11g2 device type=DISK

allocated channel: ac1
channel ac1: SID=658 instance=rac11g1 device type=DISK

allocated channel: ac2
channel ac2: SID=307 instance=rac11g1 device type=DISK

Starting Duplicate Db at 09-SEP-08

contents of Memory Script:
{
backup as copy reuse
file '/data/oracle/product/11.1/database/dbs/orapwrac11g2' auxiliary format
'/data/oracle/product/11.1/database/dbs/orapwrac11g1' ;
}
executing Memory Script

Starting backup at 09-SEP-08
released channel: c1
released channel: c2
released channel: ac1
released channel: ac2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/09/2008 17:39:16
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on c1 channel at 09/09/2008 17:39:16
ORA-19505: failed to identify file "/data/oracle/product/11.1/database/dbs/orapwrac11g2"
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3

RMAN> exit


Recovery Manager complete.

这个错误前面已经提到了,是由于连接到RAC的不同实例造成的,第一次采用了在本地创建一个orapwrac11g2的链接,指向裸设备上的密码问题。由于Oracle读取裸设备上面的密码文件错误,所以前面删除了两个链接,并将裸设备上面的密码文件拷贝到本地。因此这个错误又重现了,下面直接使用RAC11G1服务名,连接指定的实例,从根本上避免这个错误的产生:

bash-3.00$ rman target sys/test@rac11g1 auxiliary sys/test@rac11g1_s

Recovery Manager: Release 11.1.0.6.0 - Production on Tue Sep 9 17:40:41 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: RAC11G (DBID=1712482917)
connected to auxiliary database: RAC11GS (not mounted)

RMAN> run
2> {
3> allocate channel c1 device type disk connect sys/test@rac11g1;
4> allocate channel c2 device type disk connect sys/test@rac11g2;
5> allocate auxiliary channel ac1 device type disk connect sys/test@rac11g1_s;
6> allocate auxiliary channel ac2 device type disk connect sys/test@rac11g1_s;
7> duplicate target database for standby
8> dorecover
9> from active database;
10> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=619 instance=rac11g1 device type=DISK

allocated channel: c2
channel c2: SID=278 instance=rac11g2 device type=DISK

allocated channel: ac1
channel ac1: SID=307 instance=rac11g1 device type=DISK

allocated channel: ac2
channel ac2: SID=333 instance=rac11g1 device type=DISK

Starting Duplicate Db at 09-SEP-08

contents of Memory Script:
{
backup as copy reuse
file '/data/oracle/product/11.1/database/dbs/orapwrac11g1' auxiliary format
'/data/oracle/product/11.1/database/dbs/orapwrac11g1' ;
}
executing Memory Script

Starting backup at 09-SEP-08
Finished backup at 09-SEP-08

contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '+DATA/rac11g/rac11g_control_1';
restore clone controlfile to '+DATA/rac11g/rac11g_control_2' from
'+DATA/rac11g/rac11g_control_1';
restore clone controlfile to '+DATA/rac11g/rac11g_control_3' from
'+DATA/rac11g/rac11g_control_1';
sql clone 'alter database mount standby database';
}
executing Memory Script

Starting backup at 09-SEP-08
channel c1: starting datafile copy
copying standby control file
output file name=/data/oracle/product/11.1/database/dbs/snapcf_rac11g1.f tag=TAG20080909T173509 RECID=2 STAMP=664997710
channel c1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 09-SEP-08

Starting restore at 09-SEP-08

channel c1: no AUTOBACKUP in 7 days found
channel c2: no AUTOBACKUP in 7 days found
channel ac1: skipped, AUTOBACKUP already found
channel ac2: skipped, AUTOBACKUP already found
channel clone_default: copied control file copy
Finished restore at 09-SEP-08

Starting restore at 09-SEP-08

channel c1: no AUTOBACKUP in 7 days found
channel c2: no AUTOBACKUP in 7 days found
channel ac1: skipped, AUTOBACKUP already found
channel ac2: skipped, AUTOBACKUP already found
channel clone_default: copied control file copy
Finished restore at 09-SEP-08

sql statement: alter database mount standby database
released channel: c1
released channel: c2
released channel: ac1
released channel: ac2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/09/2008 17:41:41
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on clone_default channel at 09/09/2008 17:41:41
RMAN-11003: failure during parse/execution of SQL statement: alter database mount standby database
ORA-01103: database name 'RAC11G' in control file is not 'RAC11GS'

RMAN> exit


Recovery Manager complete.

这个错误是由于手误造成的,创建SPFILE的时候,PFILE文件指定了前面测试DUPLICATE时候创建的PFILE,导致DB_NAME名称错误。

bash-3.00$ rman target sys/test@rac11g1 auxiliary sys/test@rac11g1_s

Recovery Manager: Release 11.1.0.6.0 - Production on Tue Sep 9 18:31:45 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: RAC11G (DBID=1712482917)
connected to auxiliary database: RAC11G (not mounted)

RMAN> run
2> {
3> allocate channel c1 device type disk connect sys/test@rac11g1;
4> allocate channel c2 device type disk connect sys/test@rac11g2;
5> allocate auxiliary channel ac1 device type disk connect sys/test@rac11g1_s;
6> allocate auxiliary channel ac2 device type disk connect sys/test@rac11g1_s;
7> duplicate target database for standby
8> dorecover
9> from active database;
10> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=621 instance=rac11g1 device type=DISK

allocated channel: c2
channel c2: SID=278 instance=rac11g2 device type=DISK

allocated channel: ac1
channel ac1: SID=325 instance=rac11g1 device type=DISK

allocated channel: ac2
channel ac2: SID=324 instance=rac11g1 device type=DISK

Starting Duplicate Db at 09-SEP-08

contents of Memory Script:
{
backup as copy reuse
file '/data/oracle/product/11.1/database/dbs/orapwrac11g1' auxiliary format
'/data/oracle/product/11.1/database/dbs/orapwrac11g1' ;
}
executing Memory Script

Starting backup at 09-SEP-08
Finished backup at 09-SEP-08

contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '+DATA/rac11g/rac11g_control_1';
restore clone controlfile to '+DATA/rac11g/rac11g_control_2' from
'+DATA/rac11g/rac11g_control_1';
restore clone controlfile to '+DATA/rac11g/rac11g_control_3' from
'+DATA/rac11g/rac11g_control_1';
sql clone 'alter database mount standby database';
}
executing Memory Script

Starting backup at 09-SEP-08
channel c1: starting datafile copy
copying standby control file
output file name=/data/oracle/product/11.1/database/dbs/snapcf_rac11g1.f tag=TAG20080909T182613 RECID=3 STAMP=665000774
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 09-SEP-08

Starting restore at 09-SEP-08

channel c1: no AUTOBACKUP in 7 days found
channel c2: no AUTOBACKUP in 7 days found
channel ac1: skipped, AUTOBACKUP already found
channel ac2: skipped, AUTOBACKUP already found
channel clone_default: copied control file copy
Finished restore at 09-SEP-08

Starting restore at 09-SEP-08

channel c1: no AUTOBACKUP in 7 days found
channel c2: no AUTOBACKUP in 7 days found
channel ac1: skipped, AUTOBACKUP already found
channel ac2: skipped, AUTOBACKUP already found
channel clone_default: copied control file copy
Finished restore at 09-SEP-08

sql statement: alter database mount standby database
released channel: c1
released channel: c2
released channel: ac1
released channel: ac2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/09/2008 18:32:43
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_perfstat_1_8g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_undotbs2_2_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_undotbs1_2_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_6_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_5_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_4_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_3_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_2_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_ndmain_1_32g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_users_1_4g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_undotbs2_1_4g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_undotbs1_1_4g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_sysaux_1_1g conflicts with a file used by the target database
RMAN-05001: auxiliary file name /dev/vx/rdsk/datavg/rac11g_system_1_1g conflicts with a file used by the target database

RMAN> exit


Recovery Manager complete.

这个错误是刚才错误的继续,重新编辑PFILE的时候,漏掉了初始化参数db_file_name_convertlog_file_name_convert。使得RMAN在建立数据文件的时候没有通过源数据库与目标数据库文件名称是否相同的检查。

bash-3.00$ rman target sys/test@rac11g1 auxiliary sys/test@rac11g1_s

Recovery Manager: Release 11.1.0.6.0 - Production on Tue Sep 9 18:39:10 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: RAC11G (DBID=1712482917)
connected to auxiliary database: RAC11G (DBID=1712482917, not open)

RMAN> run
2> {
3> allocate channel c1 device type disk connect sys/test@rac11g1;
4> allocate channel c2 device type disk connect sys/test@rac11g2;
5> allocate auxiliary channel ac1 device type disk connect sys/test@rac11g1_s;
6> allocate auxiliary channel ac2 device type disk connect sys/test@rac11g1_s;
7> duplicate target database for standby
8> dorecover
9> from active database
10> db_file_name_convert '/dev/vx/rdsk/datavg', '+DATA/RAC11G';
11> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=619 instance=rac11g1 device type=DISK

allocated channel: c2
channel c2: SID=278 instance=rac11g2 device type=DISK

allocated channel: ac1
channel ac1: SID=307 instance=rac11g1 device type=DISK

allocated channel: ac2
channel ac2: SID=333 instance=rac11g1 device type=DISK

Starting Duplicate Db at 09-SEP-08
released channel: c1
released channel: c2
released channel: ac1
released channel: ac2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/09/2008 18:39:21
RMAN-05500: the auxiliary database must be not mounted when issuing a DUPLICATE command

RMAN> exit


Recovery Manager complete.

这个错误就很简单了,AUXILIARY实例必须处于NOMOUNT状态,而刚才中途失败的DUPLICATE FOR STANDBY命令已经将数据库处于MOUNT状态,因此需要重新将实例置为NOMOUNT状态。

终于快将碰到的问题都记录完了,不过篇幅所限,剩下的仍然需要下一篇继续。

阅读(1847) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~