Oracle 存储过程 无法编译 解决方法(转载)
聲明:本文為轉載,如果有侵犯知識版本,請通知本人,本人將即刻停止侵權行為:
http://blog.csdn.net/tianlesoftware/article/details/7412555
Oracle存儲過程無法編譯,在PL/SQL中編譯,總是掛住了,這個原因可能是要編譯的對象被會話給鎖住了:
1、查看無效對象:
1 SELECT Object_Name, Object_Type, Status 2 FROM All_Objects 3 WHERE Status = 'INVALID' 4 AND Owner = 'SCOTT';
2、查看正在訪問無效對象的會話,這里我們需要使用v$access
? ? ? V$ACCESS?displaysinformation about locks that are currently imposed on library cache objects.The locks are imposed to ensure that they are not aged out of the library cachewhile they are required for SQL execution.
1 SELECT * FROM V$ACCESS WHERE OBJECT='CREATE_VIEW_P';
查詢出來的結果顯示是:會話ID為143的會話當前持有該對象。
3、查詢143號的會話的狀態
1 SELECT Sid, Serial#, Status, Process FROM V$session WHERE Sid = '143';
4、殺掉進程:
1 alter system kill session '143,397';
5、查詢進行的狀態:
1 select sid,serial#,status,process from v$session where sid='958';
session的狀態在剛剛殺掉的時候為KILLED,但是被標記為killed 的進程由PMON 進程kill,但是這個也是有條件的:
PMON will notdelete the session object itself until the client connected to that sessionnotices that it has been killed.如果session 被標記為killed,并且長時間不能被清楚,MOS上給出的解決方法是在OS級別kill 進程。?
6、獲取session的spid(系統進程ID)
V$PROCESS中的常用列
ADDR:進程對象地址
PID:oracle進程ID
SPID:操作系統進程ID
V$PROCESS中的連接列
Column View Joined Column(s)?
ADDR V$SESSION PADDR
網址:http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2022.htm
1 SELECT Spid, Osuser, s.Program 2 FROM V$session s, V$process p 3 WHERE s.Paddr = p.Addr 4 AND s.Sid = 143;
查詢系統進行ID,使用系統級別的KILL命令:
可參考:
windows命令:
?To kill the session on the Windows operating system, first identify the session, then substitute the relevant?SID?and?SPID?values into the following command issued from the command line.
1 C:> orakill ORACLE_SID(數據庫實例名) spid(v$process表中獲取)
成功----
轉載于:https://www.cnblogs.com/caroline/archive/2012/05/19/2508965.html
總結
以上是生活随笔為你收集整理的Oracle 存储过程 无法编译 解决方法(转载)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 独立显卡多少钱啊?
- 下一篇: 电脑4g内存条跟8g内存条价格