Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to delete a user connection for oracle

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1) check the connection status of the user

Select username,sid,serial# from v$session

-

(2) find the sid, serial and delete the user you want to delete.

For example, if you want to delete user 'WUZHQ', you can do this:

Alter system kill session'132,26'

Alter system kill session'137766'

Alter system kill session'149,61846'

Alter system kill session'159,13113'

Alter system kill session'140219'

Alter system kill session'146,2285'

Alter system kill session'147,30211'

Alter system kill session'152,55077'

Alter system kill session'127,5895'

Alter system kill session'130,8117'

Alter system kill session'142,21636'

Alter system kill session'143747'

(3) Delete users

-

Drop user username cascade

(* *) if you also prompt ORA-01940 after drop that the currently linked user cannot be deleted, it means that there is still a connected session. You can check the status of the session to determine whether the session has been kill, and use the following statement to check:

-

Select saddr,sid,serial#,paddr,username,status from v$session where username is not null

Status is the session status of the user to be deleted. If it is still inactive, it has not been dropped by kill. If the status is killed, it has been kill.

Thus it can be seen that the session of the user WUZHQ has been killed. The user can be safely deleted at this time.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report