GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle
Go To First  |  Previous Question  |  Next Question 
 Oracle  |  Question 38 of 81    Print  
How to recompile invalid objects???

  
Total Answers and Comments: 6 Last Update: April 26, 2007     Asked by: hasanvtu 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 07, 2006 14:18:17   #1  
Vijayaraju T        

RE: How to recompile invalid objects???

First check all the INVALID objects in the schema using :

select OBJECT_NAME OBJECT_TYPE from user_objects where status 'INVALID';

compile the objects accordingly....

ALTER PACKAGE my_package COMPILE;

ALTER PACKAGE my_package COMPILE BODY;

ALTER PROCEDURE my_procedure COMPILE;

ALTER FUNCTION my_function COMPILE;

ALTER TRIGGER my_trigger COMPILE;

ALTER VIEW my_view COMPILE;

Regards

VijayRaju


 
Is this answer useful? Yes | No
November 18, 2006 21:07:46   #2  
srirama varma        

RE: How to recompile invalid objects???
you will need to recompile the invalid objects in the Repository.
 
Is this answer useful? Yes | No
November 20, 2006 04:24:31   #3  
Debi Prasad Maharana,Wipro Technologies.        

RE: How to recompile invalid objects???
hi There are two method for compiling the INVALID object.(1) using ALTER statement.SQL > ALTER [OBJECT TYPE ] [ OBJECT NAME ] COMPILE;
 
Is this answer useful? Yes | No
November 20, 2006 04:29:05   #4  
Debi Prasad Maharana,Wipro Technologies.        

RE: How to recompile invalid objects???
hi There are two method for compiling the INVALID object.(1) using ALTER statement.SQL > ALTER [OBJECT TYPE ] [ OBJECT NAME ] COMPILE;OBJECT TYPE AND OBJECT NAME can be found from USER_OBJECTS viewsSQL > SELECT CBJECT_TYPE OBJECT_NAME FROM USER_OBJECTS WHERE STATUS LIKE 'INVALID';(2) using DBMS_DDL packagewrite a small program for thisbeginDBMS_DDL.ALTER_COMPILE('[OBJECT_TYPE]' '[SCHEMA NAME]' '[OBJECT_NAME]');end;/ex :begindbms_ddl.alter_compile('PROCEDURE' 'SCOTT' 'TEST_PROCEDURE');end;/Then check the status of the object in user_objects views.Thanks and RegardsDebi Prasad MaharanaWipro Technologies.
 
Is this answer useful? Yes | No
December 18, 2006 15:29:02   #5  
daniels        

RE: How to recompile invalid objects???
you could also do the following.dbms_utility.compile_schema(schema IN VARCHAR2 compile_all BOOLEAN DEFAULT TRUE reuse_settings BOOLEAN DEFAULT FALSE);exec dbms_utility.compile_schema('SCOTT');
 
Is this answer useful? Yes | No
April 26, 2007 02:17:15   #6  
sik tauk Member Since: April 2007   Contribution: 1    

utlrp
If you are a DBA login on the host using sqlplus to the database using sys as sysdba privilege.

$ export ORACLE_HOME <ORACLE_HOME>
$ export ORACLE_SID <ORACLE_SID>
$ sqlplus "/ as sysdba"

Execute the Oracle-supplied utility to compile invalid objects globally:

SQL> ?/rdbms/admin/utlrp

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape