oracle convert a 32-bit database to 64-bit database(32位 转到 64位)说明
oracle数据分32位和64位,对应不同的平台,关于查看db 是32还是64位,我之前的blog 有说明,参考:
查看oracle 是32位还是64位的方法
我们这里说的32位和64位就是wordsize。 在某些情况下,比如数据迁移时,需要从32位的oracle 迁移到64位的oracle上,这时候就需要修改wordsize,使他们保持一致。
这里我们假设迁移平台的endian 格式相同,不同的操作系统对应的endian也是不一样的。 这里不做过多的说明,这部分内容属于跨操作系统迁移部分,会单独进行说明。
mos 上有几篇关于修改wordsize的文章:
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]
这里我们看一下[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:
--以下的操作过程支持linux下的oracle 9ir2,10g和11g 单实例32到64的转换操作。注意这里数据库的版本要一致,仅wordsize 不一样。
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.
--冷备份整个db,以防修改wordsize失败。
2. note:this steps is required ifthe target system has different directory structure for database files.otherwise this step can be skipped.
--这一步操作仅当target system 的目录结构和source 不一样,如果一样,这一步可以跳过。
to help withcreating the control file after the wordsize change, enter the following sqlcommand:
sql> alterdatabase backup controlfile to trace;
--将控制文件dump 到trace file,已方便我们后面的修改。
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.
--在新的系统上安装64位的oracle 软件,建议使用的版本和之前的32位oracle 保持一致。
4. perform a clean databaseshutdown for oracle-32 bit database
--clean shutdown 32位的oracle。
当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.
--复制所有的datafiles 从32位系统到64位系统上。
6. copy your existing oracleinitialization parameter file (initsid.ora) to the new oracle home.
--复制初始化参数(pfile)到64位系统上对应的目录,默认是$oracle_home/dbs
7. edit the parameter file topoint to the controlfiles if the location has change from the source machine.
--编辑pfile 文件,修改控制文件的保存位置。
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
--修改pfile里的其他参数,,比如user_dump_dest,background_dump_dest,core_dump_dest 等。