主环境 aix 5.3+oracle 10.2.0.4
目标环境 aix 5.3+oracle 10.2.0.4
利用rman迁移裸设备到文件系统 主要有以下步骤:
主环境备份脚本
run
{
allocate channel c1 type disk maxpiecesize 20G;
backup format '/orabak/15_set/full_%s_%p_%t' database;
backup current controlfile format '/orabak/15_set/control_%s_%p_%t';
release channel c1;
}
目标环境做restore
1.建立oracle用户和存放oracle软件目录,设置好环境变量
2.安装oracle软件,并且升级到10.2.0.4
3.从主库生成pfile脚本放到目标环境中,修改相关pfile参数,比如相关内存参数、dump存放路径,控制文件存放路径等
这里控制文件存放路径为
/orabakold/crm_cont01 /orabakold/crm_cont02 /orabakold/crm_cont03
4.建立实例对应admin下的trace目录,有以下这些:
ORACLE_BASE/admin/ORACLE_SID/bdump
ORACLE_BASE/admin/ORACLE_SID/cdump
ORACLE_BASE/admin/ORACLE_SID/adump
ORACLE_BASE/admin/ORACLE_SID/udump
5.用orapwd建立密码文件
6.用修改后的pfile sqlplus 启动到nomount状态
7.用rman登录,恢复控制文件
RMAN> restore controlfile from '/oracle/control_186_1_720930534';
Starting restore at 06-JUN-10
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output filename=/orabakold/crm_cont01
output filename=/orabakold/crm_cont02
output filename=/orabakold/crm_cont03
Finished restore at 06-JUN-10
8.把数据库启动到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
9.恢复数据文件,脚本有对数据文件命名的操作,是从raw到文件系统的
RMAN> run{
allocate channel t1 type disk;
allocate channel t2 type disk;
set newname for datafile '/dev/rcrm_data01' to '/DBUrgent/oradata/crm_data011.dbf';
set newname for datafile '/dev/rcrm_data07' to '/DBUrgent/oradata/crm_data017.dbf';
set newname for datafile '/dev/rcrm_data08' to '/DBUrgent/oradata/crm_data018.dbf';
set newname for datafile '/dev/rcrm_systemlv' to '/orabakold/oradata/crm_data01167.dbf';
set newname for datafile '/dev/rcrm_undo01lv' to '/orabakold/oradata/crm_data01168.dbf';
set newname for datafile '/dev/rcrm_undo02lv' to '/orabakold/oradata/crm_data01169.dbf';
restore database;
switch datafile all;
release channel t1;
release channel t2;
}
10.介质恢复
recover database;
11.用resetlogs方式打开数据库
alter database open resetlogs;
12.迁移临时数据文件到文件系统,可以先删除后添加
13.迁移redo到文件系统,可以删除后添加
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-664749/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7199859/viewspace-664749/