ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 转载-大意升级32位9i到64位9i,警钟啊!

转载-大意升级32位9i到64位9i,警钟啊!

原创 Linux操作系统 作者:jj_thizlinux 时间:2009-04-01 09:19:14 0 删除 编辑
64位oracle9208 升级绝处逢生记!

9208升级绝处逢生记!

发此贴目的是提醒大家别再犯同样的错误,同时给出32位转到64位的方法:
1.升级之前的检查要仔细认真,不应该想当然,有条件做备份一定要做备份。
2.同平台32为数据库升级到64位的可行性。
3.opatch失败的原因,tar过来的软件要注意修改几个地方。


平台:solaris9i+oracle9201(32)
目标:solaris9i+oracle9208(64)

按道理,升级是很轻松的事情,以前也做过升级,而且以前的升级还多了停起HA操作,不过这次没有涉及HA。

至于升级的原因就不必细说,主要是为了在最重要的生产库升级前做个测试,当前的库也是承担着统计查询的工作,好处是允许的停机恢复时间可以比较长(1-2天)。


升级前的准备无非就是看看数据库版本,操作系统版本等等。
仅仅因为这么轻易的一句话,差点就把数据库废了。
自己想当然的以为数据库是oracle64位for solaris的(不知道当初谁装了32的oracle,晕死)。因为目前生产库的都是64位的。

这就是恶梦的开始,上传了oracle9208 64位for solaris的补丁和一些opatch小补丁。

正规的升级操作,必须要先做一下备份,但是由于当前库的大小200G,剩余空间不够,而且感觉出问题的几率极小,所以就没有做备份了。

接着按照正常升级步骤进行。
解压补丁包.
停监听,停库
$ ps -ef|grep oracle  (确认没有了oracle的进程)
$ cd /opt/oracle/9208/Disk1/response                       
$ ./runInstaller -silent -responseFile /opt/oracle/9208/Disk1/response/update.rsp
修改了相应的参数:
UNIX_GROUP_NAME="dba"
FROM_LOCATION="/rdata/software/oracle9208/p1/Disk1/stage/products.xml"
ORACLE_HOME="/rdata/oracle/product/9.2.0"
ORACLE_HOME_NAME="oracle"


20分钟后,升级完成,但发现有错:
$ grep Error installActions2008-12-08_02-06-00PM.log|more
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/network/lib/ins_net_client.mk'. S
ee '/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/network/lib/ins_net_server.mk'. S
ee '/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/network/lib/ins_net_server.mk'. See '/rdata/oracle/
app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/otrace/lib/ins_otrace.mk'. See '/
rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/otrace/lib/ins_otrace.mk'. See '/rdata/oracle/app/o
racle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'ioracle' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rd
ata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'ioracle' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rdata/oracle/app/ora
cle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rd
ata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rdata/oracle/app/ora
cle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/ctx/lib/ins_ctx.mk'. See '/rdata/
oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/ctx/lib/ins_ctx.mk'. See '/rdata/oracle/app/oracle/
oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'ihsodbc' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rd
ata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'ihsodbc' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rdata/oracle/app/ora
cle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'toolsinstall hragentinstall' of makefile '/rdata/oracle/product/9.2.0/ldap/lib/ins_
ldap.mk'. See '/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'toolsinstall hragentinstall' of makefile '/rdata/oracle/product/9.2.0/ldap/lib/ins_ldap.mk'. See '/rd
ata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/network/lib/ins_oemagent.mk'. See
'/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/network/lib/ins_oemagent.mk'. See '/rdata/oracle/ap
p/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
*** Error code 1
Exception String: Error in invoking target 'install_isqlplus install' of makefile '/rdata/oracle/product/9.2.0/sqlplus/lib/ins_
sqlplus.mk'. See '/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install_isqlplus install' of makefile '/rdata/oracle/product/9.2.0/sqlplus/lib/ins_sqlplus.mk'. See '
/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'utilities' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/
rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'utilities' of makefile '/rdata/oracle/product/9.2.0/rdbms/lib/ins_rdbms.mk'. See '/rdata/oracle/app/o
racle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'relink' of makefile '/rdata/oracle/product/9.2.0/precomp/lib/ins_precomp.mk'. See '
/rdata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'relink' of makefile '/rdata/oracle/product/9.2.0/precomp/lib/ins_precomp.mk'. See '/rdata/oracle/app/
oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
*** Error code 1
Exception String: Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/plsql/lib/ins_plsql.mk'. See '/rd
ata/oracle/app/oracle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.
Error in invoking target 'install' of makefile '/rdata/oracle/product/9.2.0/plsql/lib/ins_plsql.mk'. See '/rdata/oracle/app/ora
cle/oraInventory/logs/installActions2008-12-08_02-06-00PM.log' for details.

确定升级完一定要检查日志看看是否有错。

这种错误明显是编译错误,很奇怪,没理由啊。系统补丁包什么都有啊。
$ pkginfo -i SUNWbtool SUNWtoo SUNWsprot SUNWarc SUNWlibm SUNWlibms
system      SUNWarc        Archive Libraries
system      SUNWbtool      CCS tools bundled with SunOS
system      SUNWlibm       Forte Developer Bundled libm
system      SUNWlibms      Forte Developer Bundled shared libm
system      SUNWsprot      Solaris Bundled tools
system      SUNWtoo        Programming Tools

见鬼了,以前这种错误在AIX上见过,原因是包没打,如:
bos.adt.base
bos.adt.lib
bos.adt.libm

但solaris上打补丁报这个错还一直没有遇到过,metalink上一顿查,没有什么确切的。
尝试relink all,这下完了报了一堆错误:
$ relink all
/rdata/oracle/product/9.2.0/bin/genclntsh
未定义                  文件中的
符号                       在文件中
nnfgtent                            /rdata/oracle/product/9.2.0/lib/libn9.a(nnfg.o)
ntconent                            /rdata/oracle/product/9.2.0/lib/libn9.a(nruvers.o)
ntcontab                            /rdata/oracle/product/9.2.0/lib/libn9.a(ntpa.o)
nnfgtable                           /rdata/oracle/product/9.2.0/lib/libn9.a(nnfs.o)
ld: 致命的: 符号参照错误. 没有输出被写入/rdata/oracle/product/9.2.0/lib/libclntsh.so.9.0
ld: 致命的: 文件/rdata/oracle/product/9.2.0/rdbms/lib32/kpudfo.o: 打开失败: 无此文件或目录
cat: 不能打开 /tmp/clntst9.23379/*.nm
sort: can't stat /tmp/clntst9.23379/*.objs: 无此文件或目录
sort: can't stat /tmp/clntst9.23379/*.objs: 无此文件或目录
用法:ar -d[-vV] 归档文件 ...
       ar -m[-abivV] [posname] 归档文件 ...
       ar -p[-vV][-s] 归档 [文件 ...]
       ar -q[-cuvV] [-abi] [posname] [文件 ...]
       ar -r[-cuvV] [-abi] [posname] [文件 ...]
       ar -t[-vV][-s]归档 [文件 ...]
       ar -x[-vV][-sCT] 归档 [文件 ...]
ar: 创建 /rdata/oracle/product/9.2.0/lib/libclntst9.a
Created /rdata/oracle/product/9.2.0/lib/libclntst9.a
cat: 不能打开 /tmp/clntst9.23394/*.nm
sort: can't stat /tmp/clntst9.23394/*.objs: 无此文件或目录
用法:ar -d[-vV] 归档文件 ...
       ar -m[-abivV] [posname] 归档文件 ...
       ar -p[-vV][-s] 归档 [文件 ...]
       ar -q[-cuvV] [-abi] [posname] [文件 ...]
       ar -r[-cuvV] [-abi] [posname] [文件 ...]
       ar -t[-vV][-s]归档 [文件 ...]
       ar -x[-vV][-sCT] 归档 [文件 ...]
ar: 创建 /rdata/oracle/product/9.2.0/lib32/libclntst9.a
Created /rdata/oracle/product/9.2.0/lib32/libclntst9.a
/rdata/oracle/product/9.2.0/bin/genagtsh /rdata/oracle/product/9.2.0/lib/libagtsh.so 1.0
ld: 警告: 文件 /rdata/oracle/product/9.2.0/lib/libagent9.a(hodmp.o):错误的 ELF 类型:ELFCLASS64

- Linking Import utility (imp)
rm -f /rdata/oracle/product/9.2.0/rdbms/lib/imp
...
ld: 致命的: 文件/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 打开失败: 无此文件或目录
*** Error code 1
make: Fatal error: Command failed for target `/rdata/oracle/product/9.2.0/rdbms/lib/imp'
/bin/find: 不能跟符号链接 /rdata/oracle/product/9.2.0/lib/libclntsh.so: 无此文件或目录
/bin/find: 不能跟符号链接 /rdata/oracle/product/9.2.0/rdbms/filemap: 无此文件或目录
/bin/chmod 755 /rdata/oracle/product/9.2.0/bin/
- Linking
rm -f trcroute
。。。。。9:/usr/lib/sparcv9 -Qy -lc -laio   -lm  /rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crtn.o
ld: 致命的: 文件/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 打开失败: 无此文件或目录
*** Error code 1
make: Fatal error: Command failed for target `trcroute'
/bin/chmod 755 /rdata/oracle/product/9.2.0/bin/
- Linking /rdata/oracle/product/9.2.0/bin/tnslsnr
rm -f tnslsnr
...
ld: 致命的: 文件/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 打开失败: 无此文件或目录
*** Error code 1
make: Fatal error: Command failed for target `tnslsnr'
/bin/chmod 755 /rdata/oracle/product/9.2.0/bin/
rm -f oklist okinit okdstry
rm -f /rdata/oracle/product/9.2.0/lib/libnk59.so /rdata/oracle/product/9.2.0/lib/libnrad9.so /rdata/oracle/product/9.2.0/lib/libnnzentr9.so /rdata/oracle/product/9.2.0/lib/libngss9.so
- Linking
rm -f oklist
/usr/ccs/bin/ld -o oklist -L/rdata/oracle/product/9.2.0/network/lib/ -L/rdata/oracle/product/9.2.0/lib/ -dy /rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/...
/WS6U2/lib/v9/crtn.o
ld: 致命的: 文件/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 打开失败: 无此文件或目录
*** Error code 1
............还有很多...........

此时再用sqlplus /nolog,over了,报错:
$ sqlplus /nolog
ld.so.1: sqlplus: 致命的: libclntsh.so.9.0: 打开失败: 无此文件或目录
被杀掉

查看$ ls -ltr /rdata/oracle/product/9.2.0/lib/libclntsh.so.9.0
/rdata/oracle/product/9.2.0/lib/libclntsh.so.9.0: 无此文件或目录
怎么没有文件呢?晕了。
查看:
$ /usr/bin/ldd /rdata/oracle/product/9.2.0/bin/sqlplus
        libclntsh.so.9.0 =>      (文件没有发现)
        libwtc9.so =>    /rdata/oracle/product/9.2.0/lib/libwtc9.so
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1
        libgen.so.1 =>   /usr/lib/64/libgen.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libaio.so.1 =>   /usr/lib/64/libaio.so.1
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libthread.so.1 =>        /usr/lib/64/libthread.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
        /usr/platform/SUNW,Ultra-Enterprise/lib/sparcv9/libc_psr.so.1
$ /usr/bin/ldd /rdata/oracle/product/9.2.0/bin/lsnrctl
        libclntsh.so.9.0 =>      (文件没有发现)
        libwtc9.so =>    /rdata/oracle/product/9.2.0/lib/libwtc9.so
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1
        libgen.so.1 =>   /usr/lib/64/libgen.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libaio.so.1 =>   /usr/lib/64/libaio.so.1
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
        /usr/platform/SUNW,Ultra-Enterprise/lib/sparcv9/libc_psr.so.1
        

想着拷贝一个过来试试,于是想起公司本地有个库是solairs9208的64位的。
于是ftp一个过来,放到默认的位置。

$ cp libclntsh.so.9.0 $ORACLE_HOME/lib
再执行
$ sqlplus /nolog

SQL*Plus: Release 9.2.0.8.0 - Production on 星期一 12月 8 15:32:18 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> conn /as sysdba
ld.so.1: oracle: 致命的: /rdata/oracle/product/9.2.0/lib/libskgxn9.so: 错误的 ELF 类型: ELFCLASS32
ERROR:
ORA-12547: TNS: 丢失联系

有报了上面别的错误。
尝试编译ins_rdbms.mk看看,晕,报了缺文件。
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk install
chmod 755 /rdata/oracle/product/9.2.0/bin
rm -f oracle mig dbv tstshm maxmem orapwd dbfsize cursize  genoci extproc extproc32 hsalloci hsots hsdepxa dgmgrl dumpsga mapsga  osh sbttest imp exp sqlldr rman hsodbc    tg4ifmx tg4ingr     tg4sybs tg4tera  avmurout avmping avligmsg avmumon nid /rdata/oracle/product/9.2.0/rdbms/lib/ksms.s /rdata/oracle/product/9.2.0/rdbms/lib/ksms.o

- Linking Oracle
rm -f /rdata/oracle/product/9.2.0/rdbms/lib/oracle
。。。
/v9/crtn.o  
ld: 致命的: 文件/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 打开失败: 无此文件或目录
*** Error code 1
make: Fatal error: Command failed for target `/rdata/oracle/product/9.2.0/rdbms/lib/oracle'
$ uname -a
SunOS bims-analysis 5.9 Generic_118558-29 sun4u sparc SUNW,Ultra-Enterprise
$ ls -l /rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o
/rdata/oracle/product/9.2.0/lib/WS6U2/lib/v9/crti.o: 无此文件或目录

然后又从本地ftp多个文件过去。

最后还是over:
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk install      
chmod 755 /rdata/oracle/product/9.2.0/bin
rm -f oracle mig dbv tstshm maxmem orapwd dbfsize cursize  genoci extproc extproc32 hsalloci hsots hsdepxa dgmgrl dumpsga mapsga  osh sbttest imp exp sqlldr rman hsodbc    tg4ifmx tg4ingr     tg4sybs tg4tera  avmurout avmping avligmsg avmumon nid /rdata/oracle/product/9.2.0/rdbms/lib/ksms.s /rdata/oracle/product/9.2.0/rdbms/lib/ksms.o

- Linking Oracle
rm -f /rdata/oracle/product/9.2.0/rdbms/lib/oracle
...
/oracle/product/9.2.0/lib/WS6U2/lib/v9/crtn.o  
ld: 致命的: 文件 /rdata/oracle/product/9.2.0/rdbms/lib/config.o:错误的 ELF 类型:ELFCLASS32
ld: 致命的: 文件处理错误。无输出写到/rdata/oracle/product/9.2.0/rdbms/lib/oracle
*** Error code 1
make: Fatal error: Command failed for target `/rdata/oracle/product/9.2.0/rdbms/lib/oracle'

尝试再重新打补丁,结果还是OVER:
$ ./runInstaller -silent -responseFile /rdata/software/oracle9208/p1/Disk1/response/analysis.rsp
正在启动 Oracle Universal Installer...

正在检查安装程序要求...

检查操作系统版本: 必须是5.6, 5.7, 5.8, 5.9 or 5.10。    实际为 5.9
                                      通过

检查临时空间: 必须大于 250 MB。   实际为 11951 MB    通过
检查交换空间: 必须大于 500 MB。   实际为 14615MB    通过

所有安装程序要求均已满足。

准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2008-12-08_04-07-38PM. 请稍候...$ Oracle Universal Installer, 版本 10.1.0.5.0 Production
版权所有 (c) 1999, 2005, Oracle。保留所有权利。

....................................
正在加载产品信息
...............................................................100% 已完成。


分析相关性
..........................错误:*** 警告: 从补丁程序集 Oracle 9iR2 Patchset 9.2.0.8.0  中找不到需要应用的补丁程序。 ***

$
$


到目前为止,数据库无法用,连conn /as sysdba这类的都不行。至此也没注意到是一开始数据库版本就不对了(32位的以为是64位)。

想着这下怎么办啊,数据库没法用了呀。
恢复数据库软件?没有备份,没招。现成的oracle9201重装,没有介质,也无法图形界面(不在本地)

对了,从本地库把9208软件tar个过来。也只能这样了。

于是在本地tar软件:
tar cvf jre.tar jre
tar cvf oraInventory.tar oraInventory
tar cvf oui.tar oui
tar cvf product.tar product

ftp上传然后(共花3个小时,通过定时任务后台传的,所以可以先回家了),将原来的目录MV,然后再解压tar。

Ok,继续干活。
修改/var/opt/oracle/下面的文件对应。
bash-2.05$ ls
oraInst.loc  oratab

拷贝替换为原来的spfile,密码文件,listener.ora,tnsnames.ora等等
文件主要在这两个目录下:$ORACLE_HOME/dbs和$ORACLE_HOME/network/admin

Ok,数据库启动,确实可以启动。
目前的状态是oracle9208 64位的数据库软件,而实例是oracle9201 32位的。

既然这样,那就继续更新数据字典了。
先检查,以便和升级后对比:
SQL> select comp_id,status,version from dba_registry;
检查是否有无效的对象。
Sql>select object_name,status from dba_objects where object_Name in ('SYS','SYSTEM') and status = 'INVALID';
Sql>select count(*) from dba_objects where object_Name in ('SYS','SYSTEM') and status = 'INVALID';
检查java pool,share pool 大于150M,OK。

开始升级。
SQL> conn /as sysdba
已连接到空闲例程。
SQL> startup migrate
ORACLE 例程已经启动。

Total System Global Area 2384432096 bytes
Fixed Size                   732128 bytes
Variable Size            1006632960 bytes
Database Buffers         1375731712 bytes
Redo Buffers                1335296 bytes
数据库装载完毕。
数据库已经打开。
SQL> spool patch.log
SQL> @?/rdbms/admin/catpatch.sql
DOC> BEGIN CATPATCH.SQL */
DECLARE
*
ERROR 位于第 1 行:
ORA-06553: PLS-801: 内部错误 [56319]

