![]() ![]() WHERE object_type IN ('PACKAGE', 'PACKAGE BODY')ĮXECUTE IMMEDIATE 'ALTER ' || cur_rec.object_type || The following example identifies and recompiles invalid packages and package bodies. One approach is to write a custom script to identify and compile the invalid objects. In some situations you may have to compile many invalid objects in one go. This method is limited to PL/SQL objects, so it is not applicable for views. Notice that the package body is compiled in the same way as the package specification, with the addition of the word "BODY" at the end of the command.Īn alternative approach is to use the DBMS_DDL package to perform the recompilations.ĮXEC DBMS_DDL.alter_compile('PACKAGE', 'MY_SCHEMA', 'MY_PACKAGE') ĮXEC DBMS_DDL.alter_compile('PACKAGE BODY', 'MY_SCHEMA', 'MY_PACKAGE') ĮXEC DBMS_DDL.alter_compile('PROCEDURE', 'MY_SCHEMA', 'MY_PROCEDURE') ĮXEC DBMS_DDL.alter_compile('FUNCTION', 'MY_SCHEMA', 'MY_FUNCTION') ĮXEC DBMS_DDL.alter_compile('TRIGGER', 'MY_SCHEMA', 'MY_TRIGGER') The following example shows the compile syntax for several object types. The Manual Approachįor small numbers of objects you may decide that a manual recompilation is sufficient. With this information you can decide which of the following recompilation methods is suitable for you. ORDER BY owner, object_type, object_name ![]() The DBA_OBJECTS view can be used to identify invalid objects using the following query. This article presents several methods for recompiling invalid schema objects. It also allows you to identify if any changes have broken your code base. For this reason it makes sense to recompile invalid objects in advance of user calls. Provided these changes don't cause compilation failures the objects will be revalidated by on-demand automatic recompilation, but this can take an unacceptable time to complete, especially where complex dependencies are present. Operations such as upgrades, patches and DDL changes can invalidate schema objects. Home » Articles » Misc » Here Recompiling Invalid Schema Objects ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |