免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 18330 | 回复: 12

[rman] oracle rac asm备份数据如何恢复到指定的磁盘组? [复制链接]

论坛徽章:
0
发表于 2014-01-25 13:15 |显示全部楼层
环境:生产:linux5.5+oracle 11g rac+asm
        恢复验证:linux5.5+oracle 11g+asm(单机)
问题:生产环境使用了三个磁盘组DATA,DATA1和DATA2,把生产数据用rman备份,现在要把备份数据恢复到验证环境,恢复的过程中发现数据都恢复到了DATA。请问,如何控制把生产环境存放在DATA,DATA1和DATA2上的数据分别恢复到验证环境的DATA,DATA1和DATA2上?

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
发表于 2014-01-25 21:51 |显示全部楼层
从磁带库restore, recover 到实验环境.

论坛徽章:
0
发表于 2014-01-26 08:34 |显示全部楼层
虽然所答非所问,但还是要感谢www_xylove的回复,谢谢!

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
发表于 2014-01-26 11:53 |显示全部楼层
你使用不同的存储,命名成data,不就可以recover到异机了吗?

论坛徽章:
0
发表于 2014-01-26 23:39 |显示全部楼层
www_xylove你好,我的生产环境是oracle 11g rac asm,数据放在三个磁盘组DATA,DATA1,DATA2,我使用rman做的数据备份。我搭了一个单机的恢复验证环境,也使用的asm,之前已成功做过多次的恢复验证,只是数据都自动恢复到了第一个磁盘组DATA上,所以我就只保留了DATA,把DATA1和DATA2删了,因为数据文件较大有7T,磁盘空间有限。今天我再做恢复的时候发现有两个文件恢复失败,提示要恢复到DATA2上,这两个文件应该是最近才创建的。所以我的问题是在恢复备份数据时在哪里能控制数据能恢复到指定的磁盘组上?我还想把所有文件都恢复到DATA上。

论坛徽章:
0
发表于 2014-01-28 08:47 |显示全部楼层
我使用了set newname进行恢复,restore database一切正常,查看DATA里面文件也有了,但是使用recover database的时候出错了,出错信息是:
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 33: '+DATA2/nxdb/datafile/ts_iba_ods.317.810408475'
ORA-01157: cannot identify/lock data file 33 - see DBWR trace file
ORA-01110: data file 33: '+DATA2/nxdb/datafile/ts_iba_ods.317.810408475
请问高手该如何处理,谢谢!

论坛徽章:
0
发表于 2014-01-28 09:46 |显示全部楼层
查看DBWR trace file错误如下:
ORA-01157: cannot identify/lock data file 33 - see DBWR trace file
ORA-01110: data file 33: '+DATA2/nxdb/datafile/ts_iba_ods.317.810408475'
ORA-17503: ksfdopn:2 Failed to open file +DATA2/nxdb/datafile/ts_iba_ods.317.810408475
ORA-15001: diskgroup "DATA2" does not exist or is not mounted
ORA-15001: diskgroup "DATA2" does not exist or is not mounted
可是我查看DATA里面已经有了DATA1和DATA2下所有的文件,而且也使用了switch datafile all;为什么还会出现这个错误呢?

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
发表于 2014-01-29 20:43 |显示全部楼层
这样,你首先把数据文件restore 到需要做恢复测试的实验环境,
然后生成控制文件,查看一下控制文件的内容,确定数据文件的路径。

论坛徽章:
8
戌狗
日期:2014-09-26 16:39:44水瓶座
日期:2014-10-10 02:06:57金牛座
日期:2014-10-11 23:04:042015亚冠之首尔
日期:2015-06-23 15:37:0015-16赛季CBA联赛之天津
日期:2016-01-22 18:58:2915-16赛季CBA联赛之佛山
日期:2016-05-31 19:18:0815-16赛季CBA联赛之同曦
日期:2016-08-10 16:26:3315-16赛季CBA联赛之辽宁
日期:2018-01-10 11:47:40
发表于 2014-01-30 18:02 |显示全部楼层
提示data2不存在或者没有在mount状态,你需要查看此磁盘组是否存在以及处在mount状态,如果不是mount状态,要看下asm磁盘头是否正常了

