四、用rman做迁移: rman比较适合于跨文件系统的迁移,如同平台下的不同文件系统。 操作方法: 1.停第三方的归档备份,如legato或dp 2.backup数据库: run { allocate channel t1 type disk; backup full format '$DIR_BAK/UNDOTBS1_2_%d_%s_%p.bak' dataf...
显示全部
四、用rman做迁移:
rman比较适合于跨文件系统的迁移,如同平台下的不同文件系统。
操作方法:
1.停第三方的归档备份,如legato或dp
2.backup数据库:
run {
allocate channel t1 type disk;
backup full format '$DIR_BAK/UNDOTBS1_2_%d_%s_%p.bak' datafile 2;
……
release channel t1;
}
3.备份控制文件alter database backup controlfile to '/tmp/mydb.ctl';并到新数据库用rman恢复:restore controlfile from '/arch/sd168.ctl';
4.restore备份文件:
run {
allocate channel t1 type disk;
restore datafile 2;
releasechannel t1;
}
5.传归档日志,并且对归档进行做recover:recover database until sequence = 归档的序号 thread = 1;
6.对数据库open resetlogs:RMAN>sql 'alter database open resetlogs';
7.alter tablespace temp add tempfile 'XXXXXX' size XXM reuse;
优缺点:优点是可以跨文件系统,停机时间少。缺点是要时刻关注这归档日志,做recover的时候一个都不能少!
收起