alter package/procedure
今天狀態非常不好,頭暈的要命。簡單記錄一下。
今天pl/sql challenge出的題目是關於package中刪除一個儲存過程的,打完看了一下oracle文件,完全錯了。
首先,package中並不需要有執行部分,也就是說不用
“begin
……”
只包含儲存過程就行了,把呼叫放到其他過程或匿名塊中就ok。
其次,alter package沒有刪除procedure的語法,以下是文件截圖:
不指定schema時預設是當前schema
debug與在compiler_parameters_clause中指定PLSQL_DEBUG = TRUE效果相同,保留資訊用於pl/sql debugger
package、specification、body分別指定了對整個包、包宣告、包體進行重編譯。
compiler_parameters_clause:可以指定PLSQL_OPTIMIZE_LEVEL, PLSQL_
CODE_TYPE, PLSQL_DEBUG, PLSQL_WARNINGS, and NLS_LENGTH_SEMANTICS.,每個引數在語句中只能指定一次,對指定的包生效,如果要指定所有包,需要使用alter session或alter system命令
reuse settings:保留當前的編譯選項設定
看來不能用alter語句進行儲存過程刪除等操作。
實驗:
SQL> alter package pck_ref compile;
Package altered
During recompilation, Oracle Database drops all persistent compiler switch
settings, retrieves them again from the session, and stores them at the end of
compilation. To avoid this process, specify the REUSE SETTINGS clause.
SQL> alter package pck_ ref compile reuse settings;
Package altered
當發生編譯錯誤時,可以用show error檢視
SQL> alter package pck _ref compile reuse settings;
Warning: Package altered with compilation errors
SQL> show error;
No errors for PACKAGE NBSCMP.PCK_ REF
與包的修改選項類似,可以使用alter procedure命令:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26451536/viewspace-751755/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-04042 procedure, function, package, or package body does not existFunctionPackage
- Oracle procedure,package,function,triger 閃回 恢復OraclePackageFunction
- ALTER PACKAGE "p_b" COMPILE and ora-07445PackageCompile
- Orale的struct,array,cursor,stored procedure,function,package的用法例子StructFunctionPackage
- Oracle 過程(Procedure)、函式(Function)、包(Package)、觸發器(Trigger)Oracle函式FunctionPackage觸發器
- oracle plsql package_body_procedure_構建語法_sp_儲存過程OracleSQLPackage儲存過程
- [zt] sys_refcursor實現procedure直接返回結果集不必通過packagePackage
- Oracle 查詢某一個包體’PACKAGE BODY‘中包含PROCEDURE/FUNCTION的名稱有哪些OraclePackageFunction
- alter database和alter system和alter session的區別DatabaseSession
- Procedure加密加密
- not an rpm package (or package manifest):Package
- not an rpm package (or package manifest)Package
- 觸發器trigger中呼叫包package(包中含:儲存過程procedure及函式function)_plsql觸發器Package儲存過程函式FunctionSQL
- Oracle Wrap ProcedureOracle
- packagePackage
- Package Specification 和 Package Body 及 Package有什麼區別? (轉)Package
- 深入安卓Package Manager和Package Installer安卓Package
- MySQL中使用procedureMySql
- 怎樣加密procedure加密
- sql primary key procedureSQL
- alter system events與alter system event的區別
- 建立packagePackage
- SQL__ALTERSQL
- MySQL ALTER命令MySql
- alter session setSession
- Alter table for ORACLEOracle
- alter database in OracleDatabaseOracle
- Alter system in OracleOracle
- Package ssh is not available, but is referred to by another package 錯誤PackageAI
- alter table move 和 alter table shrink space的區別
- [alter system dump學習1]alter system dump logfile
- alter system archive log current和alter system switch logfileHive
- ALTER DATABASE 與 ALTER TABLESPACE OFFLINE的區別Database
- Procedure to create Distribution model
- DELETE_TABLE_STATS Proceduredelete
- Image Noise Reduction Develop Proceduredev
- Procedure for Setting Partner FunctionsFunction
- How to rename an Oracle stored procedureOracle