晕,直接就抛出ORA-06553: PLS-801: 内部错误 [56319]了,上网查查,还有metalink:
Subject:  ORA-06544 ORA-06553 PLS-801: internal error [56319] when Executing PLSQL
  Doc ID:  Note:577800.1 Type:  PROBLEM
  Last Revision Date:  19-NOV-2008 Status:  MODERATED

In this Document
  Symptoms
  Cause
  Solution



--------------------------------------------------------------------------------


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.



Applies to:
PL/SQL - Version: 9.2.0.4.0
This problem can occur on any platform.

Symptoms
After copying the 64 bit executables from an old 64 bit installation into a fresh 32 bit installation,the new database starts up fine but executing any PLSQL object fails with the following error


SQL> drop procedure test;
drop procedure test
*
ERROR at line 1:
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [],
[]
ORA-06553: PLS-801: internal error [56319]


Alert log contains ORA-00600.

Cause
The new installation was a 32bit database, but the files which were copied into 32bit install where from a 64bit database install.

You cannot backup the files from 64bit database and copy it into a 32bit database and try to execute the procedure. The program will always error out due to incompatibility.
Solution
Install a 64bit oracle database for using 64bit executables and 32bit oracle database for using 32bit executables.


直到这时才意识到,难道原来的数据库是32位的?
查看以前检查的日志,恍然大悟。
$ sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on 星期一 12月 8 10:44:29 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> conn /as sysdba
已连接。
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE    9.2.0.1.0       Production
TNS for Solaris: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production

