oracle 11.2.0.4 rac 恢复到单实例

一、备份原库

run{
backup database format '/home/oracle/backup/db_%U_%T.bak';
backup current controlfile format '/home/oracle/backup/ctl_%U_%T.bak';
backup spfile format '/home/oracle/backup/spfile_%U_%T.bak';
backup archivelog from time 'sysdate -1' format  '/home/oracle/backup/arch_%U_%T.bak';
}

二、修改单实例的参数文件

将备份的文件拷贝到单实例的相同目录

db_name=suq
log_archive_dest_1='location=/arch'
pga_aggregate_target=400000000
sga_target=800000000
control_files='/oradata/control.ctl'

启动单实例到nomount

[[email protected] dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 12 20:39:56 2014

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

Connected to an idle instance.

SQL>
SQL> startup nomount
ORACLE instance started.

Total System Global Area  797523968 bytes
Fixed Size		    2257472 bytes
Variable Size		  222301632 bytes
Database Buffers	  566231040 bytes
Redo Buffers		    6733824 bytes

三、恢复控制文件

[[email protected] ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 12 20:40:14 2014

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

connected to target database: SUQ (not mounted)

RMAN> restore controlfile from '/home/oracle/backup/clt_0dpq0ka5_1_1_20141212.bak';

Starting restore at 12-DEC-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=171 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/control.ctl
Finished restore at 12-DEC-14

RMAN> 

SQL> startup mount
ORACLE instance started.

Total System Global Area  797523968 bytes
Fixed Size		    2257472 bytes
Variable Size		  222301632 bytes
Database Buffers	  566231040 bytes
Redo Buffers		    6733824 bytes
ORA-00201: control file version 11.2.0.4.0 incompatible with ORACLE version
11.2.0.0.0
ORA-00202: control file: '/oradata/control.ctl'

这里一个报错,需要在pfile中添加版本的参数

compatible='11.2.0.4.0'
SQL> startup mount
ORACLE instance started.

Total System Global Area  797523968 bytes
Fixed Size		    2257472 bytes
Variable Size		  222301632 bytes
Database Buffers	  566231040 bytes
Redo Buffers		    6733824 bytes
Database mounted.
SQL> exit

四、修改日志文件的路径

alter database rename file '+BACKUP/suq/onlinelog/group_1.258.850940549' to '/oradata/group_1.258.850940549';
alter database rename file '+BACKUP/suq/onlinelog/group_1.259.850940549' to '/oradata/group_1.259.850940549';
alter database rename file '+BACKUP/suq/onlinelog/group_2.260.850940551' to '/oradata/group_2.260.850940551';
alter database rename file '+BACKUP/suq/onlinelog/group_2.261.850940551' to '/oradata/group_2.261.850940551';
alter database rename file '+BACKUP/suq/onlinelog/group_3.268.850941051' to '/oradata/group_3.268.850941051';
alter database rename file '+BACKUP/suq/onlinelog/group_3.269.850941053' to '/oradata/group_3.269.850941053';
alter database rename file '+BACKUP/suq/onlinelog/group_4.270.850941053' to '/oradata/group_4.270.850941053';

Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL> alter database rename file '+BACKUP/suq/onlinelog/group_4.271.850941053' to '/oradata/group_4.271.850941053';

Database altered.

五、还原数据文件,需要指定scn号,可以list backup查看,需要写到你能恢复到的那个时间点

run{
set newname for database to '/oradata/%b';
set until scn 394762;
restore database;
switch datafile all;
}

executing command: SET NEWNAME

Starting restore at 12-DEC-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=170 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /oradata/system.262.850940553
channel ORA_DISK_1: restoring datafile 00002 to /oradata/sysaux.263.850940565
channel ORA_DISK_1: restoring datafile 00003 to /oradata/undotbs1.264.850940573
channel ORA_DISK_1: restoring datafile 00004 to /oradata/undotbs2.266.850940597
channel ORA_DISK_1: restoring datafile 00005 to /oradata/users.267.853590391
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/db_0bpq0k84_1_1_20141212.bak
channel ORA_DISK_1: piece handle=/home/oracle/backup/db_0bpq0k84_1_1_20141212.bak tag=TAG20141212T194156
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 12-DEC-14

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=866148453 file name=/oradata/system.262.850940553
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=866148453 file name=/oradata/sysaux.263.850940565
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=866148453 file name=/oradata/undotbs1.264.850940573
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=866148453 file name=/oradata/undotbs2.266.850940597
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=866148453 file name=/oradata/users.267.853590391

RMAN> 

[[email protected] oradata]$ ls -l
total 1765776
-rw-r----- 1 oracle oinstall  18497536 Dec 12 20:48 control.ctl
-rw-r----- 1 oracle oinstall 629153792 Dec 12 20:47 sysaux.263.850940565
-rw-r----- 1 oracle oinstall 734011392 Dec 12 20:47 system.262.850940553
-rw-r----- 1 oracle oinstall 209723392 Dec 12 20:47 undotbs1.264.850940573
-rw-r----- 1 oracle oinstall 209723392 Dec 12 20:47 undotbs2.266.850940597
-rw-r----- 1 oracle oinstall   5251072 Dec 12 20:46 users.267.853590391
[[email protected] oradata]$ 

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/oradata/system.262.850940553
/oradata/sysaux.263.850940565
/oradata/undotbs1.264.850940573
/oradata/undotbs2.266.850940597
/oradata/users.267.853590391

六、打开数据库,一些后续操作

SQL> alter database open resetlogs;

Database altered.

SQL> select count(*) from test.t1;

  COUNT(*)
----------
	 2

SQL> alter database disable thread 2;

Database altered.

SQL> alter database disable thread 2;

Database altered.

SQL>
SQL>
SQL>
SQL> alter database drop logfile group 3;

Database altered.

SQL> alter database drop logfile group 4;

Database altered.
时间: 2024-10-19 11:41:40

oracle 11.2.0.4 rac 恢复到单实例的相关文章

我的淘宝:Ubuntu 14.04.5上安装 Oracle 11.2.0.4 RAC

进入淘宝店铺 教程:Ubuntu 14.04.5上安装 Oracle 11.2.0.4 RAC 请支持下.价格好商量!

我的淘宝:Ubuntu 16.04.2上安装 Oracle 11.2.0.4 RAC

进入淘宝店铺 教程:Ubuntu 16.04.2上安装 Oracle 11.2.0.4 RAC 请支持下.价格好商量!

我的淘宝:Ubuntu 12.04.5上安装 Oracle 11.2.0.4 RAC

进入淘宝店铺 教程:Ubuntu 12.04.5上安装 Oracle 11.2.0.4 RAC 请支持下.价格好商量!

ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档

ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档 2015-10-21 12:51 525人阅读 评论(0) 收藏 举报  分类: Oracle RAC 版权声明:本文为博主原创文章,未经博主允许不得转载. VBOX + Oracle Linux 6U3 + ORACLE 11.2.0.3.0 RAC 安装 环境: 虚拟机          VIRTUAL BOX OS                ORACLE LINUX 6.3_X86_64

oracle 11.2.0.4 rac 打补丁

本次安装pus环境是11.2.0.4 rac,打的patch为11.2.0.4.180717 (Includes Database PSU),gi补丁和数据库补丁一起打 安装最新opatch版本 unzip p6880880_112000_AIX64-5L.zip -d /oracle/app/crs unzip p6880880_112000_AIX64-5L.zip -d /oracle/db/product/11.2 查看版本 opatch version OPatch Version:

oracle 11.2.0.3 rac集群rman周备份策略

1 1.1备份策略 2 周日执行0级的增量备份 3 4 周一执行2级的增量备份 5 6 周二执行2级的增量备份 7 8 周三执行1级的增量备份 9 10 周四执行2级的增量备份 11 12 周五执行2级的增量备份 13 14 周六执行2级的增量备份 15 周日进行一次零级备份,周一.周二.进行二级备份:周三进行一级备份:周四.周五.周六进行二级备份.在执行备份的时候,我们考 虑将数据文件的全备和归档日志备份分开执行,避免造成一些不必要的麻烦.在进行全备的时候,由于RAC的两个节点是共享的所有数据

关于安装Oracle 11.2.0.1 RAC的笔记

这是第一次安装RAC,参考了国外一位大神的安装文档,在安装过程中,也遇到了一些问题,从网上查了相关问题的解决方法,在此感谢. 操作系统是 Oracle Enterprise Linux 5,两个节点 rac1和rac2,网卡eth0作为public,eth1作为private,假设之前已添加一块20G容量的共享磁盘. 关于Oracle Enterprise Linux 下载,可以在https://edelivery.oracle.com/osdc/faces/Home.jspx登陆后下载. 主机

Oracle 11.2.0.4 RAC Standby实施手册

Oracle RAC Standby实施手册   目录 1 实施环境规划 3 1.1 IP地址规划 3 1.2 归档配置相关参数 3 1.3 主库软件环境信息 4 1.4 备库软件环境信息 4 2 Active DataGuard实施条件 6 3 Active DataGuard实施准备 8 3.1 配置DG专用监听 8 3.1.1 创建LISTENER_DG 8 3.1.2 将监听加入到crs资源 10 3.2 配置TNS别名 10 3.3 同步口令文件 11 3.4 测试TNS配置有效性 1

使用rman异地恢复数据库试验(RAC恢复到单实例数据库)

前言 rman在实际应用中用到的不多,很多时候一个项目开始设置好备份策略,后续基本上都用不到了,除非数据库出现异常,可以说,rman是一个不常用但是却非常重要的技能,但是又非常容易忘记.为了不在关键时刻掉链子,做了一个rman异地恢复数据库的试验. 试验环境介绍 操作系统 数据库版本 RAC? 源系统 CentOS 6.3 x64 11.2.0.4 2节点 目标系统 RedHat 6.4 x64 11.2.0.4 单节点 Rman备份: 0级数据库全备 操作步骤 将rman备份文件从源库上面拷贝