RAC数据库的RMAN备份异机恢复到单节点数据库
1、首先在rac环境用rman备份数据库。
[oracle@rac1 admin]$ rman target /
run
{
allocate channel c1 device type disk connect 'sys/welcome123@IRAC1';
allocate channel c2 device type disk connect 'sys/welcome123@IRAC2';
backup AS COMPRESSED BACKUPSET incremental level= 0 Database format='/u01/app/oracle/backup/full_%U_%T' tag='fullbackup';
sql 'alter system archive log current';
backup archivelog all tag='arc_bak' format='/u01/app/oracle/backup/arch_%U_%T' delete input;
backup current controlfile tag='bak_ctlfile' format='/u01/app/oracle/backup/ctl_file_%U_%T';
backup spfile tag='spfile' format='/u01/app/oracle/backup/spfile_%U_%T';
release channel c2;
release channel c1;
}
备份过程中出现如下报错
released channel: c1
released channel: c2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on c1 channel at 08/25/2017 17:19:41
ORA-00245: control file backup failed; target is likely on a local file system
处理方法如下,在RAC环境运行如下命令:
RMAN>show snapshot controlfile name;
RMAN>CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+DATA/IRAC/CONTROLFILE/snapcf_IRAC.f';
处理后备份成功。
2、将rac环境的rman备份拷贝到单机(注意需要从rac的节点二上拷贝一部分来)。并就rac环境pfile copy到单机,根据单机主机资源,修改集群参数,实例名,文件路径以及sga和pga等参数。修改如下:
*.audit_file_dest='/u01/oracle/admin/IRAC/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/oracle/oradata/IRAC/control01.dbf','/u01/oracle/oradata/IRAC/control02.dbf'
*.db_block_size=8192
*.db_create_file_dest='/u01/oracle/oradata/IRAC/'
*.db_name='IRAC'
*.db_recovery_file_dest='/u01/oracle/'
*.db_recovery_file_dest_size=4558159872
*.diagnostic_dest='/u01/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=IRACXDB)'
*.log_archive_dest_1='location=/u01/oracle/archive'
*.open_cursors=300
*.pga_aggregate_target=100m
*.processes=150
*.remote_login_passwordfile='exclusive'
*.sga_target=400m
IRAC.undo_tablespace='UNDOTBS1'
3、用pfile将数据库启动到nomount
export ORACLE_SID=IRAC
[orapre@ouc backup]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 27 19:06:40 2017
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/u01/backup/1.ora';
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 134221104 bytes
Database Buffers 272629760 bytes
Redo Buffers 8466432 bytes
SQL>
4、restore 控制文件。
restore controlfile from '/u01/backup/ctl_file_18sd1hv3_1_1_20170828';
[orapre@ouc backup]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Aug 27 20:48:13 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: IRAC (not mounted)
RMAN> restore controlfile from '/u01/backup/ctl_file_18sd1hv3_1_1_20170828';
Starting restore at 27-AUG-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/u01/oracle/oradata/IRAC/control01.dbf
output file name=/u01/oracle/oradata/IRAC/control02.dbf
Finished restore at 27-AUG-17
RMAN>
5、restore 数据文件、归档。
alter database mount;
catalog start with '/u01/backup';
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
set newname for datafile 1 to '/u01/oracle/oradata/IRAC/system.dbf';
set newname for datafile 2 to '/u01/oracle/oradata/IRAC/sysaux.dbf';
set newname for datafile 3 to '/u01/oracle/oradata/IRAC/undotbs1.dbf';
set newname for datafile 4 to '/u01/oracle/oradata/IRAC/users.dbf';
set newname for datafile 5 to '/u01/oracle/oradata/IRAC/undotbs2.dbf';
set newname for datafile 6 to '/u01/oracle/oradata/IRAC/example.dbf';
restore database;
switch datafile all;
release channel c1;
release channel c2;
}
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size
------- ----------
35 4.81M
List of Archived Logs in backup set 35
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 41 3183645 28-AUG-17 3209549 28-AUG-17
2 30 3183649 28-AUG-17 3209517 28-AUG-17
Backup Set Copy #1 of backup set 35
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 28-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 35 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
35 1 EXPIRED /u01/app/oracle/backup/arch_14sd1hv1_1_1_20170828
Backup Set Copy #2 of backup set 35
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 27-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 35 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
44 1 AVAILABLE /u01/backup/arch_14sd1hv1_1_1_20170828
BS Key Size
------- ----------
36 1.68M
List of Archived Logs in backup set 36
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 42 3209549 28-AUG-17 3216276 28-AUG-17
2 31 3209517 28-AUG-17 3209519 28-AUG-17
Backup Set Copy #1 of backup set 36
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 28-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 36 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
36 1 EXPIRED /u01/app/oracle/backup/arch_15sd1hv2_1_1_20170828
Backup Set Copy #2 of backup set 36
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 27-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 36 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
43 1 AVAILABLE /u01/backup/arch_15sd1hv2_1_1_20170828
BS Key Size
------- ----------
37 1.85M
List of Archived Logs in backup set 37
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
2 32 3209656 28-AUG-17 3216272 28-AUG-17
2 33 3216272 28-AUG-17 3216288 28-AUG-17
Backup Set Copy #1 of backup set 37
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 28-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 37 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
37 1 EXPIRED /u01/app/oracle/backup/arch_16sd1hut_1_1_20170828
Backup Set Copy #2 of backup set 37
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 27-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 37 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
47 1 AVAILABLE /u01/backup/arch_16sd1hut_1_1_20170828
BS Key Size
------- ----------
38 2.00K
List of Archived Logs in backup set 38
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 43 3216276 28-AUG-17 3216284 28-AUG-17
Backup Set Copy #1 of backup set 38
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 28-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 38 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
38 1 EXPIRED /u01/app/oracle/backup/arch_17sd1hv2_1_1_20170828
Backup Set Copy #2 of backup set 38
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:00 27-AUG-17 NO ARC_BAK
List of Backup Pieces for backup set 38 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
42 1 AVAILABLE /u01/backup/arch_17sd1hv2_1_1_20170828
RMAN>restore archivelog sequence between 30 and 33 thread 2;
RMAN>restore archivelog sequence between 41 and 43 thread 1;
6、打开数据库
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 3216190 generated at 08/28/2017 11:38:07 needed for thread 1
ORA-00289: suggestion : /u01/oracle/archive/1_42_951416315.dbf
ORA-00280: change 3216190 for thread 1 is in sequence #42
Specify log: {=suggested | filename | AUTO | CANCEL}
AUTO
>recover出现报错,直接常识open resetlogs
open resetlog之前需要对redolog重命名
alter database rename file '+DATA/irac/onlinelog/group_2.264.951416317' to '/u01/oracle/oradata/IRAC/redo01.dbf';
alter database rename file '+DATA/irac/onlinelog/group_2.265.951416317' to '/u01/oracle/oradata/IRAC/redo02.dbf';
alter database rename file '+DATA/irac/onlinelog/group_1.262.951416315' to '/u01/oracle/oradata/IRAC/redo03.dbf';
alter database rename file '+DATA/irac/onlinelog/group_1.263.951416317' to '/u01/oracle/oradata/IRAC/redo04.dbf';
alter database rename file '+DATA/irac/onlinelog/group_3.268.951416437' to '/u01/oracle/oradata/IRAC/redo05.dbf';
alter database rename file '+DATA/irac/onlinelog/group_3.269.951416439' to '/u01/oracle/oradata/IRAC/redo06.dbf';
alter database rename file '+DATA/irac/onlinelog/group_4.270.951416439' to '/u01/oracle/oradata/IRAC/redo07.dbf';
alter database rename file '+DATA/irac/onlinelog/group_4.271.951416439' to '/u01/oracle/oradata/IRAC/redo08.dbf';
alter database open resetlogs;
create temporary tablespace temp1 tempfile '/u01/oracle/oradata/IRAC/temp1.dbf'size 20M;
alter database default temporary tablespace temp1;
------结束
RAC数据库的RMAN备份异机恢复到单节点数据库的更多相关文章
- RMAN - 备份异机恢复
OS: Oracle Linux Server release 5.7 DB: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - ...
- RMAN 备份异机恢复 并创建新DBID
测试平台信息: Oracle:11gR2 操作系统:Redhat 5.5 Target DB:dave 几点说明: (1)RMAN 异机恢复的时候,db_name必须相同. 如果说要想改成其他的实 ...
- 使用rman备份异机恢复数据库
一.RMAN备份源库注意点: 最好保留rman备份日志 $rman target / log=backup.log RMAN>run { allocate channel t1 type dis ...
- Rman备份异机恢复
最后更新时间:2018/12/29 前置条件 已准备一台安装好Centos6+oracle11gr2 软件的服务器; 只安装了 oracle 数据库软件,需要手工创建以下目录: #环境变量 expor ...
- Hyper-V安装Oracle Linux6_4 Oracle db 12c并使用rman做异机恢复
本文记录在Windows Server 2012 R2上安装Oracle Enterprise Linux 6.4以及使用RMAN进行进行异机恢复的过程. Windows服务器增加Hyper-V功能 ...
- Oracle之使用rman进行异机恢复测试记录
本次测试目的是从生产数据库导出rman备份然后在测试数据库恢复 1,拷贝备份至相应目录 2,进入rman rman target \ 3,关闭数据库 shutdown 4,以nomount模式启动数据 ...
- rman全备份异机恢复
一.测试环境 [oracle@localhost ~]$ uname -a Linux localhost.localdomain -.el6.x86_64 # SMP Tue May :: EDT ...
- Oracle 单实例 迁移到 RAC 实例 -- 使用RMAN 异机恢复
Oracle 官网有关单实例迁移到RAC的一个步骤说明: How to Convert 10g Single-Instance database to 10g RAC using Manual Con ...
- rman 备份并异机恢复
1.RMAN 备份脚本 RUN { CONFIGURE RETENTION POLICY DAYS; CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CO ...
随机推荐
- JavaScript窗口打开与关闭及如何使用opener使子窗口对父窗口进行操作
一.打开与关闭窗口 1.打开窗口:可以使用window对象中的Open()方法. newWindow = window.open(url,windowname,location); 参数说明: url ...
- Task.Factory.StartNew和Task.Run
在系统中单开线程进行操作,经常用到Task,发现Task主要有以下两种方法 Task.Factory.StartNew(() => { }); Task.Run(() => { }); 初 ...
- OpenDigg前端开源项目月报201704
由OpenDigg 出品的前端开源项目月报第一期来啦.我们的前端开源月报集合了OpenDigg一个月来新收录的优质前端开源项目,方便前端开发人员便捷的找到自己需要的项目工具. reactide Rea ...
- python分布式爬虫打造搜索引擎--------scrapy实现
最近在网上学习一门关于scrapy爬虫的课程,觉得还不错,以下是目录还在更新中,我觉得有必要好好的做下笔记,研究研究. 第1章 课程介绍 1-1 python分布式爬虫打造搜索引擎简介 07:23 第 ...
- 下拉框多选实现回显及sql
<td class="tabTd"><label>客户来源:</label></td> <td><select c ...
- C# 数组中的 indexOf 方法
var array=['REG','2018','2018']; array.indexOf(‘REG’) // 0 array.indexOf(‘R’) // -1 array.indexOf(’2 ...
- 山东第四届省赛: Boring Counting 线段树
http://acm.sdibt.edu.cn/JudgeOnline/problem.php?id=3237 Problem H:Boring Counting Time Limit: 3 Sec ...
- HNCU专题训练_线段树(2)
1.统计颜色,或运算的运用2.区间第k大数3.一个很经典的题5.求区间相等数字的个数6.RMQ模板题,区间最大值和最小值的差 1.很好的思路,用或运算来避免左右儿子树总相同颜色的情况.由于T颜色种类最 ...
- Java的工厂模式(二)
除了上文提到的方法之外,还可以使用Java的反射机制,这样就能使用类名称来加载所需要的类.我们只需改变工厂类和驱动类就可以了. FruitFactory.java package com.muggle ...
- 区分IE8/IE7/IE6及其他浏览器-CSS “\9″
区分IE8/IE7/IE6及其他浏览器-CSS “\9″ 原创文章,转载请注明来自张鑫旭-鑫空间-鑫生活[http://www.zhangxinxu.com] by zhangxinxu from h ...