SQL> exit
从Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production中断开


原来的数据库果然是32位的。
如果数据库是64位的,显示的结果应该会有 64bit Production这样的标识的。

当然检查ORACLE数据库是否32位或64位的方法很多,这里不赘述。

知道问题所在了,原来一开始就犯了严重的低级的错误,而这个错误往往会被忽视,导致出现上面一系列的问题。

既然问题出现了,那就的解决。

有几个选择:
1.想办法重新安装9201的32位数据库,将数据库恢复使用。但准备介质,上传介质都需要一定时间。而且没有达到升级的要求。
2.想办法将32为9201转换升级到64位9208,当然存在一定风险(确实不敢打包票,曾经有网友在windows平台32到64位出现一些对象编译不过去的情况)
最坏的情况是升级转换失败,数据库也OVER,重建数据库,得花2-3天时间搞。
最好的情况是升级转换成功,数据库OK。没有其它事情。

最终大家确定升级转换方案。毕竟oracle有官方文档可参考:
Subject:  Changing between 32-bit and 64-bit Word Sizes
  Doc ID:  Note:62290.1 Type:  BULLETIN
  Last Revision Date:  28-OCT-2008 Status:  PUBLISHED

。如果再出问题,就重建了。
当然由于没有多余空间,备份数据库文件操作也被略过了。
启动关闭数据库,然后
SQL> STARTUP MIGRATE
SQL> SPOOL catoutw.log
SQL> SET ECHO ON
SQL> @$ORACLE_HOME/rdbms/admin/utlirp.sql
成功。

然后继续SQL> @$ORACLE_HOME/rdbms/admin/catpatch.sql
然后就hung在这里了。

立即检查alert_xxx.log,一堆Ora-600错,吓出一身冷汗。

Tue Dec  9 09:56:49 2008
Thread 1 advanced to log sequence 4227
  Current log# 3 seq# 4227 mem# 0: /rdata/oracle/oradata/analysis/redo03.log
Tue Dec  9 10:04:14 2008
Thread 1 advanced to log sequence 4228
  Current log# 1 seq# 4228 mem# 0: /rdata/oracle/oradata/analysis/redo01.log
Tue Dec  9 10:08:43 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:08:46 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:08:50 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:08:55 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:04 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:13 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:20 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:25 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:32 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:42 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:09:55 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:01 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:08 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:14 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:23 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:30 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Tue Dec  9 10:10:41 2008
Errors in file /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc:
ORA-00600: 内部错误代码,参数: [qmxiUnpPacked2], [121], [], [], [], [], [], []
$ more /rdata/oracle/admin/analysis/udump/analysis_ora_25092.tr
/rdata/oracle/admin/analysis/udump/analysis_ora_25092.tr: 无此文件或目录
$ more /rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc
/rdata/oracle/admin/analysis/udump/analysis_ora_25092.trc
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
ORACLE_HOME = /rdata/oracle/product/9.2.0
System name:    SunOS
Node name:      bims-analysis
Release:        5.9
Version:        Generic_118558-29
Machine:        sun4u
Instance name: analysis
Redo thread mounted by this instance: 1
Oracle process number: 10
Unix process pid: 25092, image: oracle@bims-analysis (TNS V1-V3)

*** 2008-12-09 10:08:43.021
*** SESSION ID7.3) 2008-12-09 10:08:43.010
***
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data
******
*** Object defn.s out of sync w/ data

查看metalink.
Subject:  How to resolve ORA-600 [qmxiUnpPacked2] during upgrade
  Doc ID:  Note:235423.1 Type:  HOWTO
  Last Revision Date:  08-JUL-2008 Status:  PUBLISHED

说可能三种情况,不列出了。

我检查了shared_pool_size and java_pool_size都是大于150Mb,怀疑是因为前面执行的脚本,把shared pool占满了,于是关闭数据库,然后再STARTUP MIGRATE。

然后再执行升级脚本,OK通过。
检查版本升级:
SQL> select comp_id,status,version from dba_registry;
最后在重启,执行编译失效对象:
Sql>select count(*) from dba_objects where status = 'INVALID';
SQL> @?/rdbms/admin/utlrp.sql
再次关闭数据库。

接下来就是打小补丁。
确认没有Oralce进程。然后继续:
将opatch添加到环境变量:
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/bin:/usr/ucb:/etc:/usr/openwin/bin:/usr/ccs/bin:/usr/local/bin
export PATH

执行:
$ ls
5391326                                  p5391326_92080_SOLARIS64_2006-11-17.zip
$ cd 5*
$ ls
README.txt  etc         files
$ opatch apply

Oracle Interim Patch Installer version 1.0.0.0.55
Copyright (c) 2006 Oracle Corporation. All Rights Reserved..

We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com

Oracle Home = /rdata/oracle/product/9.2.0
Location of Oracle Universal Installer components = /rdata/oracle/product/9.2.0/oui
Location of OraInstaller.jar  = "/rdata/oracle/product/9.2.0/oui/jlib"
Oracle Universal Installer shared library = /rdata/oracle/product/9.2.0/oui/lib/solaris/liboraInstaller.so
Location of Oracle Inventory Pointer = /var/opt/oracle/oraInst.loc
Location of Oracle Inventory = /rdata/oracle/product/9.2.0/inventory
Path to Java = /rdata/oracle/product/9.2.0/jre/1.4.2/bin/java
Log file = /rdata/oracle/product/9.2.0/.patch_storage//*.log

Creating log file "/rdata/oracle/product/9.2.0/.patch_storage/5391326/Apply_5391326_12-09-2008_11-46-31.log"

The Oracle Home /rdata/oracle/product/9.2.0 is not registered with the Central Inventory.  OPatch was not able to get details of the home from the inventory.

ERROR: OPatch failed because of Inventory problem.
$ more /rdata/oracle/product/9.2.0/.patch_storage/5391326/Apply_5391326_12-09-2008_11-46-31.lo
/rdata/oracle/product/9.2.0/.patch_storage/5391326/Apply_5391326_12-09-2008_11-46-31.lo: 无此文件或目录
$ more /rdata/oracle/product/9.2.0/.patch_storage/5391326/Apply_5391326_12-09-2008_11-46-31.log

Creating log file "/rdata/oracle/product/9.2.0/.patch_storage/5391326/Apply_5391326_12-09-2008_11-46-31.log"

Starting OPatch Apply session at 12-09-2008_11-46-31.

Command arguments are: apply

OPatch version is: 1.0.0.0.55

The contents of the file: /var/opt/oracle/oraInst.loc

inventory_loc=/rdata/oracle/oraInventory

inst_group=dba

Performing RAC pre-req. check...


Accessing inventory ... (retry 10 times, delay 30 seconds each time)


System Command: /rdata/oracle/product/9.2.0/jre/1.4.2/bin/java    -Doracle.installer.invPtrLoc=/var/opt/oracle/or
aInst.loc -Dopatch.retry=10 -Dopatch.delay=30  -classpath "/rdata/oracle/product/9.2.0/oui/jlib/OraInstaller.jar:
/rdata/oracle/product/9.2.0/oui/jlib/srvm.jar:/rdata/oracle/product/9.2.0/OPatch/jlib/opatch.jar:/rdata/oracle/pr
oduct/9.2.0/oui/jlib/xmlparserv2.jar:/rdata/oracle/product/9.2.0/oui/jlib/share.jar:/rdata/oracle/product/9.2.0/j
lib/srvm.jar" opatch/O2O "/rdata/oracle/product/9.2.0" "/rdata/oracle/product/9.2.0/oui" opatch.pl 1.0.0.0.55

