ORA-04042 procedure, function, package, or package body does not exist
小白今天以sys使用者執行一條sql語句,報錯如下:
GRANT EXECUTE ON SYS.KILL_SESSION TO wsj;
*ERROR at line 1:
ORA-04042: procedure, function, package, or package body does not exist
報錯資訊顯示,某個儲存過程,函式,package,package body不存在,小白細想了一下,這裡所說的錯誤物件應該是SYS.KILL_SESSION,而sys是使用者,也就是說sys使用者下,沒有KILL_SESSION的儲存過程或者函式或者package或者package body??
於是小白去另外一個環境linux01中執行了sql語句:GRANT EXECUTE ON SYS.KILL_SESSION TO wsj; 執行成功,在linux101上面檢視了一下KILL_SESSION到底是什麼物件,查詢結果:Procedure
在linux101上面找到了KILL_SESSION相應的sql語句,如下:
create or replace procedure kill_session
(
sessionid in varchar2 --session id
)
is
session varchar2(200);
str1 varchar2(255);
str2 varchar2(255);
begin
session := sessionid;
str1 := ' alter system kill session ';
str2 := str1 || '''' || session || '''';
--dbms_output.put_line(str2);
execute immediate str2;
end kill_session;
在那個sql語句執行不了的環境把上面德sql刷進去,問題解決:
SQL> grant EXECUTE ON SYS.KILL_SESSION TO wsj;
Grant succeeded.
相關文章
- alter package/procedurePackage
- Oracle procedure,package,function,triger 閃回 恢復OraclePackageFunction
- Oracle 查詢某一個包體’PACKAGE BODY‘中包含PROCEDURE/FUNCTION的名稱有哪些OraclePackageFunction
- Package Specification 和 Package Body 及 Package有什麼區別? (轉)Package
- Orale的struct,array,cursor,stored procedure,function,package的用法例子StructFunctionPackage
- oracle plsql package_body_procedure_構建語法_sp_儲存過程OracleSQLPackage儲存過程
- Oracle 過程(Procedure)、函式(Function)、包(Package)、觸發器(Trigger)Oracle函式FunctionPackage觸發器
- 包頭(Package)與包體(Package body)的學習與應用Package
- 如何處理Eclipse錯誤訊息 The declared package does not match the expected packageEclipsePackage
- create or replace package body DBMS_ASSERT wrappedPackageAPP
- dbms_scheduler package body INVALID 解決方案Package
- user_dependencies_trigger_view_package_body依賴ViewPackage
- not an rpm package (or package manifest):Package
- not an rpm package (or package manifest)Package
- packagePackage
- ORA-04063: package body "SYS.DBMS_EXPORT_EXTENSION" has errorsPackageExportError
- ORA-04063: package body "EXFSYS.DBMS_EXPFIL_EXP" has errorsPackageError
- ORA-04063: package body "SYS.LT_EXPORT_PKG" has errorsPackageExportError
- 觸發器trigger中呼叫包package(包中含:儲存過程procedure及函式function)_plsql觸發器Package儲存過程函式FunctionSQL
- 深入安卓Package Manager和Package Installer安卓Package
- 建立packagePackage
- Package ssh is not available, but is referred to by another package 錯誤PackageAI
- asmcmd does not exist in directoryASM
- plsql_function_package_translate_instr_dbms_random測試小記SQLFunctionPackagerandom
- java 包(package)JavaPackage
- Package and ClassPath (轉)Package
- 由於字符集問題導致 Package Body created with compilation errors.PackageError
- javax.media does not existJava
- [zt] sys_refcursor實現procedure直接返回結果集不必通過packagePackage
- expdp 報錯 ORA-04063: package body "SYS.DBMS_METADATA_UTIL" has errorsPackageError
- flutter package get 卡FlutterPackage
- Go package time 用法GoPackage
- yum error - package is a duplicate withErrorPackage
- package.jsonPackageJSON
- The DBMS_System PackagePackage
- utl_mail packageAIPackage
- Oracle 基礎 ----packageOraclePackage
- Rust Package Manager:CargoRustPackageCargo