Site search

Categories

Archives

Tags





The GNU/Linux Advanced Administration

Free Linux Manuals !


A Newbie's Getting Started Guide to Linux

-- FREE --
IT Magazine
Subscriptions

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

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

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
NoAdware Free Trial

NoAdware Remove
harmful
adware,
spyware,
trojans,
dialers
and worms!
- 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

RSS
XML RSS
What is this?
AddThis Feed Button

Social
Bookmarking


Compile another’s Oracle schema

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: