How to recompile the entire schema's INVALID objects in one go?

Hi,
How to recompile the entire schema's invalid database objects (such as package, function, procedure, trigger etc) in one go?
Please advise.
Thank you.

I often use this SQL.
select 'Alter ' || OBJECT_TYPE || ' ' || OBJECT_NAME || ' compile;' as DDL
  from user_objects
where STATUS = 'INVALID';I sometimes use this SQL.
declare
    WK_InvalidCount     pls_Integer :=0;
    WK_PrevInvalidCount pls_Integer :=0;
begin
    loop
        for rec_work in (select a.object_type,a.object_name from user_objects a ,user_object_size b
                         where  a.status='INVALID' and a.object_name=b.name order by b.code_size
                        ) loop
            dbms_ddl.alter_compile(rec_work.object_type,user,rec_work.object_name);
            DBMS_Output.Put_Line(rec_work.object_name || 'is recompiles');
        end loop;
        select count(*) into WK_InvalidCount from user_objects where status='INVALID';
        if WK_InvalidCount=0 then
            DBMS_Output.Put_Line('InvalidObject none');
            exit;
        elsif WK_InvalidCount != WK_PrevInvalidCount then
            WK_PrevInvalidCount := WK_InvalidCount;
        else
            DBMS_Output.Put_Line('InvalidObjects remain' || to_char(WK_InvalidCount));
            exit;
        end if;
    end loop;
end;
/

