|
|

楼主 |
发表于 2008/2/10 23:19:34
|
显示全部楼层
主题: Getting Rid Of Those Pesky Invalid Objects In Oracle Applications
文档 ID: 注释:60966.1 类型: TROUBLESHOOTING
上次修订日期: 10-JAN-2008 状态: PUBLISHED
Checked for relevance on 10-January-2008
Getting Rid Of Those Pesky Invalid Objects
===========================================
Invalid objects may be created when running an install, an upgrade, a patch or
even some user activities. Many of these errors and/or problems can be directly
linked to these invalid objects, so cleaning them up is very important for
problem resolution.
Follow these steps to attempt to validate the invalid objects:
Step 1
------
Use this SQL script to determine the extent of the invalid object situation:
$ sqlplus system/manager
SQL> select owner, count(*) from dba_objects where status = 'INVALID'
group by owner;
OWNER COUNT(*)
------------------------------ ----------
APPS 218
INV 1
SYS 3
SYSTEM 1
Step 2
------
Compile the invalid objects using one of the following three methods:
Method 1 - use the generic AD tools script adcompsc.pls
$ sqlplus inv/inv
SQL> @$AD_TOP/sql/adcompsc.pls inv inv ""
Method 2 - for invalid objects which are specifically owned by the # apps
schema, use the adadmin option for compiling the apps schema.
Run adadmin and choose the 'Maintain Application Database Objects' option
from the adadmin main menu. Next, choose the 'Compile APPS schema(s)' option
from the Database menu. This option will batch up workers to compile the
invalid objects.
Method 3 - if there are only a couple of invalid objects you can compile
each one manually.
$ sqlplus system/manager
SQL> alter package APPS.PTE_CORE compile;
Step 3
------
Loop back through Step one and two a couple of times if you are not successful
in dropping the number of invalid objects.
Step 4
------
If some objects are problematic, you can check the errors that the compilation
is receiving by doing the following:
SQL> select * from dba_errors where name = 'PTE_CORE';
OWNER NAME TYPE SEQUENCE LINE POSITION
TEXT
----------------------------------------------------------------------
APPS PTE_CORE PACKAGE 1 46 36
PLS-00201: identifier 'FND_APPLICATION.APPLICATION_SHORT_NAME' must be
declared
APPS PTE_CORE PACKAGE 2 45 3
PL/SQL: Declaration ignored
Step 5
------
If you are getting lots of problems with 'identifier must be declared'
then you may need to check for dependencies. Return to Steps one and two
again if needed.
Follow the dependencies until the packages are no longer dependent on each
other.
$ sqlplus system/manager
SQL> select owner, object_type, object_name from dba_objects where
status = 'INVALID' and object_name in (select referenced_name
from dba_dependencies where name = 'BAD_PACKAGE');
Step 6
------
Run the scripts for building and/or seeding the invalid objects manually.
Go to Step seven for views and triggers.
A. Get the name of the invalid objects by using the build script which
follows:
$ sqlplus apps/apps
SQL> select * from dba_source where name = 'PTE_CORE' and line = 2;
OWNER NAME TYPE LINE
TEXT
----------------------------------------------------------------------
APPS PTE_CORE PACKAGE 2
/* $Header: PAPTEXXS.pls 41.0 96/10/28 23:20:01 porting ship $ */
APPS PTE_CORE PACKAGE BODY 2
/* $Header: PAPTEXXB.pls 41.3 96/10/28 23:20:00 porting ship $ */
B. Locate the build script on the system as follows:
$ find $APPL_TOP -name PAPTEXXS.pls
/ora/prod/10.7/PROD/pa/4.1.20/admin/sql/PAPTEXXS.pls
If you are on a PC, use whatever find utility is available.
C. Navigate to that directory (recommended) as follows:
$ cd $PA_TOP/admin/sql
D. Run the scripts. For packages, run the #####S.pls then the #####B.pls.
$ sqlplus apps/apps
SQL> @PAPTEXXS.pls
$ sqlplus apps/apps
SQL> @PAPTEXXB.pls
Step 7
------
Locate the build script for invalid views and triggers on the system.
A. First, locate the SQL directories for your particular schema.
$ find $AR_TOP -name sql
./admin/sql
./sql
./patchsc/107/sql
If you are on a PC, use whatever find utility is available.
B. Find the build script, using both uppercase and lowercase versions of
the view or trigger name for a search key.
$ grep ra_customer_trx_partial_v ./sql/*
$ grep ra_customer_trx_partial_v ./patchsc/107/sql/*
arvtmaiv.sql ROMPT Creating view ra_customer_trx_partial_v
arvtmaiv.sql:create or replace force view ra_customer_trx_partial_v
arvtmaiv.sql: from ra_customer_trx_partial_v ctp,
If you are on a PC, use whatever search utility is available.
C. Paste out the section that rebuilds the view and run it manually.
SQL> @temp_view_rebuild_script
Additional References
=====================
Note 74660.1 Resolving Invalid Objects in Oracle Applications
Note 163265.1 Invalid Objects List Script |
|