If you want exclusive lock on any table, you need to make sure that no other session is accessing it. This happens when you want to run DDL or any ALTER statements, that internally needs exclusive lock. Following script will to find the blocker session and provide killing statement for clearing locks.
col owner format a20
set lines 120 pages 200
accept v_owner prompt "Enter owner:"
accept v_objnm prompt "Enter object_name:"
select a.inst_id, substr(d.sid,1,7) SID,substr(d.serial#,1,7) SERIAL,
substr(to_char(d.logon_time,'hh24:mi:ss'),1,8) time
,substr(b.object_name,1,23) OBJECT_NAME,
b.owner, d.machine, d.program, d.module,
'alter system kill session ''' || d.sid || ',' || d.serial# || ', @' || d.inst_id || ''';' || chr(10) || lpad('+', 80, '+')
from gv$lock a,dba_objects b,gv$session d
where (a.id1=b.object_id or a.id2 = b.object_id)
and a.inst_id = d.inst_id
/*and object_name = 'MAXVALUE'*/
and d.sid=a.sid
--and b.owner not in ('SYS')
and b.owner = upper('&v_owner')
and b.object_name = upper('&v_objnm')
order by d.username
/
select
'alter system kill session ''' || d.sid || ',' || d.serial# || ', @' || d.inst_id || ''';' || chr(10)
from gv$lock a,dba_objects b,gv$session d
where (a.id1=b.object_id or a.id2 = b.object_id)
and a.inst_id = d.inst_id
/*and object_name = 'MAXVALUE'*/
and d.sid=a.sid
--and b.owner not in ('SYS')
and b.owner = upper('&v_owner')
and b.object_name = upper('&v_objnm')
order by d.username
/