由于涉及的业务数据库容量动辄几百G,且停机时间有限(不超过4小时),因此迁移方案的核心在于如何用最短的时间和最安全可控的步骤来完成这次迁移。
在高可用迁移案例中,最糟糕的情况莫过于跨OS的数据库迁移(非异构,排除字符集不同的情况,比如Linux->UNiX,Windows->Unix),除了可借助一些oracleAQ和Streams来完成高可用同步和迁移外,并没有更好的处理办法(Dataguard无从发挥作用,诸如transporttablespace等手段对一个跨os的大容量的迁移项目也几乎鸡肋,实际中根本无法承受转换数据文件类型所带来的时间损耗)。但Streams等方案太过于繁琐,需要有审慎周密的迁移步骤和考虑。当然,借助于三方工具可以完成诸多海量迁移(如DSG/SharePlex等),但出于成本和其他因素,并不是每个迁移用户都有选择的余地.
话题转到开篇的迁移情况,由于只是OS位数和Oracle版本/位数的转换,所以情况并非那么悲观。Oracle本身也提供了脚本,用来支持在32位和64位之间做互相转换(rdbms/admin/utlirp.sql,这种转换是双向的).那么重点问题在于如何在停机之前将32位os上的32位db与64位os上的64位db做同步,因为不可能停库以后才去将32bit os上datafile文件copy到64bitos上,如此数据量,光copy文件的时间就无法接受。能想到的最简单的同步办法,莫过于dataguard了.
因此整个迁移方案雏形形成,新增一台设备,安装linux 64bit的os,部署2套Oracle版本,一套Oracle9i(版本对应待升级源库版本,作为待升级源库的standby端做日志同步),另一套Oracle 64bit10.2.0.4(用来做最终的升级版本).
如此一来,整个迁移步骤就比较明了了。停库升级之前,做好主备的dataguard同步.待升级时刻,停主库,备库做failove切换,然后在新主库上做一系列数据字典升级和位数转换工作.跨版本的升级和位数转换过程,可以参考Metalink ID 62290.1(该文档并没有提及跨大版本升级的位数转换,但实际测试中9i 32bit 升级到10g 64bit依然可行)
特别提出:Metalink ID 62290.1提出32bit与64bit区别仅仅在于PL/SQL的编译格式不同,而且,一般的版本升级/降级过程会自动进行位数的转换。
The on-disk format for database data, redo, and undo isidentical for the 32-bit and 64-bit installations of Oracle. The onlyinternal structural differences between the 32-bit and 64-bit Oracleinstallations are the following:
The compiled format of PL/SQL is different. The instructions for howand when to recompile PL/SQL are provided in the appropriate chaptersof the Migration book. The storage format of user-defined types isbased on the release of Oracle that created the database. The existingstorage format will be converted to the correct format transparentlywhen necessary. User-defined types include object types, REFs, varrays,and nested tables.
If you are changing word-size during a migration,upgrade, or downgrade operation then no additional action is required.The word-size is changed automatically during any of these operations