(1)全库传输要求
1 Character Set、National Character Set必须完全相同
2 版本一致
a.在源端转换
1.准备传输数据库,源数据库必须以只读方式打开.
shutdown immediate;
startup open read only;
2.使用DBMS_TDB.CHECK_DB检查数据库状态.
declare
b_support boolean;
begin
b_support := dbms_tdb.check_db('Linux x86 64-bit', 0);
dbms_output.put_line(case b_support when true then 'support' else 'nonsupport' end);
end;
/
返回的是 support,其中 Linux x86 64-bit 是从如下查询获得
select platform_name,ENDIAN_FORMAT from v$transportable_platform order by platform_name;
我们试一下 IBM Power Based Linux
declare
b_support boolean;
begin
b_support := dbms_tdb.check_db('IBM Power Based Linux', 0);
dbms_output.put_line(case b_support when true then 'support' else 'nonsupport' end);
end;
/
返回了 nosupport ,看来 little 与 big 之间是不可以传输的,据说11r2 以上版本支持,先留下个悬念吧.
3.使用DBMS_TDB.CHECK_EXTERNAL标识外部对象.
declare
b_external boolean;
begin
b_external := dbms_tdb.check_external;
end;
/
The following directories exist in the database:
SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR, SYS.XMLDIR
4.开始转换数据库(源库)
convert database new database mmtest transport script 'e:\out\trans.sql' to platform 'Linux x86 64-bit' db_file_name_convert 'E:\APP\ADMINISTRATOR\ORADATA\LLTEST\','E:\out\';
rman target / 执行上面命令
检查 e:\out\ 下的文件
5.处理脚本/pfile/密码文件
5.1 查看trans.sql内容,将windows的文件结构,比如 e:\xxx ,均修改为 linux 文件目录结构 /u01/xxx
5.2 修改pfile 文件,并传输到 linux 主机,并将 pfile 中的windows的文件结构,比如 e:\xxx ,均修改为 linux 文件目录结构 /u01/xxx
6.运行trans.sql 脚本(目标库)
6.1 STARTUP NOMOUNT PFILE='/u01/mmtest/pfile.ora'
6.2 @trans.sql
b. 在目标端转换
在源端转换即可,无须在目标端设置