Oracle database tips logo
Article categories | Blog and News Page | SQL | SQL*Plus | DBA Scripts | Standby dbs | Database Links | Techno webcasts | Oracle Magazine | Free IT Magazines | Oracle Database Hosting Companies | Site Search |
RSS
XML RSS
What is this?
AddThis Feed Button

Social Bookmarking
- Found on the internet ! -

Oracle workbooks

Download Oracle Books



- Featured ebook -

Database Normalization
by Alf Pedersen

Database Normalization ebook Understand and master how to normalize a database using methods richly documented with graphical ERD and server diagram examples

NoAdware Free Trial

NoAdware Remove
harmful
adware,
spyware,
trojans,
dialers
and worms!
-- FREE --
IT Magazine
Subscriptions

WebSite Magazine WebSite Magazine Practical advice, helpful tools and insights for website owners

Oracle Magazine Oracle Magazine Contains technology strategy articles, sample code, tips, Oracle and partner news, how-to articles for developers and DBAs

Dr Dobb's Journal Dr Dobb's Journal enables coders to write the most efficient programs and help in daily programming quandaries

DM Review DM Review is recognized as the premier business intelligence, analytics and data warehousing publication
Various other Free IT magazine subscriptions

Compile oracle schema steps


Make sure you always test this 'compile oracle schema' package on a test server
before implementing it on a production system !

There will be times when you want to compile a schema which does not belong to you,
or for which you do not have the password.

The solution is to use the dbms_utility package as a DBA user.

Example, if you want to recompile all procedures,functions, packages and triggers belonging to scott
here is how to do it:

SQL> exec dbms_utility.compile_schema(schema=>'SCOTT');
PL/SQL procedure successfully completed.


If you only want to recompile all invalid options, execute it like this :

SQL> exec dbms_utility.compile_schema(schema=>'SCOTT',compile_all=>false);
PL/SQL procedure successfully completed.


If you want to use each object's session settings instead of the calling user's settings:

SQL> exec dbms_utility.compile_schema(schema=>'SCOTT',compile_all=>false, reuse_settings=>true);
PL/SQL procedure successfully completed.


To see if any errors were generated
(you must run this command immediately after executing dbms_utility) :

SQL> show errors
No errors.


Another way to see if the compilations were successful :

SQL> select object_name, object_type from dba_objects where owner = 'SCOTT' and status = 'INVALID';
no rows selected


Recommended reading:

  • Oracle Database PL/SQL Packages and Types Reference, DBMS_UTILITY



  • Return from compile oracle schema back to oracle-script-tutorials.