rman 异地恢复

$ORACLE_SID=prod1

$rman

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/data1/app/oracle/oracle/product/10.2.0/db_1/dbs/initprod1.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 2019224 bytes
Variable Size 67108968 bytes
Database Buffers 83886080 bytes
Redo Buffers 6369280 bytes

RMAN> set dbid 1826890219

executing command: SET DBID

RMAN> restore spfile from '/data0/rman/c-1826890219-20080710-01';

Starting restore at 11-JUL-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

channel ORA_DISK_1: autobackup found: /data0/rman/c-1826890219-20080710-01
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 11-JUL-08

RMAN> shutdown immediate

Oracle instance shut down

[oracle@localhost prod1]$ ORACLE_SID=prod1
[oracle@localhost prod1]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 11 15:57:28 2008

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

idle> conn / as sysdba
Connected to an idle instance.
idle> create pfile='/data1/app/oracle/admin/prod1/pfile/initprod1.ora' from spfile;
ERROR:
ORA-01034: ORACLE not available

File created.

idle> exit
Disconnected

修改 pfile里所有相关路径

idle> create spfile from pfile='/data1/app/oracle/admin/prod1/pfile/initprod1.ora';

RMAN> set dbid 1826890219

executing command: SET DBID

RMAN> startup nomount

Oracle instance started

Total System Global Area 167772160 bytes

Fixed Size 2019288 bytes
Variable Size 79691816 bytes
Database Buffers 79691776 bytes
Redo Buffers 6369280 bytes

RMAN> restore controlfile from '/data0/rman/c-1826890219-20080710-01';

Starting restore at 11-JUL-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/data0/oracle/oradata/prod1/control01.ctl
output filename=/data0/oracle/oradata/prod1/control02.ctl
output filename=/data0/oracle/oradata/prod1/control03.ctl
Finished restore at 11-JUL-08


RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> Run{
Set newname for datafile '/var/oradata/prod1/system01.dbf' to '/data0/oracle/oradata/prod1/system01.dbf';
Set newname for datafile '/var/oradata/prod1/undotbs01.dbf' to '/data0/oracle/oradata/prod1/undotbs01.dbf';
Set newname for datafile '/var/oradata/prod1/sysaux01.dbf' to '/data0/oracle/oradata/prod1/sysaux01.dbf';
Set newname for datafile '/var/oradata/prod1/users01.dbf' to '/data0/oracle/oradata/prod1/users01.dbf';
Set newname for datafile '/var/oradata/prod1/test01.dbf' to '/data0/oracle/oradata/prod1/test01.dbf';
restore database ;
switch datafile all;}


RMAN> recover database;

RMAN> alter database open resetlogs;

如果是相同os不同位的恢复需要重新编译
64bit to 32bit
you are seeing this error because plsql code is still in 64bit wordsize, do the following step to recomp all objects

SQL> startup restrict
SQL> @?/rdbms/admin/utlip.sql
SQL> @?/rdbms/admin/utlrp.sql

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6456/viewspace-1007253/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/6456/viewspace-1007253/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值