Similar Messages

  • Inline plsql_optimize_level=3 and recompiling the sys schema??

    Has anyone messed around with 11g’s new inline pragma?
    I turned it on in a few packages which contains a lot of looping and it reduced the number subprocedure calls in the order of a few thousand. Because the db mainly servers web pages via mod_plsql, I found it to make pages just a tad snappier.
    It seemed to work pretty well that I altered the system with plsql_optimize_level=3 and recompiled the entire schema.
    This along with native compilation has made the website run the fastest I’ve ever seen it run. (I’ve already tuned sql statements and the sga size, so it was already running pretty fast.) Now it's just crazy quick.
    I only wish that standalone functions would also get “inlined”. I have a few functions like “format_money()” which will not get inlined unless they moved inside of packages (or in the declaration of calling standalone procedure).
    I’m wondering if anyone has set plsql_optimize_level=3 and recompiled the system schema? I recompiled sys.htp, sys.htf and sys.owa* packages just for fun. I didn’t do any metrics to gage the speed up. Just going off of feel, it does appear just a tad faster.
    I'm considering recompiling the entie sys schema and wondering if anyone has done this or recommends it?
    Edited by: brian.mcginity on Oct 9, 2011 12:59 PM

    Hi Ravshan,
    I thought a workaround would be to create a sql script like the following:
    alter session set plsql_code_type=native;
    alter session set plsql_optimize_level=3;  then point to it in the setting for Tools|Preferences|Database|Filename for connection startup script. That doesn't work however, as the other preference setting for plsql_optimize_level overrides the session value of 3 during compilation from the UI.
    According to Oracle documentation, level 3 was added for Oracle 11g. Prior to that, the same effect could be achieved by level 2 in conjunction with the INLINE pragma in the PL/SQL code.
    You might want to make a feature request for this on the SQL Developer Exchange so the community can vote and comment.
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 6, 2012 2:32 PM
    And, of course, Compile for Debug does not work with the 'native' setting.

  • How to find the DB schema of XI DB tables to operate on the XI DB table

    Hi all,
    I have to execute some queries on internal XI DB. For this I need the schema name of the DB table where the data about the message is available. Can anyone tell, how to find the DB schema-name of the DB table? I have PI 7.1 system with internalDB.
    How to access the DB of the PI 7.1 system using NWA?
    Regards,
    Soorya

    Hi,
    The PI 7.1 Server shall definitely posses a Database. This Database shall have the ABAP and Java Dictionary tables in 2 different database schemas.You sholud be getting the names of the schema from the basis team supporting your server.
    I hope your are referring to the Java DB Schema for access. In order to get the schema name for the Java Dictionary, you should have access to the NetWeaver Adminstrator (NWA) of the PI Server.
    Logon to NWA, navigate to Configuration Management --> Infrastructure --> Application Resources. Select the Resurce Type to show as JDBC Drivers. Select the system driver and click on Dependent JDBC Datasources. This table should give you the schema name of the Java Table Storage of the PI 7.1 server.
    Regards,
    Alka.

  • How to get the current schema name

    Hi,
    Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
    Thanks
    Jogesh

    ok folks, I found the answer at Tom's as usual.
    http://asktom.oracle.com/tkyte/who_called_me/index.html
    I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
    cheers,
    paul
    create or replace
    FUNCTION SELF_EXAM (
       p_call_stack VARCHAR2,
       p_type VARCHAR2 DEFAULT 'SCHEMA'
    ) RETURN VARCHAR2
    AS
       str_stack   VARCHAR2(4000);
       int_n       PLS_INTEGER;
       str_line    VARCHAR2(255);
       found_stack BOOLEAN DEFAULT FALSE;
       int_cnt     PLS_INTEGER := 0;
       str_caller  VARCHAR2(30);
       str_name    VARCHAR2(30);
       str_owner   VARCHAR2(30);
       str_type    VARCHAR2(30);
    BEGIN
       str_stack := p_call_stack;
       -- Loop through each line of the call stack
       LOOP
         int_n := INSTR( str_stack, chr(10) );
         EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
         -- get the line
         str_line := SUBSTR( str_stack, 1, int_n - 1 );
         -- remove the line from the stack str
         str_stack := substr( str_stack, int_n + 1 );
         IF NOT found_stack
         THEN
            IF str_line like '%handle%number%name%'
            THEN
               found_stack := TRUE;
            END IF;
         ELSE
            int_cnt := int_cnt + 1;
             -- cnt = 1 is ME
             -- cnt = 2 is MY Caller
             -- cnt = 3 is Their Caller
             IF int_cnt = 1
             THEN
                str_line := SUBSTR( str_line, 22 );
                dbms_output.put_line('->' || str_line);
                IF str_line LIKE 'pr%'
                THEN
                   int_n := LENGTH('procedure ');
                ELSIF str_line LIKE 'fun%'
                THEN
                   int_n := LENGTH('function ');
                ELSIF str_line LIKE 'package body%'
                THEN
                   int_n := LENGTH('package body ');
                ELSIF str_line LIKE 'pack%'
                THEN
                   int_n := LENGTH('package ');
                ELSIF str_line LIKE 'anonymous%'
                THEN
                   int_n := LENGTH('anonymous block ');
                ELSE
                   int_n := null;
                END IF;
                IF int_n IS NOT NULL
                THEN
                   str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
                 ELSE
                   str_type := 'TRIGGER';
                 END IF;
                 str_line  := SUBSTR( str_line, NVL(int_n,1) );
                 int_n     := INSTR( str_line, '.' );
                 str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
                 str_name  := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
              END IF;
           END IF;
       END LOOP;
       IF UPPER(p_type) = 'NAME'
       THEN
          RETURN str_name;
       ELSIF UPPER(p_type) = 'SCHEMA.NAME'
       OR    UPPER(p_type) = 'OWNER.NAME'
       THEN
          RETURN str_owner || '.' || str_name;
       ELSIF UPPER(p_type) = 'TYPE'
       THEN
          RETURN str_type;
       ELSE
          RETURN str_owner;
       END IF;
    END SELF_EXAM;

  • How to download the entire creative suite

    how to download the entire creative suite cs6 design suite and web premium from download center?

    Go to http://www.adobe.com/go/tryincopy and click the Download button. The Adobe Download Assistant will popup and handle it from there.

  • How to make the entire project in the project server 2013 reschedule؟

    How to make the entire project in the project server 2013 reschedule ?
    Because item %compelet related to reschedule
    In this photo it is known there are no items update project

    Hi,
    In PWA, you do not have the feature to update the project plan in one click, meaning marking as completed the work before the status date or reschedule after the status date the remaining work. Either you have to use Project Pro, or edit individually the
    assignments with the actual work (if not comming from timesheets) and remaining work.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How to display the entire application in two different languages in apex

    Hi,
    How to display the entire application in two different languages in apex...
    For example i need to display each item in both English and Hindi..
    To achieve this initially i have the select the language otherwise the item label alone ll be displayed in both languages ...
    Anyhow how it ll be apex is it possible
    Regards,
    Pavan

    Hi pars,
    http://www.packtpub.com/sites/default/files/1346-chapter-6-creating-multilingual-apex-applications.pdf?utm_source=packtp…
    In this link also i struck in
    In page 10  of that document
    The application is now ready to be translated. Everything is in place to run it in any language imaginable.To ca ll the application in another language, change the URL of your application to the following:
    http://yourdomain:port/pls/apex/f?p=&APP_ID.:&PAGE_ID.:&SESSION_ID.:LANG:NO::FSP_LANGUAGE_PREFERENCE:nl
    This example will call the chosen page in the application and show it in the Dutch language instead of in English. To select another language change the property nl at the end of the URL to your desired language code.
    Thanks alot for ur suggestions.kindly provide more inputs..............

  • How to recompile the COBOL files?

    Hi All,
    Can any one provide documentation for how to recompile the COBOL files by using Net Express 5.1 in command prompt?
    Thanks in advance.
    Thanks & Regards,
    Siva Prasad B

    1. Set up two environment variables, PS_HOME and COBROOT, on the machine from which you'll compile COBOL. (This should be either your file server or a machine that has access to your file server.) You can do this from a DOS command prompt window.
    set PS_HOME=C:\hr840
    set COBROOT=c:\netexpress\base
    2. Open a DOS command prompt window if you do not have one open already, and change directories to
    <PS_HOME>\Setup.
    3. Execute CBLBLD.BAT as follows
    cblbld <compile drive> <compile directory>
    where <compile drive> is the drive where the compile takes place, <compile directory> is the temp
    directory where the compile takes place
    The CBLBLD.BAT file will create the compile directory for you if it does not already exist.
    Note. Make sure to include a space between the <compile drive> and <compile directory> parameters; they are treated as two different parameters within the CBLBLD.BAT batch program. Also ensure that you have write permission to <compile drive> and <compile directory> as the compile process will take place there.
    For example, the following command will take the COBOL source from <PS_HOME>\src\cbl and do the compile process under c:\temp\compile:
    cblbld c: \temp\compile
    Make note of the information that is displayed on the screen while the process is running; it provides the locations of important files that you will need to examine.

  • Aggregate of all Columns in each table for the entire schema

    I want to calculate the report of Aggregate of all Columns in each table for the entire schema in Oracle. Pls let me know which approach is best to do this.
    Thanks in advance !!

    Not sure about your requirement..
    This?
    select table_name,sum(data_length) sm
    from user_tab_cols
    group by table_name;                                                                                                                                                                                                                                                                           

  • TS1307 My email won't send as when it was set up an extra letter was accidentally inserted in the address. I need to know how to remove the entire email address and start a fresh.

    My email won't send as when it was set up an extra letter was accidentally inserted in the address. I need to know how to remove the entire email address and start a fresh.

    Launch Mail.app, select Mail > Preferences... > Accounts and select the account you need to edit in the left column.
    The receiving information will be displayed for the selected Account, with a pop-up selector for the Outgoing Mail Server (SMTP) toward the bottom.  That selector shows which mail server will be used with this account; to send mail. 
    Click and hold on that selector, and scroll down (holding the mouse or trackpad clicked) to Edit Mail Server List... and you'll get a sheet dropping down with the mail servers listed. 
    Select the problematic mail server, and edit it using the Account Information and Advanced items on that sheet.

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How to change the size of a particular object in the picture?

    How to change the size of a particular object in the picture?

    You need to select it.  Copy that selection to a new layer, and use Free Transform to resize it.
    http://www.youtube.com/watch?v=qWpAGmwhllQ
    http://www.youtube.com/watch?v=Bi4jJnYLkUA

  • How to get the selection parameters from logical database into one of the t

    Hi Sap ABAP Champians,
    How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
    Please help me for this
    Thanks
    Basu

    Hi
    Thanks, that will work, but then I'll have to insert code into all my reports.
    I can see that "Application Server Control Console" is able to rerun a report.
    This must mean that the Report Server has access to the runtime parameters.
    But how?
    Cheers
    Nils Peter

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • How to increase the number of data Business Object can pull for a report?

    Hi,
    I would like to ask around how to increase the number of data Business Object can pull for a report. I have a report which pulls data depending on the date range (ex. From 01/01/2007 - 01/10/2007). But, when the data that is pulled exceeds 5000, the report fails. Is there anyway to increase the number of data that BO can pull?
    Thanks

    Bobby,
       to my knowledge we can't change that. Let me explain this, we have setting in the source system for DS default Data Transfer. there we will assign the processes. if you want to assign 4 you need to change the setting in the source system. For flat files we can change in BW System. We can maintain the setting in the Infopackage level(wht we are assigned in the Source System), but we can't change the process.
    in order to check the setting in source system  SBIW--> General Settings --> Control Parameters for Data Transfer.
    we need to change here, this will effect to all the Data Sources. Before making changes check with your basis.
    All the best.
    Regards,
    Nagesh Ganisetti.

Maybe you are looking for