察看表上的索引

Select  table_name, index_name, column_name
FROM dba_ind_columns
Where index_owner='XXXX'
AND table_name='XXXXXXX';


select *
from  user_indexes
where TABLE_NAME = 'XXXXXXX'

select i.index_name, i.uniqueness, c.column_name, f.column_expression
from all_ind_columns c, all_indexes i, all_IND_EXPRESSIONS f
where i.table_owner = 'XXXX'
and i.table_name = 'XXXXXXXX'
and i.index_name = c.index_name
and i.owner = c.indeX_owner
and c.index_owner = f.index_owner(+)
and c.index_name = f.index_name(+)
and c.table_owner = f.table_owner(+)
and c.table_name = f.table_name(+)
and c.column_position = f.column_position(+)
order by i.index_name, c.column_position



SELECT /*+ rule */ s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
FROM v$session s,v$lock l,dba_objects o
WHERE l.sid = s.sid
AND l.id1 = o.object_id(+)
AND s.username is NOT Null


select * from v$locked_object;
SELECT * FROM v$lock;




select b.owner,b.object_name,a.session_id,a.locked_mode  
 
from v$locked_object a,dba_objects b  
 
where b.object_id = a.object_id; 








select t2.username,
       t2.sid,
       t2.serial#,
       t3.object_name,
       t2.OSUSER,
       t2.MACHINE,
       t2.PROGRAM,
       t2.LOGON_TIME,
       t2.COMMAND,
       t2.LOCKWAIT,
       t2.SADDR,
       t2.PADDR,
       t2.TADDR,
       t2.SQL_ADDRESS,
       t1.LOCKED_MODE
  from v$locked_object t1, v$session t2, dba_objects t3
 where t1.session_id = t2.sid
   and t1.object_id = t3.object_id
 order by t2.logon_time;
 



你可能感兴趣的:(察看表上的索引)