Oracle数据分32位和64位,对应不同的平台,关于查看DB 是32还是64位,我之前的Blog 有说明,参考:
查看Oracle 是32位还是64位的方法
在某些情况下,比如数据迁移时,需要从32位的Oracle 迁移到64位的oracle上,这时候就需要修改wordsize,使他们保持一致。
这里我们假设迁移平台的ENDIAN 格式相同,不同的操作系统对应的ENDIAN也是不一样的。 这里不做过多的说明,这部分内容属于跨操作系统迁移部分,会单独进行说明。
changing between 32-bit and 64-bit wordsizes [id 62290.1]
How To Change Oracle 11g Wordsize from32-bit to 64-bit. [ID 548978.1]
How to Convert a 32-bit Database to 64-bitDatabase on Linux? [ID 341880.1]
use thefollowing procedure to change wordsize of an oracle9i release 2 (9.2) ororacle10g (10.1 & 10.2) or 11g single instance database from linux x86 tolinux x86-64 in same release:
1. perform cold backups of theexisting oracle9i or oracle10g (10.1.x & 10.2.x) or 11g database on thelinux x86 system to protect against any failures during the wordsize change.
2. NOTE:This steps is required ifthe target system has different directory structure for database files.Otherwise this step can be skipped.
To help withcreating the control file after the wordsize change, enter the following SQLcommand:
SQL> ALTERDATABASE BACKUP CONTROLFILE TO TRACE;
Oracle 控制文件
This command saves the control file information to a trace file in the UDUMP directory (Typeshow parameter USER_DUMP_DEST in SQLPLUS as sys/system user). The control fileinformation is similar to the following:
CREATECONTROLFILE REUSE DATABASE "SAMPLE" NORESETLOGS
NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 32
MAXINSTANCES 1
MAXLOGHISTORY 112
LOGFILE
GROUP1 '/ia32lnx_path/oracle/dbs/t_log1.f' SIZE 25M,
GROUP2 '/ia32lnx_path/oracle/dbs/t_log2.f' SIZE 25M
DATAFILE '/ia32lnx_path/oracle/dbs/t_DB1.F'
CHARACTER SET WE8DEC;
3. In a new Oracle home, installthe 64-Bit release of Oracle9i Release 2 (9.2.x) , Oracle10.1.x, Oracle 10.2.x,Oracle 11.1.x, 11.2.x software for Linux x86-64. It is recommended to usethe same version on as on the 32-Bit box.
4. Perform a clean databaseshutdown for Oracle-32 Bit database
当clean shutdown 时,checkpoint会进行,并且此时datafile的stop scn和控制文件里的start scn会相同。 等到open数据库时,Oracle检查datafile header中的start scn和存于control file中的datafile的scn是否相同, 如果相同,接着检查start scn和stop scn是否相同,如果仍然相同,数据库就会正常开启,否则就需要recovery。
等到数据库开启后,储存在control file中的stop scn就会恢复为NULL值,此时表示datafile是open在正常模式下了。
更多信息参考:
Oracle 实例恢复时 前滚(roll forward) 后滚(rollback) 问题
5. Copy the database files fromLinux-x86 to the Linux x86-64 system.
6. Copy your existing Oracleinitialization parameter file (initsid.ora) to the new Oracle home.
7. Edit the parameter file topoint to the controlfiles if the location has change from the source machine.
8. Change any Oracle home pathreferences to use the new Oracle home path on the Linux x86-64 system. Likeuser_dump_dest , background_dump_dest , core_dump_dest etc