ORA-20003 , procedure儲存過程失效問題
.[@more@]
a. 修改儲存過程呼叫的table結構會造成procedure 需用重新編譯 (10g 會自動編譯,不需要人為) 。
b. 儲存過程呼叫另外一個儲存過程,另外一個修改了其中的object,那麼兩個儲存過程都需要重新編譯 (10g 會自動編譯,不需要人為) 。
c. 儲存過程中呼叫的table如果他的同義詞有其他object同名,修改了同名的objects 也注意導致procedure invalid .應當儘量避免建立與PUBLIC同義詞 同名的物件
臨時解決方法:
把 alter pro_name compile 賦給一個字串變數, 然後在程式中 EXECUTE IMMEDIATE (類似於執行SQL一樣) 。
=============================================================
Subject: | ORA-20003: ORU-10036 WHEN CALLING ODESSP() OR DBMS_DESCRIBE.DESCRIBE_PROCEDURE | |||
Doc ID: | Note:1011930.6 | Type: | PROBLEM | |
Last Revision Date: | 15-OCT-2007 | Status: | PUBLISHED |
Checked for relevance on 15-Oct-2007. Problem Description: ==================== You are getting ORA-20003 and ORU-10036 when using the packaged procedure DBMS_DESCRIBE.DESCRIBE_PROCEDURE or the Oracle Call Interface (OCI) function odessp() to describe the parameters of a PL/SQL stored procedure or function. The associated error message is "object X is invalid and can not be described". Example: Here is an example of using DBMS_DESCRIBE.DESCRIBE_PROCEDURE. SQL> declare 2 overload dbms_describe.number_table; 3 position dbms_describe.number_table; 4 levl dbms_describe.number_table; 5 argument_name dbms_describe.varchar2_table; 6 datatype dbms_describe.number_table; 7 default_value dbms_describe.number_table; 8 in_out dbms_describe.number_table; 9 length dbms_describe.number_table; 10 precision dbms_describe.number_table; 11 scale dbms_describe.number_table; 12 radix dbms_describe.number_table; 13 spare dbms_describe.number_table; 14 begin 15 dbms_describe.describe_procedure( 16 'P1', 17 null, 18 null, 19 overload, 20 position, 21 levl, 22 argument_name, 23 datatype, 24 default_value, 25 in_out, 26 length, 27 precision, 28 scale, 29 radix, 30 spare); 31 31 dbms_output.put_line('overload ' || 32 'position ' || 33 'argument ' || 34 'level ' || 35 'datatype ' || 36 'length ' || 37 'prec ' || 38 'scale ' || 39 'rad '); 40 dbms_output.put_line('-------------------------' || 41 '-------------------------' || 42 '-------------------------'); 43 for counter in 1..2 loop 44 dbms_output.put_line( overload(counter) || ' ' || 45 position(counter) || ' ' || 46 argument_name(counter) || ' ' || 47 levl(counter) || ' ' || 48 datatype(counter) || ' ' || 49 length(counter) || ' ' || 50 precision(counter) || ' ' || 51 scale(counter) || ' ' || 52 radix(counter) ); 53 end loop; 54 end; 55 / declare * ERROR at line 1: ORA-20003: ORU-10036: object P1 is invalid and cannot be described ORA-06512: at "SYS.DBMS_DESCRIBE", line 83 ORA-06512: at line 15 Solution Description: ===================== The status of the procedure or function is INVALID. Recompile the procedure/function. The command ALTER PROCEDURECOMPILE; will recompile a stand-alone stored procedure. The command ALTER FUNCTION COMPILE; will recompile a stand-alone store function. The command EXECUTE DBMS_UTILITY.COMPILE_SCHEMA( ); will recompile all stored packages, procedures and functions in the specified schema. The objects are compiled in dependency oder. To see if the status is invalid, check the USER_OBJECTS table. Example: This example selects procedure P1 from the USER_OBJECTS table. As you can see, the status of P1 is INVALID. SQL> select * from user_objects where object_name='P1'; OBJECT_NAME ------------------------------------------------------------------------------ -- OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_ ---------- ------------- --------- --------- TIMESTAMP --------------------------------------------------------------------------- STATUS ------- P1 2114 PROCEDURE 20-SEP-95 20-SEP-95 1995-09-20:10:11:00 INVALID Solution Explanation: ===================== For more information about the ALTER PROECEDURE or ALTER FUNCTION commands, see the Oracle7 Server SQL Reference. For more information about DBMS_UTILITY.COMPILE_SCHEMA(), see the file dbmsutil.sql. On Unix platforms, this file can be found in the $ORACLE_HOME/rdbms/admin directory. For more information about DBMS_DESCRIBE.DESCRIBE_PROCEDURE() see the Oracle7 Server Application Developer's Guide Release 7.2 pages 6-48 to 6-51. You can also find information in the file dbmsdesc.sql which can be found in the $ORACLE_HOME/rdbms/admin directory on Unix platforms.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-1006005/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL 建立儲存過程PROCEDURESQL儲存過程
- PL/SQL 05 儲存過程 procedureSQL儲存過程
- [Procedure]Oracle之分頁儲存過程Oracle儲存過程
- Oracle 基礎 ----procedure(儲存過程)Oracle儲存過程
- 儲存過程問題。。儲存過程
- mysql 儲存過程 procedure 批次建表MySql儲存過程
- oracle父儲存過程呼叫子儲存過程procedure與輸出引數Oracle儲存過程
- mysql檢視儲存過程show procedure status;MySql儲存過程
- MySQL入門--儲存過程(PROCEDURE)和儲存函式(FUNCTION)MySql儲存過程儲存函式Function
- 哪些操作易引起儲存過程失效?儲存過程
- mysql儲存過程procedure、函式function的用法MySql儲存過程函式Function
- 一個儲存過程的問題!儲存過程
- 儲存過程單引號問題儲存過程
- mysql多次呼叫儲存過程的問題MySql儲存過程
- Java呼叫Oracle儲存過程的問題JavaOracle儲存過程
- 達夢儲存過程效能問題定位儲存過程
- oracle procedure 儲存過程輸入及輸出in out示例Oracle儲存過程
- procedure儲存過程呼叫dba字首的字典dba_objects儲存過程Object
- 通過v$access檢視正在執行的儲存過程procedure儲存過程
- MySQL儲存過程的許可權問題MySql儲存過程
- oracle儲存過程!解決網友問題Oracle儲存過程
- Hibernate呼叫oracle儲存過程的問題Oracle儲存過程
- oracle儲存過程(procedure)中執行動態SQL小記Oracle儲存過程SQL
- ORACLE中儲存過程的許可權問題Oracle儲存過程
- MySQL儲存過程中的sql_mode問題MySql儲存過程
- java儲存過程呼叫servlet的授權問題Java儲存過程Servlet
- 呼叫者儲存過程訪問許可權問題儲存過程訪問許可權
- MySQL儲存過程詳解 mysql 儲存過程MySql儲存過程
- 儲存過程儲存過程
- 解決儲存過程擷取錯誤的問題儲存過程
- 儲存過程訪問其他使用者的表的問題儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列一OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列二OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列三OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列四OracleOBJ儲存過程
- oracle底層字典表obj$及source$與儲存過程procedure系列五OracleOBJ儲存過程
- oracle plsql package_body_procedure_構建語法_sp_儲存過程OracleSQLPackage儲存過程
- oracle procedure儲存過程(pl/sql)_使用declare cursor_begin end巢狀Oracle儲存過程SQL巢狀