?
Solved

Oracle -- "compile all for debug" ?

Posted on 2011-05-11
4
Medium Priority
?
1,132 Views
Last Modified: 2013-12-18
The below script compiles all packages.

How can I do a "compile all for debug" ?
----------------------------------------------------------
begin FOR cur IN (SELECT OBJECT_NAME, OBJECT_TYPE, owner FROM all_objects WHERE object_type in

('PACKAGE','PACKAGE BODY') and owner = :OBJECT_OWNER ) LOOP
BEGIN
  if cur.OBJECT_TYPE = 'PACKAGE BODY' then
    EXECUTE IMMEDIATE 'alter package "' || cur.owner || '"."' || cur.OBJECT_NAME || '" compile body';
  else
    EXECUTE IMMEDIATE 'alter ' || cur.OBJECT_TYPE || ' "' || cur.owner || '"."' || cur.OBJECT_NAME || '"

compile';
  end if;
EXCEPTION
  WHEN OTHERS THEN NULL;
END;
end loop; end;
0
Comment
Question by:finance_teacher
4 Comments
 
LVL 18

Accepted Solution

by:
sventhan earned 500 total points
ID: 35740380
Are you using Toad to debug? How do you plan to debug?

If you using toad, its easy to compile all for debug. Just press the Green Bug button and compile the procedures that you need.
0
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 500 total points
ID: 35740389
>>How can I do a "compile all for debug" ?

using that script?  add the word  DEBUG after compile?

http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_2006.htm
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 500 total points
ID: 35740492
alter session set plslq_debug=TRUE  (still works, but deprecated)

recommended...

ALTER SESSION SET PLSQL_CCFLAGS = 'DEBUG:TRUE';



then run your script "as is" to compile all
0
 
LVL 21

Assisted Solution

by:Amitkumar P
Amitkumar P earned 500 total points
ID: 35764864
Add suggested by slightvw, add word DEBUG after word COMPILE.

Refer following block of code. The following block will compile all trigger, procedure, function, package and package body.

begin

FOR cur IN (SELECT OBJECT_NAME, OBJECT_TYPE, owner FROM all_objects WHERE object_type in ('TRIGGER', 'PROCEDURE', 'FUNCTION', 'PACKAGE','PACKAGE BODY') LOOP

BEGIN

  if cur.OBJECT_TYPE = 'PACKAGE BODY' then

    EXECUTE IMMEDIATE 'alter package "' || cur.owner || '"."' || cur.OBJECT_NAME || '" compile debug body';

  else

    EXECUTE IMMEDIATE 'alter ' || cur.OBJECT_TYPE || ' "' || cur.owner || '"."' || cur.OBJECT_NAME || '" compile debug ';

  end if;

EXCEPTION

  WHEN OTHERS THEN NULL;

END;

end loop; end;
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question