SELECT 'exec sys.kill_session(' || a.sid || ',' || a.serial# || ');'
,osuser
,terminal
,machine
,program
,a.*
FROM v$session a
WHERE status = 'ACTIVE' AND username = USER;
You can use for example the tool offered by SQL Developer (you need to have the rights on the table v$session).
What about SAP HANA? The basic command you need is:
ALTER SYSTEM CANCEL SESSION 'conn_id';
You can retrieve the complete command with the following query:
SELECT
'alter system cancel session ''' || C.CONNECTION_ID || ''';' command,
C.CONNECTION_ID,
PS.STATEMENT_STRING
FROM M_CONNECTIONS C JOIN M_PREPARED_STATEMENTS PS
ON C.CONNECTION_ID = PS.CONNECTION_ID
AND C.CURRENT_STATEMENT_ID = PS.STATEMENT_ID
WHERE C.CONNECTION_STATUS = 'RUNNING'
AND C.CONNECTION_TYPE = 'Remote';
Nessun commento:
Posta un commento