利用rman进行异机还原(目录不同)
来源:互联网 发布:知廉耻 懂敬畏 编辑:程序博客网 时间:2024/05/08 18:29
--注:备份操作省略,详见利用rman进行异机还原(目录相同)。下列操作均在目标服务器上进行。
--rman
[oracle@db02 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Sep 22 08:19:14 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: orcl (not mounted)
--设置dbid
RMAN> set dbid=1354163930
executing command: SET DBID
--还原控制文件
--在还原控制文件前,为了将控制文件与数据文件、日志文件放在同一文件目录,我对initsid.ora文件做了相应修改,此处省略...
RMAN> restore controlfile from '/u02/backup/ctl_20130922_0gokfho9_1_1.bak';
Starting restore at 22-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output filename=/u03/oradata/orcl/control01.ctl
output filename=/u03/oradata/orcl/control02.ctl
output filename=/u03/oradata/orcl/control03.ctl
Finished restore at 22-SEP-13
--打开数据库到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
--执行下列run脚本(根据数据文件的不同作相应修改)
RMAN> run{
set newname for datafile '/u02/oradata/orcl/system01.dbf' to '/u03/oradata/orcl/system01.dbf';
set newname for datafile '/u02/oradata/orcl/undotbs01.dbf' to '/u03/oradata/orcl/undotbs01.dbf';
set newname for datafile '/u02/oradata/orcl/sysaux01.dbf' to '/u03/oradata/orcl/sysaux01.dbf.dbf';
set newname for datafile '/u02/oradata/orcl/users01.dbf' to '/u03/oradata/orcl/users01.dbf';
set newname for datafile '/u02/oradata/orcl/app01.dbf' to '/u03/oradata/orcl/app01.dbf';
restore database;
switch datafile all;
}
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 22-SEP-13
Starting implicit crosscheck backup at 22-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 15 objects
Finished implicit crosscheck backup at 22-SEP-13
Starting implicit crosscheck copy at 22-SEP-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 22-SEP-13
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u03/oradata/orcl/system01.dbf
restoring datafile 00002 to /u03/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u03/oradata/orcl/sysaux01.dbf.dbf
restoring datafile 00004 to /u03/oradata/orcl/users01.dbf
restoring datafile 00005 to /u03/oradata/orcl/app01.dbf
channel ORA_DISK_1: reading from backup piece /u02/backup/dbf_20130922_0dokfhlq_1_1.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/u02/backup/dbf_20130922_0dokfhlq_1_1.bak tag=TAG20130922T071153
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 22-SEP-13
datafile 1 switched to datafile copy
input datafile copy recid=6 stamp=826791673 filename=/u03/oradata/orcl/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=7 stamp=826791673 filename=/u03/oradata/orcl/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=8 stamp=826791673 filename=/u03/oradata/orcl/sysaux01.dbf.dbf
datafile 4 switched to datafile copy
input datafile copy recid=9 stamp=826791673 filename=/u03/oradata/orcl/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=10 stamp=826791673 filename=/u03/oradata/orcl/app01.dbf
--备注:set newname操作必须放置run{}中处理,不然会提示如下信息:
RMAN> set newname for datafile '/u02/oradata/orcl/system01.dbf' to '/u03/oradata/orcl/system01.dbf';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03031: this option of set command needs to be used inside a run block
--执行完上述步骤后,再跳到sqlplus环境下执行如下脚本
SQL> alter database rename file '/u02/oradata/orcl/redo01.log' to '/u03/oradata/orcl/redo01.log';
Database altered.
SQL> alter database rename file '/u02/oradata/orcl/redo02.log' to '/u03/oradata/orcl/redo02.log';
Database altered.
SQL> alter database rename file '/u02/oradata/orcl/redo03.log' to '/u03/oradata/orcl/redo03.log';
Database altered.
--然后再回到rman执行
--恢复数据库
RMAN> recover database;
Starting recover at 22-SEP-13
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=37
channel ORA_DISK_1: reading from backup piece /u02/backup/arc_20130922_0fokfhnt_1_1.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/u02/backup/arc_20130922_0fokfhnt_1_1.bak tag=TAG20130922T071300
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archive log filename=/u02/archivelog/1_37_826383194.dbf thread=1 sequence=37
unable to find archive log
archive log thread=1 sequence=38
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/22/2013 08:22:05
RMAN-06054: media recovery requesting unknown log: thread 1 seq 38 lowscn 378540
--打开数据库
RMAN> alter database open resetlogs;
database opened
- 利用rman进行异机还原(目录不同)
- 利用rman进行异机还原(目录相同)
- rman异机还原
- rman异机恢复(目录结构不同)
- 利用rman进行完整备份_无恢复目录
- rman单机备份异机还原
- 【rman】异机恢复——目录不同--set newname datafile
- linux下只有rman备份集的异机不同目录恢复
- 利用 RMAN 进行异机全恢复
- 利用RMAN针对同平台下Oracle的实例进行异机迁移
- ------------如何利用日志进行还原-------------
- RMAN还原
- 使用RMAN进行异机恢复
- 直播通过rman将oracle 12c整库全备后进行异机同目录恢复遇到的小坑
- 利用RMAN进行归档日志的删除
- ORACLE RMAN备份及还原 RMAN可以进行增量备份:数据库,表空间,数据文件
- 如何利用数据日志进行数据还原
- RMAN异机不同路径结构Duplicate数据库
- 整理几个常用的Java面试题
- 数位DP 第一题 hdu 2089
- IOS_______99乘法表
- LeetCode | 3Sum Closest
- objective-c 截取字符串 数组 字典…
- 利用rman进行异机还原(目录不同)
- objective-c 一些联系
- objective-c 一些作业
- objective-c 获取时间的方法
- 15位和18位身份证号码的结构介绍
- objective-c 根据身份证 计算出年…
- objective-c 如果使用了release …
- iOS上一种图书翻页效果的实现(Lea…
- objective-c中import与@class的说…