Recompile all invalid objects in live database

Hi Expers,
Just need a clarification on recompiling all invalid objects in production database when the systems is busy.
i thought of recompile all the invalid objects using utlrp.sql script in my production database since some of few synonyms were invalid after application patch script been implemented last weekeend.
we have identifed the invalid objects now, i thought to run the utlrp.sql, what will be the consequences.
Regards,
Salai

Hi Hemanth,
I'd reserve utlrp.sql for upgrades, downgrades and patchsets. I do agree 101% with above point, I a not denying on that.
If you really have a large number of invalid objects, you might choose to compile a few "selected" objects every hour instead of running a single-shot "compile all invalid objects". Rare but a possible requirement.I came across such requirement during early days of career during pushing product enhancement to production and we would have get to know the things and number of objects which would go invalid as we use to carry out testing on test databases.
I agree completely utlrp.sql is suggested and should opt for.
- Pavan Kumar N

Similar Messages

  • How to recompile all invalid objects of APPS?

    Dear all:
    How to recompile all invalid objects of APPS? my environment is ORACLE 9.2.0.5 32bit.
    Regards
    Terry

    varun4dba wrote:
    hi Terry,
    did you tried adadmin?
    thanks.Do you mean:
    Compile/Reload Database Objects
    1. Compile APPS schema
    2. Compile menu information
    3. Recreate grants and synonyms for APPS schema
    4. Compile flexfield data in AOL tables
    5. Reload JAR files to database
    6. Return to Main Menu

  • CURSOR to recompile all INVALID objects

    Ok, I know I'm using the atler-compile pre-defined trigger here, and I'm cool with that.
    I'm creating an anonymous block to recompile all INVALID objects. I've come up with a basic CURSOR to pull all INVALID objects into the cursor, and then using the alter_compile trigger to recomipile them.
    However, I can't figure out how to call them all into the trigger...One of the inputs for the alter_compile trigger is the name of the object...hwo can I get around that?
    DECLARE
    CURSOR compile_cur
      IS
       SELECT object_name, status
        FROM user_objects
         WHERE status='INVALID';
    BEGIN
    FOR rec_cur IN compile_cur LOOP
      DBMS_DDL.ALTER_COMPILE('PROCEDURE', 'SYSTEM','BB_JOBTEST');
    END LOOP;
    END;
    /

    You can issue a single statement to compile all triggers, procedures, packages, functions in the schema.
    SQL> EXEC DBMS_UTILITY.compile_schema(schema => 'Schema_Name');
    This will compile all the objects regardless of it's current status.
    Shailender Mehta

  • Shell script to validate all invalid objects?

    Hello DBA's.
    New to DBA ing and so seek your help.. I am using oracle Oracle9i Release on a Solaris box.
    I need a shell script that will check all invalid objects on a DB and would validate it by running utlrp.sql. I know i can do this manually but i am asked to automate the process..
    Kindly suggest where i can find a shell script or share this script with me.. it would be much appreciated.
    Regards!

    OK, this is possible, and here is one way entirely within SQL*Plus where it will try once more to recompile invalid objects, please note that this (top one) will work only on 11g or greater, and only getting around to testing this properly now:
    #!/bin/ksh
    . $HOME/.profile
    export ORACLE_SID=<your_SID>
    sqlplus '/ as sysdba' << EOF
    set serveroutput on
    set pagesize 1000
    @${ORACLE_HOME}/rdbms/admin/utlrp.sql
    begin
    for cur  in (select do.owner || '.' || do.object_name module, object_type from dba_objects do join obj$ o on (do.object_id = o.obj#) where o.status = 5)
    loop
    begin
    execute immediate 'alter ' || cur.object_type || ' ' || cur.module  || ' compile';
    exception when others then continue;
    end;
    end loop;
    end;
    spool <path_and_filename_of_your_Invalid_Objects_output_file>
    select do.owner || '.' || do.object_name from dba_objects do join obj$ o on (do.object_id = o.obj#) where o.status = 5;
    spool off
    quit
    EOF
    exit $?For < 11g:
    #!/bin/ksh
    . $HOME/.profile
    export ORACLE_SID=<your_SID>
    sqlplus '/ as sysdba' << EOF
    set serveroutput on
    set pagesize 0
    set heading off
    set termout off
    set feedback off
    @${ORACLE_HOME}/rdbms/admin/utlrp.sql
    spool /tmp/recompile.sql
    begin
    for cur  in (select do.owner || '.' || do.object_name module, object_type from dba_objects do join obj$ o on (do.object_id = o.obj#) where o.status = 5)
    loop
    dbms_output.put_line( 'alter ' || cur.object_type || ' ' || cur.module || ' compile;');
    end loop;
    end;
    spool off
    @/tmp/recompile.sql
    !rm /tmp/recompile.sql
    set heading on
    set termout on
    set pagesize 1000
    spool <path_and_filename_of_your_Invalid_Objects_output_file>
    select do.owner || '.' || do.object_name from dba_objects do join obj$ o on (do.object_id = o.obj#) where o.status = 5;
    spool off
    quit
    EOF
    exit $?Edited by: SeánMacGC on Apr 29, 2009 1:12 PM

  • How to compile all invalid objects in SQL Developer

    Hi
    I am used to PL\SQL Developer and currently I am testing SQL Developer (version 2.1). I have question where can I find in SQL Developer functionality (or how to invoke those functions) like:
    1 ) To list all invalid objects and then compile them.
    2) Invoke window similar to “Command window” in PL\Sql Developer
    Thanks for help
    Groxy

    Could I please revive this and ask how do I use UTL_RECOMP?
    Also, I could not find a description of the icons in SQL Developer. Some procedures are shown with a green plus sign (I am guessing here since I can't make out what it is) on them and the ones that I right-click and compile have this green go away. Can you explain?
    Thanks a lot.

  • To compile all invalid objects

    how we can compile all invalid objects? is there any sample plsql code?

    dbms_utility.compile_schema('shema_name');Please note that from Oracle 9i onwards this does not work. It compiles objects in alphabetical order rather than reverse dependency order, so you may end up with more objects uncompiled than you started with. This change occurred due to the introduction of Java (boo! hiss!) which allows circular dependencies.
    Since then, the only safe way to compile objects is to use the %ORACLE_HOME%\rdbms\admin\utlirp.sql script (which requires sysdba access).
    This has been packaged up in 10gR2 as UTL_RECOMP.
    Thereby proving that searching is easy but finding the right answer is difficult.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • How to delete all users (objects) in 9i database?

    Hi friends:
    I did a full database exp/imp for a dev database, before imp, I need to delete all objects in the old dev database, I know delete one user is
    drop user user_name cascade;
    how about all users (objects)???? in 9i database
    thank you very much

    Hi,
    I will use
    select ' drop user ' ||username|| ' cascade;' from all_users where username not
    in ('SYS','SYSTEM', ‘DBSNMP’);
    Is there any other users I don't need to drop off besides the above three ones?
    thank you very much

  • Invalid object /produres/funtions/triggers/Views/synonyms/

    Can any body forward me the SQL/PLSQL command to check Invalid object /produres/funtions/triggers/Views/synonyms/ and any other invalid object in the db, & what is recommended to deal with that invalid objects. Either i should recompile /Rebuild / Or delete it .
    & How i can do all this work in EM DB control?
    Need help.

    I would not worry much about invalid objects since Oracle will take care of it on next invocation.Up to a point. Oracle will recompile them if they are inmvoked locally. This does not work if they are invoked remotely (say from a distributed transaction or a clinet/server application).
    Also I think it pays to be curious. Why are these objects invalid? At the vey least it suggests to me that soembody has done a release without checking that the database is in a valid state. There is also the possiblility that the objects are in an invalid state because they won't compile. Now that's something we want to know now rather than when some user calls to complain that the application won't work.
    In short, accepting the presence of invalid objects in the database because Oracle will compile them when it next needs them is just living with broken windows, and that's bad practice.
    Cheers, APC

  • How to Compile Sys invalid objects

    Dear,
    We have found one invalid object in our database which owner is SYS.
    How i compile this objects it's OBJECT_TYPE is package_body.
    Please suggest me if any..
    Wting
    Raj

    hello.
    I run this script, but sys's objects again to be with erros:
    OWNER     OBJECT_NAME
    SYS     ALL_WORKSPACES
    SYS     DBA_OUTLINES
    SYS     DBA_OUTLINE_HINTS
    SYS     DBA_WORKSPACES
    SYS     DBA_WORKSPACE_SESSIONS
    SYS     KU$_OUTLINE_VIEW
    SYS     LOGOFF_PROC
    SYS     LT
    SYS     LTADM
    SYS     LTDDL
    SYS     LTDTRG
    SYS     LTPRIV
    SYS     LTRIC
    SYS     LTUTIL
    SYS     LT_CTX_PKG
    SYS     NO_VM_CREATE
    SYS     NO_VM_CREATE_PROC
    SYS     NO_VM_DROP
    SYS     NO_VM_DROP_PROC
    SYS     OUTLN_PKG
    SYS     OWM_DDL_PKG
    SYS     OWM_MIG_PKG
    SYS     OWM_REPUTIL
    SYS     SYS_LOGOFF
    SYS     UD_TRIGS
    SYS     USER_OUTLINES
    SYS     USER_OUTLINE_HINTS
    SYS     USER_WORKSPACES
    SYS     WM$WORKSPACE_SESSIONS_VIEW
    SYS     WM_DDL_UTIL
    SYS     WM_INSTALLATION
    MDSYS     ALL_GEOMETRY_COLUMNS
    MDSYS     ALL_SDO_GEOM_METADATA
    MDSYS     ALL_SDO_INDEX_INFO
    MDSYS     ALL_SDO_INDEX_METADATA
    MDSYS     ALL_SDO_LRS_METADATA
    MDSYS     ALL_SDO_MAPS
    MDSYS     ALL_SDO_STYLES
    MDSYS     ALL_SDO_THEMES
    MDSYS     DBA_GEOMETRY_COLUMNS
    MDSYS     DBA_SDO_GEOM_METADATA
    MDSYS     DBA_SDO_INDEX_INFO
    MDSYS     DBA_SDO_INDEX_METADATA
    MDSYS     DBA_SDO_LRS_METADATA
    MDSYS     DBA_SDO_MAPS
    MDSYS     DBA_SDO_STYLES
    MDSYS     DBA_SDO_THEMES
    MDSYS     GEODETIC_SRIDS
    MDSYS     MD2
    MDSYS     SDO_CATALOG
    MDSYS     SDO_GEOM_TRIG_DEL1
    MDSYS     SDO_GEOM_TRIG_INS1
    MDSYS     SDO_GEOM_TRIG_UPD1
    MDSYS     SDO_LRS_TRIG_DEL
    MDSYS     SDO_LRS_TRIG_INS
    MDSYS     SDO_LRS_TRIG_UPD
    MDSYS     SDO_META
    MDSYS     SDO_MIGRATE
    MDSYS     SDO_RELATEMASK_TABLE
    MDSYS     SDO_RELATE_MASK
    MDSYS     TRANSFORM_MAP
    MDSYS     USER_GEOMETRY_COLUMNS
    MDSYS     USER_SDO_GEOM_METADATA
    MDSYS     USER_SDO_INDEX_INFO
    MDSYS     USER_SDO_INDEX_METADATA
    MDSYS     USER_SDO_LRS_METADATA
    MDSYS     USER_SDO_MAPS
    MDSYS     USER_SDO_STYLES
    MDSYS     USER_SDO_THEMES
    Can I help you? thanks.
    Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production

  • Unable to create or update object after creating database

    I have installed Oracle 8.1.6 on a Solaris server (with documentation, cause I'm not expert of Unix).
    Next I have created a database and a user (with the doc too !!)
    I can make select on all the objects of this database (system tables for example). I have created one test table without any problem. Now I can't create any table or update the table on the server or on a client (the sql + froze). The select orders work. I tried to restard the server but the problem is the same.
    Thank you very much for your help

    There are no error ! (alert.log)
    The sql plus (on the client or on the server) froze when I launch the create or update command. The select command works.
    Thank you very much.

  • Finding Invalid objects in schema

    Dear All,
    How to find all invalid objects in an paticular schema
    Regards,
    Raju

    Hello Raju
    SQL> select object_type,count(*) from user_objects where status = 'INVALID'
    2 group by object_type;
    OBJECT_TYPE COUNT(*)
    PACKAGE BODY 4
    PROCEDURE 61
    VIEW 3
    next, as sys
    exec dbms_utility.compile_schema( 'ACCOUNTS' );
    PL/SQL procedure successfully completed.
    then,
    connect accounts
    SQL> select object_type,count(*) from user_objects where status = 'INVALID'
    group by object_type;
    OBJECT_TYPE COUNT(*)
    PACKAGE BODY 1
    PROCEDURE 182
    VIEW 3
    try this
    Ravi
    http://dbaoraclefaqs.blogspot.com/

  • Is it ok to apply patch with invalid Objects?--Urgent

    hello,
    DB: 10.1.0.3.0
    Patch: P4751926
    OS: Linux
    I have seven invlaid objects.
    Is it ok to apply patch with invalid Objects?
    sys.LEAF_CATEGORY_TYP------------------------------------TYPE BODY
    sys.CUSTOMER_TYP----------------------------------------------TYPE
    sys.CATALOG_TYP-------------------------------------------------TYPE BODY
    sys.COMPOSITE_CATEGORY_TYP-------------------------TYPE BODY
    sys.DBMS_STATS---------------------------------------------------PACKAGE BODY
    sys.DBMS_STATS_INTERNAL--------------------------------- PACKAGE BODY
    PUBLIC.DBMS_XDBUTIL_INT------------------------------------SYNONYM
    DN

    did u try to recompile the invalid objects with the utlrp.sql script? (the script is under, <oracle_home>/rdbms/admin
    your dbms_stats is invalid, and that package is needed for getting the statistics so better to have it valid than invalid.

  • [SAP CRM] How to get just the hit count of objects with a database query?

    Hello,
    i need help. For performance reasons I dont want to get the query result with all the objects from the database. I just want to send a request / query to the database in order to know how many entries are there available with my search parameters.
    At the moment I load all the objects via class cl_crm_bol_dquery_service and the method get_query_result in an internal collection. And after that I call the method size in my collection object. But to gain better performance I just want to know the count. With standardized select statements I would take the select count statement, but in this case it is not possible.
    So I tried to call the retrieve_hit_count method, but I will receive the exception cx_sy_no_handler anytime.
    I would be very pleased to receive an answer <removed by moderator>.
    Thank you very much!
    Marcus
    Edited by: Thomas Zloch on Feb 16, 2011 1:45 PM - priority normalised

    It will be 0 before the call method statement and 1 during exception handling.
    The exception starts in CL_CRM_BOL_DQUERY_SERVICE=>RETRIEVE_HIT_COUNT when the system tried to perform the following statement:
      Return hit count if already available
        rv_hit_count = me->handle->get_hit_count( ).
    The handle variable seems to be empty. But why?
    Edited by: Marcus Findeisen on Feb 17, 2011 9:24 AM
    Edited by: Marcus Findeisen on Feb 17, 2011 9:27 AM

  • Copy Users/Permissions/objects from a database to another database

    Can anyone help me how to copy users, permissions, stored procedures, views, functions and all other objects from one database to another database.
     I need a SQL Script to get this job done. I cannot use backup restore or SSIS Package.

    There's also a transfer sqlserver objects task available in SSIS
    http://www.mssqltips.com/sqlservertip/2064/transfer-database-task-and-transfer-sql-server-objects-task-in-ssis/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Script to copy all the objects within a Stored Procedure

    I am trying to copy all the objects from one database to another using Scripts. Now I need to put that script inside a Stored Procedure.
    Thanks.

    Refer this vbscript to generate all object scripts programatically,
    http://www.codeproject.com/Articles/16195/How-to-Script-Out-SQL-Server-Objects
    or
    Using SSMS
    http://msdn.microsoft.com/en-IN/library/hh245282.aspx#GenPubScriptWiz
    Regards, RSingh

Maybe you are looking for

  • Palette not updated with user.lib files

    I took a certified driver file, put it in user.lib, rename the project file and containing folder. I opened the renamed project, change the VI icon colors of all project files, relink all missing files to user.lib directory, saved all the files, save

  • How to set checkbox to fill max or min value in field

    Hi all, I am pretty new to the adobe acrobat and I just created my first pdf form. I would ask for a help: In this form I have 2 fields where in one is price with VAT and in other without VAT. I also have a check box and total price field in form. I

  • Nokia E51 struct in offline mode....

    Hi, My Nokia E51 structs in offline mode...when I try to switch to general or other profiles.. E51 hangs & switches off.I have given it to Nokia customer care.. But they couldn't able to resolve it... As offline mode.. Music player & otherthing works

  • Compressor 4.1 - Export to WMV (Flip4Mac)

    Hi all, I have Flip4Mac Studio Pro HD. Upgrading to Compressor 4.1 from 4.0.1 I can no longer find the panel to select WMV as an export component. I have upgraded to the latest Flip4Mac version. Any ideas? Thanks heaps in advance

  • How would I build an online directory in cs3

    Could anyone tell me if it is possible to build a directory site in cs3. It would work like a service directory. Clients could login and fill out a form which would update their profile. their profile and picture would then be listed on the site. Is