基于Linux同平台同版本数据库下的rman异机迁移(第一部分)
概述
最近在测试一个从winserver到Linux用rman迁移的案例,可惜试了几次都没成功,官网也说有可能触发bug,毕竟跨平台也跨版本了,所以先放弃,然后整理了下载Linux平台同个数据库版本rman迁移的实验。下面介绍下实验的过程。
环境
同个平台还是容易很多的,Linux到windows也还好,但是windows到Linux容易出bug。
In versionsprevious to 10g the only option to migrate from one platform to another wasusing export / import. With 10g, using the RMAN convert commands, you can crossbetween platforms using the 10g Cross-Platform Transportable Tablespacesoption.

一、source数据库准备
1.获取数据文件编号和路径
SQL> select file_id,file_name from dba_data_files order by file_id;

2.获取临时文件编号和路径
SQL> select file#, name from v$tempfile;

3.获取在线日志文件组和路径
SQL> select group#,member from v$logfile;

4.获取数据库字符编码
SQL> select * from nls_database_parameters ;

其中:
- 1. Language: 指定服务器消息的语言, 影响提示信息是中文还是英文
- 2. Territory: 指定服务器的日期和数字格式,
- 3. Charset: 指定字符集。
5.获取数据库SID

二、source数据库备份
1. rman备份脚本
run {
sql 'alter system archive log current';
allocate channel c1 type disk;
allocate channel c2 type disk;
backup as compressed backupset
tag full_backup_level0
incremental level 0
format '/backup/oradata/level0_%T_%t_s%s_p%p.bak' database;
sql 'alter system archive log current';
backup as compressed backupset format '/backup/arch/archlog_%T_t%t_s%s_p%p.bak' archivelog all delete input;
release channel c1;
release channel c2;
allocate channel d1 type disk;
backup
format '/backup/control/controlfile_%T_s%s_p%p.bak'
current controlfile;
crosscheck backup;
crosscheck copy;
delete noprompt expired backup;
delete noprompt obsolete;
release channel d1;
}2.备份文件

3.传到另外一台服务器
这里如果有开策略可以通过scp命令直接传过去。
注意:备份的文件最好是放在同个目录,后面容易恢复。
篇幅有限,这里主要介绍前面的准备工作及rman备份部分,接下来主要介绍rman恢复方面的内容,感兴趣的朋友可以关注一下~
