Set pagesize 256
Set linesize 130
Set trimspool on
Set feedback off
prompt **********************************************************
prompt ***** Locks *****
prompt **********************************************************
set serveroutput on size 20000
set pagesize 110
declare
cursor c1 is
select o.OBJECT_ID,substr(o.OBJECT_NAME,1,25) object_name,s.machine,
o.OBJECT_TYPE,substr(o.owner,1,15) owner,
l.OS_USER_NAME,l.ORACLE_USERNAME,l.PROCESS,decode(l.locked_mode,1,'No Lock',2,'Row Share',3,'Row Exclusive',
4,'Share', 5,'Share Row Excl', 6,'Exclusive',null) locked_mode, S.sid, s.serial#
from v$locked_object l, dba_objects o, v$session s
where l.OBJECT_ID=o.OBJECT_ID and s.sid=l.session_id
order by 2,6;
begin
dbms_output.put_line(rpad('-',130,'-'));
dbms_output.put_line( rpad('OBJECT_NAME',30)||
rpad('OBJECT_TYPE',12)||
rpad('LOGIN_Oracle',30)||
rpad('LOGIN_REDE',15)||
rpad('LOCKED_MODE',15)||
rpad('MAQUINA',15));
dbms_output.put_line(rpad('-',130,'-'));
for t1 in c1 loop
dbms_output.put_line(
rpad(t1.object_name,30)||
rpad(t1.object_type,12)||
rpad(t1.oracle_username|| '(' || t1.sid || ',' || t1.serial# || ')',30)||
rpad(t1.os_user_name,15)||
rpad(t1.locked_mode,15)||
rpad(t1.machine,15));
end loop;
dbms_output.put_line(rpad('-',130,'-'));
end;
/
Set feedback on
ALTER SYSTEM KILL SESSION '&SID,&SERIAL';
Nenhum comentário:
Postar um comentário