Chinaunix首页 | 论坛 | 博客
  • 博客访问: 495122
  • 博文数量: 105
  • 博客积分: 3040
  • 博客等级: 中校
  • 技术积分: 1450
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-08 13:04
文章分类

全部博文(105)

文章存档

2008年(105)

我的朋友

分类: Oracle

2008-12-30 16:59:18

公司有一个数据库的primary主机坏掉了,发现后将备库standby切成主。坏掉的主机换了主板,之前的系统是前任DBA装的,我发现该机器是64位的所以装了个64位系统,并且装了一个64位的oracle10g,之所以重装系统也是因为该主机使用时间比较长硬盘碎片文件很多,对性能有一定影响。重装后从备库把主库恢复回来,最快的方法就是把备库的数据文件、控制文件、日志文件全都CP过来,参数文件做一定的调整,这里不再细说,然后做一个备库的控制文件,传回去。本以为没什么问题,两个库起来后日志传输正常,使用sys用户登了一个主库没发现什么问题就是后台有几个小报错。也就没在意。今天早来公司后应用部门告诉我客户端用户连不上数据库,登上主机试着用conn username/password的方式连了一下报错,换其他用户也一样报错,只有conn / as sysdba的时候没问题,查询一下数据也能查出来,看来不是库坏了(庐山瀑布汗啊)。报的错误如下

ERROR:
ORA-06553: PLS-801: internal error [56319]


Error accessing package DBMS_APPLICATION_INFO
ERROR:
ORA-06553: PLS-801: internal error [56319]

网上搜了一下发现有人遇到过类似的错误,有人说是因为用户ID不同造成的,于是核对了一下两边oracle用户的id

[oracle@haha dbs]$ id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
发现DBA组的ID不同,修改了一下再连仍然报错(尼亚加拉瀑布汗)!!

业务部门已经催的很急了,我再搜,发现有一篇帖子说他从64位库移植到32位也出了这个问题,和我的正好相反,看来有门。执行一次而32位到64位数据库的升级操作吧!反正有备库实在不行切了。

步骤很简单,先把库DOWN掉

1、shutdown immediate

2. Startup upgrade

3、;


4、Shutdown immediate


5、Startup


6、@$ORACLE_HOME/rdbms/admin/utlrp.sql;


7、Shutdown immediate

8、startup

完成后忐忑不安的又登陆了一下,竟然很顺利的进去了,后台也没再报什么错误

最最主要的就是使用utlirp来把相关内容全部在64位平台下编译一遍,顺便补充下utlirp的作用:

Rem NAME
Rem utlirp.sql - UTiLity script to Invalidate Pl/sql modules
Rem
Rem DESCRIPTION
Rem This script can be used to invalidate and all pl/sql modules
Rem (procedures, functions, packages, types, triggers, views)
Rem in a database.
Rem
Rem This script must be run when it is necessary to regenerate the
Rem compiled code because the PL/SQL code format is inconsistent with
Rem the Oracle executable (e.g., when migrating a 32 bit database to
Rem a 64 bit database or vice-versa).
Rem
Rem Please note that this script does not recompile invalid objects
Rem automatically. You must restart the database and explicitly invoke
Rem utlrp.sql to recompile invalid objects.
Rem
Rem USAGE
Rem To use this script, execute the following sequence of actions:
Rem 1. Shut down the database and restart in UPGRADE mode
Rem (using STARTUP UPGRADE or ALTER DATABASE OPEN UPGRADE)
Rem 2. Run this script
Rem 3. Shut down the database and restart in normal mode
Rem 4. Run utlrp.sql to recompile invalid objects. This script does
Rem not automatically recompile invalid objects.
Rem
Rem NOTES
Rem * This script must be run using SQL*PLUS.
Rem * You must be connected AS SYSDBA to run this script.
Rem * This script expects the following files to be available in the
Rem current directory:
Rem standard.sql
Rem dbmsstdx.sql
Rem * There should be no other DDL on the database while running the
Rem script. Not following this recommendation may lead to deadlocks.
Rem

特此记录过程,希望对大家有所帮助

阅读(2187) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~