我的编程空间,编程开发者的网络收藏夹
学习永远不晚

RAC数据库的RMAN备份异机如何恢复到单节点数据库

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

RAC数据库的RMAN备份异机如何恢复到单节点数据库

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;

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

RAC数据库的RMAN备份异机如何恢复到单节点数据库

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

如何备份和恢复MySQL数据库

备份和恢复MySQL数据库可以通过多种方式实现,以下是其中一种常用的方法:备份MySQL数据库:使用命令行工具备份数据库:mysqldump -u [用户名] -p [数据库名] > [备份文件路径]使用MySQL Workbench备份
如何备份和恢复MySQL数据库
2024-04-09

如何备份和恢复Oracle数据库

备份和恢复Oracle数据库是非常重要的,以防止数据丢失或损坏。以下是备份和恢复Oracle数据库的步骤:备份Oracle数据库:使用expdp命令导出数据库。可以使用以下命令:expdp username/password@datab
如何备份和恢复Oracle数据库
2024-04-09

如何备份和恢复SQLite数据库

要备份SQLite数据库,可以使用以下方法之一:使用SQLite的备份命令:sqlite3 your_database.db .dump > backup.sql使用SQLite的工具软件:可以使用SQLite的工具软件如DB Brows
如何备份和恢复SQLite数据库
2024-04-09

如何备份和恢复PostgreSQL数据库

备份和恢复PostgreSQL数据库可以通过以下步骤进行:备份数据库:使用pg_dump命令备份数据库,例如:pg_dump -U username -d dbname -f backup.sql如果想备份整个数据库集群,可以使用pg_
如何备份和恢复PostgreSQL数据库
2024-04-09

SQLite中如何备份和恢复数据库

SQLite提供了两种备份和恢复数据库的方法:使用SQLite命令行工具和使用SQLite的API。使用SQLite命令行工具备份和恢复数据库:备份数据库:sqlite3 original.db .dump > backup.sql恢复数
SQLite中如何备份和恢复数据库
2024-04-09

如何用PL/SQL备份与恢复数据库

备份数据库:创建一个脚本来执行备份操作,例如:CREATE OR REPLACE PROCEDURE backup_database ASBEGINEXECUTE IMMEDIATE ALTER DATABASE BEGIN BACKU
如何用PL/SQL备份与恢复数据库
2024-05-08

如何在Oracle中备份和恢复数据库

在Oracle中备份和恢复数据库可以使用以下步骤:备份数据库:使用expdp工具进行全库备份:expdp system/password@SID full=y dumpfile=full_backup.dmp directory=bac
如何在Oracle中备份和恢复数据库
2024-04-09

虚拟主机如何设置数据库备份恢复时间

虚拟主机设置数据库备份恢复时间通常是通过以下步骤来完成:定期备份数据库:首先,您需要设置一个定期备份数据库的计划。通常情况下,建议每天备份一次数据库,以确保数据的安全性。您可以使用数据库管理工具或者虚拟主机控制面板提供的备份功能来实现数据库
虚拟主机如何设置数据库备份恢复时间
2024-07-04

虚拟主机如何设置数据库备份恢复路径

要设置虚拟主机的数据库备份恢复路径,您需要通过数据库管理工具(例如phpMyAdmin、MySQL Workbench等)访问数据库,并按照以下步骤操作:登录数据库管理工具,选择要备份的数据库。找到数据库备份选项,通常位于工具的“导出”或
虚拟主机如何设置数据库备份恢复路径
2024-07-04

编程热搜

目录