transport database between diffrent platform

transport datase between diffrent os platform linux to windos

1.open source database song on linux platform read only:
SQL> startup mount
ORACLE instance started.

Total System Global Area 494927872 bytes
Fixed Size 1220192 bytes
Variable Size 167772576 bytes
Database Buffers 322961408 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database open read only;

Database altered.
2.support platform list:
source database platform information:
SQL> select platform_name from v$database;

PLATFORM_NAME
--------------------------------------------------------------------------------
Linux IA (32-bit)


SQL> select platform_name from v$transportable_platform;

PLATFORM_NAME
--------------------------------------------------------------------------------
Solaris[tm] OE (32-bit)
Solaris[tm] OE (64-bit)
Microsoft Windows IA (32-bit)
Linux IA (32-bit)
AIX-Based Systems (64-bit)
HP-UX (64-bit)
HP Tru64 UNIX
HP-UX IA (64-bit)
Linux IA (64-bit)
HP Open VMS
Microsoft Windows IA (64-bit)

PLATFORM_NAME
--------------------------------------------------------------------------------
IBM zSeries Based Linux
Linux 64-bit for AMD
Apple Mac OS
Microsoft Windows 64-bit for AMD
Solaris Operating System (x86)
IBM Power Based Linux

17 rows selected.


3.call dbms_tdb to check if the source database can be transportable or not:

SQL> l
1 declare
2 b boolean;
3 begin
4 b:= dbms_tdb.check_db('Microsoft Windows IA (32-bit)');
5 if b then dbms_output.put_line('yes');
6 ELSE
7 DBMS_OUTPUT.PUT_LINE('no');
8 end if;
9* end;
SQL> /
yes

PL/SQL procedure successfully completed.

4.using rman to generate script and convert source database datafiles to conform the target databasae platform:
[oracle@linux ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Sat Dec 22 17:28:13 2007

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

connected to target database: SONG (DBID=562708601)

RMAN> convert database transport script 'crdb.sql' new database 'song_new' to platform 'Microsoft Windows IA (32-bit)' format '/oracle/%U';

Starting convert at 22-DEC-07
using channel ORA_DISK_1

External table SH.SALES_TRANSACTIONS_EXT found in the database

Directory SYS.DATA_PUMP_DIR found in the database
Directory SYS.SUBDIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.LOG_FILE_DIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.WORK_DIR found in the database
Directory SYS.ADMIN_DIR found in the database

BFILE PM.PRINT_MEDIA found in the database

User SYS with SYSDBA and SYSOPER privilege found in password file
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00001 name=/database/SONG/system01.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-SYSTEM_FNO-1_07j48nre
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:03:20
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00003 name=/database/SONG/sysaux01.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-SYSAUX_FNO-3_08j48o1n
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00005 name=/database/SONG/example01.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-EXAMPLE_FNO-5_09j48o3e
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00006 name=/database/SONG/testtbs.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-TESTTBS_FNO-6_0aj48o3u
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00002 name=/database/SONG/undotbs01.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-UNDOTBS1_FNO-2_0bj48o4o
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00004 name=/database/SONG/users01.dbf
converted datafile=/oracle/data_D-SONG_I-562708601_TS-USERS_FNO-4_0cj48o70
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Run SQL script /oracle/crdb.sql on the target platform to create database
Edit init.ora file /oracle/init_00j48nrc_1_0.ora. This PFILE will be used to create the database on the target platform
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform
To change the internal database identifier, use DBNEWID Utility
Finished backup at 22-DEC-07

5.Ship all the data files, the pfile, and the scripts to the target platform.

6.edit initilization parameter file and edit crdb.sql script to confrom the new database;

7.using oradim to create new service for the target database on windows platform
oradim -new -sid songnew -pfile d:song_newdbinitsongnew.ora

8.using sqlplus to run script crdb.sql create controlfile, online redo logfiles and include datafiles;
E:oracleproduct10.2.0db_1BIN>sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 12月 22 18:43:29 2007

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

请输入用户名: / as sysdba

连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options

SQL> select instance_Name from v$instance;

INSTANCE_NAME
----------------
songnew


SQL>
SQL> select dbid,name from v$database;

DBID NAME
---------- ---------
562708601 SONGNEW

same with the linux platform database.
SQL>
9.using newdbid to generate new dbid
SQL> startup mount
ORACLE 例程已经启动。

Total System Global Area 494927872 bytes
Fixed Size 1249776 bytes
Variable Size 167775760 bytes
Database Buffers 322961408 bytes
Redo Buffers 2940928 bytes
数据库装载完毕。
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options 断开

E:oracleproduct10.2.0db_1BIN>nid target=/ dbname=songnew1

DBNEWID: Release 10.2.0.1.0 - Production on 星期六 12月 22 19:27:54 2007

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

已连接数据库 SONGNEW (DBID=562708601)

已连接服务器版本 10.2.0

数据库中的控制文件数:
D:SONG_NEWDBCONTROL01.CTL

是否将数据库 ID 和数据库名 SONGNEW 更改为 SONGNEW1? (Y/[N]) => y

操作继续进行
将数据库 ID 从 562708601 更改为 2259020539
将数据库名从 SONGNEW 更改为 SONGNEW1
控制文件 D:SONG_NEWDBCONTROL01.CTL - 已修改
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-SYSTEM_FNO-1_07J48NRE - db
id 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-UNDOTBS1_FNO-2_0BJ48O4O -
dbid 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-SYSAUX_FNO-3_08J48O1N - db
id 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-USERS_FNO-4_0CJ48O70 - dbi
d 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-EXAMPLE_FNO-5_09J48O3E - d
bid 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_I-562708601_TS-TESTTBS_FNO-6_0AJ48O3U - d
bid 已更改, 已写入新名称
数据文件 D:SONG_NEWDBDATA_D-SONG_NEW_I-562708601_TS-TEMP_FNO-1_00J48NRC -
dbid 已更改, 已写入新名称
控制文件 D:SONG_NEWDBCONTROL01.CTL - dbid 已更改, 已写入新名称
实例关闭

数据库名已更改为 SONGNEW1。
修改参数文件并在重新启动前生成新的口令文件。
数据库 SONGNEW1 的数据库 ID 已更改为 2259020539。
此数据库的所有以前的备份和归档重做日志均不可用。
数据库已关闭, 用 RESETLOGS 选项打开数据库。
已成功更改数据库名和 ID。
DBNEWID - 已成功完成。

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/94166/viewspace-995462/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/94166/viewspace-995462/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值