论坛徽章:
0
发表于 2014-02-10 13:29 |显示全部楼层
多谢二位的回复,问题还是没有解决,下面我把恢复过程贴出来,请指正。
[oracle@xdbbak ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 10 11:48:51 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/nxdbpfile.ora';
ORACLE instance started.

Total System Global Area 1.6034E+11 bytes
Fixed Size                  2236968 bytes
Variable Size            1.0630E+11 bytes
Database Buffers         5.3687E+10 bytes
Redo Buffers              352468992 bytes
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@xdbbak ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Feb 10 11:51:32 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: NXDB (not mounted)

RMAN> connect catalog rman/rman@rman;

connected to recovery catalog database

RMAN> run{               
2> allocate channel c1 device type 'sbt'
3> parms="ENV=(NB_ORA_CLIENT=xdb148,NB_ORA_SERV=szt-nbu)";
4> restore controlfile;
5> release channel c1;
6> }

allocated channel: c1
channel c1: SID=755 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.1 (2011120719)

Starting restore at 10-FEB-14

channel c1: starting datafile backup set restore
channel c1: restoring control file
channel c1: reading from backup piece c-1819409807-20140210-06
channel c1: piece handle=c-1819409807-20140210-06 tag=TAG20140210T112049
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:25
output file name=+DATA1/nxdb/controlfile/current.256.839159539
Finished restore at 10-FEB-14

released channel: c1

RMAN> alter database mount;

database mounted

RMAN> run{
2> allocate channel c1 device type 'sbt'
3> parms="ENV=(NB_ORA_CLIENT=xdb148,NB_ORA_SERV=szt-nbu)";
4> allocate channel c2 device type 'sbt'
5> parms="ENV=(NB_ORA_CLIENT=xdb148,NB_ORA_SERV=szt-nbu)";
6> allocate channel c3 device type 'sbt'
parms="ENV=(NB_ORA_CLIENT=xdb148,NB_ORA_SERV=szt-nbu)";
7> 8> allocate channel c4 device type 'sbt'
9> parms="ENV=(NB_ORA_CLIENT=xdb148,NB_ORA_SERV=szt-nbu)";
restore database;
10> 11> recover database;
12> release channel c1;
13> release channel c2;
14> release channel c3;
release channel c4;
15> 16> }

allocated channel: c1
channel c1: SID=504 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 7.1 (2011120719)

allocated channel: c2
channel c2: SID=1257 device type=SBT_TAPE
channel c2: Veritas NetBackup for Oracle - Release 7.1 (2011120719)

allocated channel: c3
channel c3: SID=1508 device type=SBT_TAPE
channel c3: Veritas NetBackup for Oracle - Release 7.1 (2011120719)

allocated channel: c4
channel c4: SID=1759 device type=SBT_TAPE
channel c4: Veritas NetBackup for Oracle - Release 7.1 (2011120719)

Starting restore at 10-FEB-14

creating datafile file number=421 name=+DATA1/nxdb/datafile/info.361.839147347
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00003 to +DATA/nxdb/datafile/undotbs1.520.810404497
channel c1: reading from backup piece bk_116631_1_839066496
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00387 to +DATA/nxdb/datafile/centerdbt.554.813839913
channel c2: reading from backup piece bk_116633_1_839066496
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00388 to +DATA/nxdb/datafile/centerdbt.555.813840015
channel c3: reading from backup piece bk_116634_1_839066496
channel c4: starting datafile backup set restore
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00384 to +DATA/nxdb/datafile/centerdbt.550.811592521
channel c4: reading from backup piece bk_116632_1_839066496
channel c1: piece handle=bk_116631_1_839066496 tag=HOT_DB_BK_LEVEL0
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:08:36
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00398 to +DATA1/nxdb/datafile/tab_2013.354.822731241
channel c1: reading from backup piece bk_116637_1_839067145
channel c2: piece handle=bk_116633_1_839066496 tag=HOT_DB_BK_LEVEL0
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:15:01
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00397 to +DATA1/nxdb/datafile/tab_2013.353.822646653
channel c2: reading from backup piece bk_116636_1_839067142
channel c3: piece handle=bk_116634_1_839066496 tag=HOT_DB_BK_LEVEL0
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:15:01
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00391 to +DATA1/nxdb/datafile/tab_2013.351.816164479
channel c3: reading from backup piece bk_116635_1_839067142
channel c4: piece handle=bk_116632_1_839066496 tag=HOT_DB_BK_LEVEL0

启动数据库的参数文件是从生产环境拷贝过来的,删除了rac的相关内容。从恢复的日志上看是有文件恢复到DATA1上的,比如restoring datafile 00391 to +DATA1/nxdb/datafile/tab_2013.351.816164479,但是进到磁盘组中查看,这个文件并没有恢复到DATA1上,而是恢复到了DATA上,这是为什么那?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP