How to compile all packages - Is a single command available in ora8

scope_creep
scope_creep used Ask the Experts™
on
Fairly simple question.

Ive a need to compile/recomplile all pl/sql packages under a single user in Oracle 8. How can I do it.

I know I can extract out each package name etc, and create a file of compile <package>
             
but is there a command that when issued, will go away for a few hours and compile all packages/pocedures

like

compile all_packages <user>

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,

DBMS_UTILITY.COMPILE_SCHEMA (
   schema VARCHAR2);
Daniel StanleyDatabase engineer

Commented:
something like this will work as well, and will not take hours; more like minutes.

open sql*plus prompt:

set pagsize 0
spool compile_pkg.run
select 'alter package ' || owner || '.'|| object_name || ' compile;'
from all_objects
where object_type = 'PACKAGE'
and owner = '&OWNER';
spool off
@compile_pkg.run


good luck,
daniels@asix.com
if we go into details of this we have to acheave objects dependencies. So, in the common it is not as simple as drs66 said, but sometimes it works :)

Commented:
Apply the below SQL commands ..

SET HEADING OFF;
SET LONG 1000;
SET LINESIZE 1000;

SPOOL C:\Recompile.Sql

select  'alter '||decode(object_type, 'PACKAGE BODY', 'package', object_type) ||' '||OWNER||'.'||object_name||' compile' ||decode(object_type, 'PACKAGE BODY', ' body;', ';')
from   dba_objects
where  status = 'INVALID'
order by object_type,object_name;

spool off;
Start C:\Recompile.Sql
host del C:\T03.SQL


Thanx
Ammar

Commented:
Or to recompile all packages in the database use $ORACLE_HOME/rdbms/admin/utlrp.sql

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial