原博主:http://blog.csdn.net/tianlesoftware/article/details/4843600 

Applies to: 
Oracle Server - Enterprise Edition - Version: 10.1.0.5.0 
This problem can occur on any platform. 
Symptoms: 
The issue is that the following error was raised : 
ORA-00600: internal error code, arguments: [kesutlGetBindValue-2], [], [], [], [], [], [], [] 
The recent changes was the : 
Migration from 10.1.0.5.0 database control to Grid Control Agent v10.2.0.3.0 
What was runing at this moment of the error occurance was : 
The attempt to run SQL Tuning Advisor from Grid Control

Cause: 
Possibly invalid objects in the database. 
As the issue here was to try to use these packages and then failed: 
SYS.DBMS_SQLTUNE_INTERNAL 
body SYS.PRVT_ADVISOR 
body SYS.DBMS_ADVISOR 
body SYS.DBMS_SQLTUNE 
And as mentioned with the recent changes was the migration.

Solution: 
1. fixup 
1). connect to the database as sysdba: 
sqlplus "/ as sysdba" 
2). shutdown immediate 
3). startup migrate 
4). @?/rdbms/admin/catalog.sql 
5). @?/rdbms/admin/catproc.sql 
6). @?/rdbms/admin/utlrp.sql 
7). shutdown immediate 
8). startup

SELECT UNIQUE OBJECT_TYPE FROM ALL_objects where status = 'INVALID'; 
select 'ALTER ' || OBJECT_TYPE || ' '||owner||'.' || OBJECT_NAME || ' COMPILE;' 
from  all_objects where  status = 'INVALID' 
and  object_type in ('PACKAGE','FUNCTION','PROCEDURE', 'TABLE', 'VIEW', 'SEQUENCE', 'TRIGGER'); 
   
     
   SELECT * from dba_users; 
   select 'ALTER PACKAGE ' || OWNER||'.'|| OBJECT_NAME || ' COMPILE body;' 
from ALL_objects where status = 'INVALID' and object_type in ('PACKAGE BODY'); 
SELECT UNIQUE OBJECT_TYPE FROM ALL_OBJECTS;

2. Verify that the status of the CATPROC : 
SQL> col comp_id format a10 
SQL> col comp_name format a30 
SQL> col version format a10 
SQL> select comp_id, comp_name, status, version from dba_registry;

and the status of the other objects: 
SQL> col object_name format a30 
SQL> col owner format a15 
SQL> select object_name, owner, object_type, status from dba_objects 
where status = 'INVALID';

2-If they are invalid please do the following: 
To validate the invalid objects 
1)-Please run the utlrp.sql script to try and validate the invalid packages, then check if they are valid or still invalid. 
2 )-If the objects are still invalid after running the utlrp.sql script then run catalog.sql and catproc.sql and then run utlrp.sql 
    a) Startup restrict or startup migrate. 
    b) run catalog.sql 
    c) run catproc.sql 
    d) run utlrp.sql 
3 )-Requery for the invalid objects again. 
select owner,object_type,object_name from dba_objects where status='INVALID' ; 
4 )-If they are still invalid please try to validate them manually using the below: 
Try Manual method of validation: 
Alter procedure <owner>.<procedure_name> compile; 
Alter function <owner>.<function_name> compile; 
Alter view <owner>.<view_name> compile; 
Alter package <owner>.<package_name> compile; 
Alter package <owner>.<package_name> compile body; 
Alter materialized view <owner>.<Package_name> Compile; 
In case you have lots of invalid objects,you can generate scripts that will generate the sqls for compiling the invalid objects : 
In sqlplus connect as sys: 
set heading off 
spool compileinvalid.sql 
select 'alter '||object_type|| ' ' || owner ||'.'||object_name || ' compile;' from dba_objects 
where status='INVALID'; 
spool off 
ORA-06512: at "PS_SYSTEM.ROW_VALIDATOR_T", line 912 
ORA-06512: at "PS_SYSTEM.ROW_VALIDATOR_T", line 924 
ORA-06512: at "WORKORDER.INVENTORY_UTL", line 1260 
select owner,object_name,object_type,status from all_objects where object_name='ROW_VALIDATOR_T' and owner='PS_SYSTEM'; 
OWNER                          OBJECT_NAME                        OBJECT_TYPE       STATUS 
------------------------------ ------------------------------ ------------------- ------- 
PS_SYSTEM                      ROW_VALIDATOR_T           TYPE                      VALID 
PS_SYSTEM                      ROW_VALIDATOR_T          TYPE BODY           VALID

SQL> select owner,object_name,object_type,status from all_objects where object_name='INVENTORY_UTL' and owner='WORKORDER' 
  2  ; 
OWNER                             OBJECT_NAME                     OBJECT_TYPE          STATUS 
------------------------------ ------------------------------ -------------------      ------- 
WORKORDER                      INVENTORY_UTL           PACKAGE                  VALID 
WORKORDER                      INVENTORY_UTL           PACKAGE BODY       VALID

Then run compileinvalid.sql in sqlplus prompt as sys user.. 
To compile invalid package body use: 
alter package <package_name> compile body;

5 )-Also you could do the following  Note 100419.1  SCRIPT: VALIDATE.SQL to ANALYZE VALIDATE 
STRUCTURE objects in a Tablespace 
Please Go through the above action plan and i will be waiting for your update. 
6 )-Please make sure that these packages are valid: 
SYS.DBMS_SQLTUNE_INTERNAL 
body SYS.PRVT_ADVISOR 
body SYS.DBMS_ADVISOR 
body SYS.DBMS_SQLTUNE

References 
Note 100419.1 - SCRIPT: VALIDATE.SQL to ANALYZE .. VALIDATE STRUCTURE objects in a Tablespace

alter PACKAGE BODY SYS.DBMS_XPLAN body compile; 
alter PACKAGE BODY SYS.DBMS_SQLTUNE_INTERNAL body compile; 
alter SYNONYM PUBLIC.HHLINEOR compile; 
alter SYNONYM PUBLIC.HHNEIGHBOUR compile; 
alter SYNONYM PUBLIC.HHLINEPS compile; 
alter SYNONYM PUBLIC.HHIDROWS compile; 
alter SYNONYM PUBLIC.HHIDLROWS compile; 
alter SYNONYM PUBLIC.HHBITS compile;

---------无效索引查询 'INVALID INDEXES'

select s2.owner, s2.tablespace_name, s2.segment_name, 
        i2.table_name, s2.extents, s2.bytes, s2.blocks, i2.status 
from dba_segments s2, 
        dba_indexes i2 
where s2.owner not in ('SYS','SYSTEM') 
and s2.segment_type = 'INDEX' 
and i2.status != 'VALID' 
and s2.segment_name = i2.index_name 
and s2.owner = i2.owner 
order by 1,5,4

Oracle常用脚本
-- use sys to run this one
select    'ALTER ' || OBJECT_TYPE || ' '||owner||'.' || OBJECT_NAME || ' COMPILE;' 
from    all_objects 
where    status = 'INVALID' 
and object_type in ('PACKAGE','FUNCTION','PROCEDURE', 'TABLE', 'VIEW', 'SEQUENCE', 'TRIGGER');

--   select 
   'ANALYZE ' || OBJECT_TYPE || ' ' || OBJECT_NAME || ' COMPUTE STATISTICS;' 
from 
   user_objects 
where 
   object_type = 'TABLE';

 
 

oracle compile 编译无效对象的更多相关文章

  1. oracle 编译无效对象

    在数据库中,会存在一些无效的对象,导致这种现象的发生原因很多,其中最常见的就是数据库升级(例如修改了表的结构),迁移而引起. 编译无效对象的方式: 1 使用alter **** compile 语句进 ...

  2. Oracle EBS 重新编译无效对象 invalid object

    1.  查看数据库中的无效对象      check oracle object      SQL> select count(*) from dba_objects where status= ...

  3. ORACLE编译失效对象小结

    在日常数据库维护过程中,我们会发现数据库中一些对象(包Package.存储过程Procedure.函数Function.视图View.同义词.....)会失效,呈现无效状态(INVALID).有时候需 ...

  4. oracle重新编译失效对像

    重新编译失效对像可执行utlrp.sql文件: SQL> @?/rdbms/admin/utlrp.sql TIMESTAMP --------------------------------- ...

  5. Oracle视图编译错误解决办法

    因为新搭的环境,数据库是从另一个现成的环境导过来的,直接后台用exp和imp命令操作.但是新环境的Oracle数据库有问题,一些视图创建不了,导致用到这些视图的视图和存储过程也编译不了.后来手工重新编 ...

  6. 转://oracle 重新编译用户无效对象

    select owner,object_name, replace(object_type,' ','') object_type,to_char(created,'yyyy-mm-dd') as c ...

  7. 处理Oracle数据中的无效对象

    今天还原了一份数据库(在服务器上没有无效对象),还原在本地之后有三十几个无效对象,当时很是郁闷,然后我发现还原之后的数据库中缺少表! 开始我怀疑Oracle数据库的还原功能,但是在我创建表的时候发现, ...

  8. sqlplus编译失效对象

    原文整理自:http://www.51testing.com/?uid-16403-action-viewspace-itemid-98161:http://www.eygle.com/archive ...

  9. Oracle 重新编译存储过程/函数等

    第一种  如果你使用 PL/SQL Developer工具          左侧工具栏中选择“存储过程”->选择已经失效的procedure->右键->选择重新编译 即可完成 第二 ...

随机推荐

  1. 什么是QPS,PV

    术语说明: QPS = req/sec = 请求数/秒 [QPS计算PV和机器的方式] QPS统计方式 [一般使用 http_load 进行统计] QPS = 总请求数 / ( 进程总数 * 请求时间 ...

  2. Pyqt5的事例讲解

    1.第一个gui程序 import sys from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QMainWind ...

  3. 不通过调用__Init__来创建实例

    老样子,抛出个问题,我们想要创建一个实例,但是由于某些原因想绕过__init__方法,用别的方式来进行创建. 举个栗子 小贱贱反序列化数据,或者说实现一个类方法将其作为备选的构造函数,都属于这种情况. ...

  4. os & sys

    os os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录:相当于shell下cd os.c ...

  5. JsRender 学习总结

    jsRender 三个最重要的概念:模板.容器和数据. 最重要的是:view(视图) 是我们定义的模板,上下文是视图所用的对象. 一.基础. {{:}} 和 {{>}}(或{{html:}})两 ...

  6. python 面向对象编程 之 上下文管理协议

    with open('path', 'r' ,encoding='utf-8') as f: 代码块 上述就叫做上线文管理协议,即with语句,为了让一个对象兼容with语句,必须在这个对象的类中声明 ...

  7. 软件开发中 SQL SERVER 任务的用法

    在软件开发中,经常性会用到定时任务.这个时候你可能会想到线程.但是事实中,线程方法比较麻烦.容易出错,资源竞争等问题,设计起来让你很头痛. 现在给大家提供一个新的思路,用SQL SERVER 的任务管 ...

  8. JS部分

    前端三剑客(HTML,CSS,JavaScript) Html:负责一个页面的结构 Css:负责一个页面的样式 JavaScript:负责与用户进行交互 JS概念 JS是JavaScript的简称,是 ...

  9. java性能优化之for循环

    完成同样的功能,用不同的代码来实现,性能上可能会有比较大的差别,所以对于一些性能敏感的模块来说,对代码进行一定的优化还是很有必要的.今天就来说一下java代码优化的事情,今天主要聊一下对于for(wh ...

  10. lazarus,synedit输入小键盘特殊符号的补丁

    unit synedittextdoublewidthchars2; // fix up chinese symbel width //by steven {$mode objfpc}{$H+} in ...