確定程序被鎖住的其他資源

2021-08-07 17:37:22 字數 671 閱讀 9378

確定程序被鎖住的其他資源

if exists(select * from master.sys.sysprocesses where spid in (select blocked from master.sys.sysprocesses))

begin

—確定程序被鎖住的其他資源

select spid 程序,status 狀態, 登入帳號=substring(suser_sname(sid),1,30)

,使用者機器名稱=substring(hostname,1,12)

,是否被鎖住=convert(char(3),blocked)

,資料庫名稱=substring(db_name(dbid),1,20),cmd 命令,waittype as 等待型別

,last_batch 最後批處理時間,open_tran 未提交事務的數量

from master.sys.sysprocesses

–列出鎖住別人(在別的程序中blocked欄位中出現的值)但自己未被鎖住(blocked=0)

where spid in (select blocked from master.sys.sysprocesses) and blocked=0

endelse

begin

select 『沒有被鎖住的程序』

end

mysql檢視被鎖住的表

mysql檢視被鎖住的表 查詢是否鎖表 show open tables where in use 0 檢視所有程序 mysql show processlist mariabd show full processlist 查詢到相對應的程序 然後 kill id 殺掉指定mysql連線的程序號 k...

檢視檔案是否被其他程序訪問

專案中寫了乙個穿網閘檔案傳輸程式,定期掃瞄指定資料夾,並將檔案傳輸至網閘對側。但在使用過程中發現部分檔案經常被截斷傳輸,實際上程式中對該問題已經做了處理,linux系統使用lsof命令可以直接插到該檔案當前有沒有被寫入,windows系統使用嘗試重新命名檔案方式來確定檔案有沒有被占用。但實際應用中在...

其他的torrent資源

你可以從這裡開始 其中包括 band.of.brothers.兄弟連.torrent zhouxingchi 周星馳 torrent isohunt bbs.pmpok.com 宮崎駿全集.torrent isohunt disney shorts.torrent qysub fruits bask...