Result:

output to OPatch:





HOME_INDEX=-1



The Oracle Home /rdata/oracle/product/9.2.0 is not registered with the Central Inventory.  OPatch was not able to
get details of the home from the inventory.

ERROR: OPatch failed because of Inventory problem.


晕,又报错。
The Oracle Home /rdata/oracle/product/9.2.0 is not registered with the Central Inventory
奇怪,明明/var/opt/oracle/oraInst.loc都正确了,环境变量也OK,怎么还报错呢?

再检查:
$ opatch lsinventory -all

Oracle Interim Patch Installer version 1.0.0.0.55
Copyright (c) 2006 Oracle Corporation. All Rights Reserved..

We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com

Oracle Home = /rdata/oracle/product/9.2.0
Location of Oracle Universal Installer components = /rdata/oracle/product/9.2.0/oui
Location of OraInstaller.jar  = "/rdata/oracle/product/9.2.0/oui/jlib"
Oracle Universal Installer shared library = /rdata/oracle/product/9.2.0/oui/lib/solaris/liboraInstaller.so
Location of Oracle Inventory Pointer = /var/opt/oracle/oraInst.loc
Location of Oracle Inventory = /rdata/oracle/product/9.2.0/inventory
Path to Java = /rdata/oracle/product/9.2.0/jre/1.4.2/bin/java
Log file = /rdata/oracle/product/9.2.0/.patch_storage//*.log

Creating log file "/rdata/oracle/product/9.2.0/.patch_storage/LsInventory__12-09-2008_12-20-58.log"

LsInventory: OPatch Exception while accessing O2O

OPatch Exception:
  OUI found no such ORACLE_HOME set in the environment
  Can not get details for given Oracle Home
  An exception occurs
  null
  
ERROR: OPatch Exception:
  OUI found no such ORACLE_HOME set in the environment
  Can not get details for given Oracle Home
  An exception occurs
  null
  
ORACLE HOME          LOCATION
-----------          --------

Home1  /data/oracle/product/9.2.0


OPatch succeeded.

原来是原先从别的库tar过来的,OUI是以前的库的路径。

修改inventory.xml文件中loc后通过:
$ pwd
/rdata/oracle/oraInventory/ContentsXML
$ vi inventory.xml


$ opatch lsinventory -all

Oracle Interim Patch Installer version 1.0.0.0.55
Copyright (c) 2006 Oracle Corporation. All Rights Reserved..

We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com

Oracle Home = /rdata/oracle/product/9.2.0
Location of Oracle Universal Installer components = /rdata/oracle/product/9.2.0/oui
Location of OraInstaller.jar  = "/rdata/oracle/product/9.2.0/oui/jlib"
Oracle Universal Installer shared library = /rdata/oracle/product/9.2.0/oui/lib/solaris/liboraInstaller.so
Location of Oracle Inventory Pointer = /var/opt/oracle/oraInst.loc
Location of Oracle Inventory = /rdata/oracle/product/9.2.0/inventory
Path to Java = /rdata/oracle/product/9.2.0/jre/1.4.2/bin/java
Log file = /rdata/oracle/product/9.2.0/.patch_storage//*.log

Creating log file "/rdata/oracle/product/9.2.0/.patch_storage/LsInventory__12-09-2008_12-38-25.log"

ORACLE HOME          LOCATION
-----------          --------

Home1  /rdata/oracle/product/9.2.0

再次opatch apply成功。
启动数据库,启动监听。检查alert日志正常。

接下来就是测试人员去测试数据库应用了。

至此,数据库升级转换成功。从最初升级开始,到完成。时间整整花了1.5天。

[ 本帖最后由 jieyancai 于 2008-12-9 14:49 编辑 ]

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

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-03-23

  • 博文量
    2
  • 访问量
    3231