最近Oracle把哦整爽老。哇哈哈。。 html
select username,sid,serial# from v$session 安全
------------------------------------------ session
以下結果: spa
usernamesidserial# htm
---------------------------------------- blog
NETBNEW51322974
NETBNEW51418183
NETBNEW51621573
NETBNEW5319
WUZHQ5324562 get
(2)找到要刪除用戶的sid,和serial,並刪除 io
------------------------------------------- select
如:你要刪除用戶'WUZHQ',能夠這樣作: di
alter system kill session'532,4562'
(3)刪除用戶
--------------------------------------------
drop user username cascade
(**)若是在drop 後還提示ORA-01940:沒法刪除當前已連接的用戶,說明還有鏈接的session,能夠經過查看session的狀態來肯定該session是否被kill 了,用以下語句查看:
-------------------------------------
select saddr,sid,serial#,paddr,username,status from v$session where username is not null
結果以下(以個人庫爲例):
saddrsidserial#paddrusernamestatus
--------------------------------------------------------------------------------------------------------
564A1E2851322974569638F4NETBNEWACTIVE
564A30DC51418183569688CCNETBNEWINACTIVE
564A56445162157356963340NETBNEWINACTIVE
564B6ED0531956962D8CNETBNEWINACTIVE
564B8184532456256A1075CWUZHQKILLED
status 爲要刪除用戶的session狀態,若是還爲inactive,說明沒有被kill掉,若是狀態爲killed,說明已kill。
因而可知,WUZHQ這個用戶的session已經被殺死。此時能夠安全刪除用戶。