通过RMAN远程复制数据库到异机 不过失败了。

Posted on 2010-01-28 13:04  blackcat  阅读(794)  评论(0编辑  收藏  举报

需要把我的测试数据库给一个同事复制一份,数据库一共600G,但是我的数据库不能停机,故通过Rman来做这件事情。

以下是记录:

 

 

Rman 异机恢复过程

1 基础配置
Src OS
Redhat As4 x86_64 8G memory
Oracle 10g R2 x86_64
4T 硬盘

Dest OS
Oracle Enterprise Linux5 x86
Oracle10g R2 x86
800 g硬盘

数据库文件大小:
[oracle@localhost o10g]$ du -h
613G

想过冷备份恢复,但是由于要停止Src的Oracle服务,等数据拷贝完成,这个时间代价有点大,故考虑使用RMAN。
同时不知道冷备份的情况,是否支持64位和32位之间的数据转换。

2 操作过程

2.1 通过Rman备份

Src OS 配置NFS服务,
/etc/exports
/nfs
Dest OS 配置NFS client
也挂在/nfs下

在Src端,
rman target=/

RMAN> run
{allocate channel d1 type disk maxpiecesize = 10g;
backup full database
format '/nfs/db_%d_%s_%p_%t';
release channel d1;
}
然后坐等数据备份,估计要半天时间吧。

然后备份归档
backup archivelog all format '/nfs/arc_%U.bak' delete input;

Starting backup at 27-JAN-10
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=667 recid=1 stamp=709400786
input archive log thread=1 sequence=668 recid=2 stamp=709400844
channel ORA_DISK_1: starting piece 1 at 27-JAN-10
channel ORA_DISK_1: finished piece 1 at 27-JAN-10
piece handle=/nfs/arc_0cl4h68c_1_1.bak tag=TAG20100127T154724 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u01/oracle/product/10.2.0/flash_recovery_area/O10G/archivelog/2010_01_27/o1_mf_1_667_5ozvtgor_.arc recid=1 stamp=709400786
archive log filename=/u01/oracle/product/10.2.0/flash_recovery_area/O10G/archivelog/2010_01_27/o1_mf_1_668_5ozvwdbt_.arc recid=2 stamp=709400844
Finished backup at 27-JAN-10

备份控制文件:
copy current controlfile to '/nfs/control_bak.ctl';

2.2 恢复过程
在Dest端,修改Oracle home,sid等变量
先创建密码文件
cd $ORACLE_HOME/dbs
cp /nfs/inito10g.ora ./
修改inito10g.ora文件,主要是文件路径映射,其次就是内存参数 sga和pga,都要符合Dest机器设置

把备份的controlfile复制到合适的路径。合适是指,和你的pfile一致。
[oracle@localhost admin]$ cp /nfs/control_bak.ctl /opt/oracle/oradata/o10g/control01.ctl
[oracle@localhost admin]$ cp /nfs/control_bak.ctl /opt/oracle/oradata/o10g/control02.ctl
[oracle@localhost admin]$ cp /nfs/control_bak.ctl /opt/oracle/oradata/o10g/control03.ctl

使用sqlplus 连接到Oracle
[oracle@localhost oracle]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 27 16:16:10 2010

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

SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup mount;
ORA-00374: parameter db_block_size = 32768 invalid ; must be a multiple of 512 in the range [2048..16384]

天,原始库是64位的,我考虑OLAP的特征,给他32K的blocksize,这回找死了。
先找找答案。

找到了继续更新
 

Copyright © 2024 blackcat
Powered by .NET 8.0 on Kubernetes