select 'ALTER SYSTEM KILL SESSION ' ||chr(39)||sid||chr(44)||serial#||chr(39)||';' QUERY
from v$session
where username='ADMIN';
QUERY
-----------------------------------------
ALTER SYSTEM KILL SESSION '197,4989';
----------------------------------------------------------
SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE s.type != 'BACKGROUND';
--AND s.sid=136;
INST_ID SID SERIAL# SPID USERNAME PROGRAM
------- ---- ---------- ----- ---------- ------------------
1 63 9889 6800 ORACLE.EXE (J000)
1 132 12187 7828 ORACLE.EXE (J001)
1 197 4989 4836 SYS sqlplus.exe
C:\> set ORACLE_SID
ORACLE_SID=orcl
C:\> orakill <oracle_sid> <spid>
C:\> orakill orcl 7828
Warning: Oracle recommends killing session at database level.
----------------------------------------------------------
DECLARE
A CHAR(2);
BEGIN
FOR I IN 20..50
LOOP
--SELECT CHR(I) INTO A FROM DUAL;
DBMS_OUTPUT.PUT_LINE(I||CHR(32)|| CHR(I));
END LOOP;
END;
/
where username='ADMIN';
QUERY
-----------------------------------------
ALTER SYSTEM KILL SESSION '197,4989';
----------------------------------------------------------
SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE s.type != 'BACKGROUND';
--AND s.sid=136;
INST_ID SID SERIAL# SPID USERNAME PROGRAM
------- ---- ---------- ----- ---------- ------------------
1 63 9889 6800 ORACLE.EXE (J000)
1 132 12187 7828 ORACLE.EXE (J001)
1 197 4989 4836 SYS sqlplus.exe
C:\> set ORACLE_SID
ORACLE_SID=orcl
C:\> orakill orcl 7828
Warning: Oracle recommends killing session at database level.
----------------------------------------------------------
DECLARE
A CHAR(2);
BEGIN
FOR I IN 20..50
LOOP
--SELECT CHR(I) INTO A FROM DUAL;
DBMS_OUTPUT.PUT_LINE(I||CHR(32)|| CHR(I));
END LOOP;
END;
/
No comments:
Post a Comment