Dropping a connected user from an Oracle 10g database schema

后端 未结 7 1636
情话喂你
情话喂你 2020-12-22 18:51

Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services?

We have several developers

7条回答
  •  孤城傲影
    2020-12-22 19:16

    To find the sessions, as a DBA use

    select sid,serial# from v$session where username = ''

    If you want to be sure only to get the sessions that use SQL Developer, you can add and program = 'SQL Developer'. If you only want to kill sessions belonging to a specific developer, you can add a restriction on os_user

    Then kill them with

    alter system kill session ','

    (e.g. alter system kill session '39,1232')

    A query that produces ready-built kill-statements could be

    select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v$session where username = ''

    This will return one kill statement per session for that user - something like:

    alter system kill session '375,64855';

    alter system kill session '346,53146';

提交回复
热议问题