Oracle RMAN 跨平台恢复测试(Windows-Linux)

php中文网
发布: 2016-06-07 17:30:21
原创
1414人浏览过

原数据库为ORACLE11G 11.2.0.3,跑在64位WINDOWS上,使用RMAN做了个备份,将备份文件上传到Linux服务器上的/home/oracle/rmanbac

原数据库为oracle11g 11.2.0.3,跑在64位windows上,使用rman做了个备份,将备份文件上传到linux服务器上的/home/oracle/rmanbackup目录中,准备恢复到64位linux上,过程如下:

将数据库启动到nomount状态

oracle@changeme:~> sqlplus /nolog
SQL> conn / as sysdba
SQL> startup nomount
SQL> exit

进入RMAN进行恢复

oracle@changeme:~> rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 29 17:39:40 2013

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

connected to target database: CSDB (not mounted)

RMAN> set DBID=3039653104

executing command: SET DBID


RMAN> restore controlfile from '/home/oracle/rmanbackup/CTL_0FODDSB1_20130629';

Starting restore at 29-JUN-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/csdb/control01.ctl
Finished restore at 29-JUN-13

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> catalog start with '/home/oracle/rmanbackup';

Starting implicit crosscheck backup at 29-JUN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 29-JUN-13

Starting implicit crosscheck copy at 29-JUN-13
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 29-JUN-13

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /home/oracle/rmanbackup

List of Files Unknown to the Database
=====================================
File Name: /home/oracle/rmanbackup/ARCH_0GODDSKM_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629
File Name: /home/oracle/rmanbackup/CTL_0FODDSB1_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0EODDSAQ_20130629

秘塔写作猫
秘塔写作猫

秘塔写作猫是一个集AI写作、校对、润色、配图等为一体的创作平台

秘塔写作猫 127
查看详情 秘塔写作猫

Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /home/oracle/rmanbackup/ARCH_0GODDSKM_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629
File Name: /home/oracle/rmanbackup/CTL_0FODDSB1_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0EODDSAQ_20130629

 

RMAN> run{
2> allocate channel c1 type disk;
3> set newname for datafile 1 to '/u01/app/oracle/oradata/csdb/system01.dbf';
4> set newname for datafile 2 to '/u01/app/oracle/oradata/csdb/sysaux01.dbf';
5> set newname for datafile 3 to '/u01/app/oracle/oradata/csdb/undotbs1.dbf';
6> set newname for datafile 4 to '/u01/app/oracle/oradata/csdb/users01.dbf';
7> set newname for datafile 5 to '/u01/app/oracle/oradata/csdb/example01.dbf';
8> set newname for datafile 6 to '/u01/app/oracle/oradata/csdb/undotbs2.dbf';
9> set newname for datafile 7 to '/u01/app/oracle/oradata/csdb/testtbs01.dbf';
10> restore database;
11> switch datafile all;
12> release channel c1;
13> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=134 device type=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 29-JUN-13

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /u01/app/oracle/oradata/csdb/system01.dbf
channel c1: restoring datafile 00002 to /u01/app/oracle/oradata/csdb/sysaux01.dbf
channel c1: restoring datafile 00003 to /u01/app/oracle/oradata/csdb/undotbs1.dbf
channel c1: restoring datafile 00004 to /u01/app/oracle/oradata/csdb/users01.dbf
channel c1: restoring datafile 00005 to /u01/app/oracle/oradata/csdb/example01.dbf
channel c1: restoring datafile 00006 to /u01/app/oracle/oradata/csdb/undotbs2.dbf
channel c1: restoring datafile 00007 to /u01/app/oracle/oradata/csdb/testtbs01.dbf
channel c1: reading from backup piece /home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629
channel c1: piece handle=/home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629 tag=DB_INCR0
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:25
Finished restore at 29-JUN-13

datafile 1 switched to datafile copy
input datafile copy RECID=15 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=16 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=17 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=18 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=19 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=20 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/undotbs2.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=21 STAMP=819395669 file name=/u01/app/oracle/oradata/csdb/testtbs01.dbf

released channel: c1

RMAN> run{
2> allocate channel ch1 type disk;
3> recover database;
4> release channel ch1;
5> }

allocated channel: ch1
channel ch1: SID=134 device type=DISK

Starting recover at 29-JUN-13

starting media recovery

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号