ITPub博客

首页 > 数据库 > Oracle > rman 异地恢复

rman 异地恢复

原创 Oracle 作者:jetgm 时间:2019-06-18 17:09:06 0 删除 编辑

$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/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ORA-16038的解决(zt)
请登录后发表评论 登录
全部评论

注册时间:2002-02-06

  • 博文量
    44
  • 访问量
    34318