日期:2014-05-16  浏览次数:20442 次

oracle常用数据字典

查看sid

select instance_name from v$instance;

?

查看死锁

select A.sid, b.serial#,
?decode(A.type,
??? 'MR', 'Media Recovery',
??? 'RT','Redo Thread',
??? 'UN','User Name',
??? 'TX', 'Transaction',
??? 'TM', 'DML',
??? 'UL', 'PL/SQL User Lock',
??? 'DX', 'Distributed Xaction',
??? 'CF', 'Control File',
??? 'IS', 'Instance State',
??? 'FS', 'File Set',
??? 'IR', 'Instance Recovery',
??? 'ST', 'Disk Space Transaction',
??? 'TS', 'Temp Segment',
??? 'IV', 'Library Cache Invalida-tion',
??? 'LS', 'Log Start or Switch',
??? 'RW', 'Row Wait',
??? 'SQ', 'Sequence Number',
??? 'TE', 'Extend Table',
??? 'TT', 'Temp Table',
??? 'Unknown') LockType,
?c.object_name,
?decode(a.lmode,?? 0, 'None',
??????????? 1, 'Null',
??????????? 2, 'Row-S',
??????????? 3, 'Row-X',
??????????? 4, 'Share',
??????????? 5, 'S/Row-X',
??????????? 6, 'Exclusive', 'Unknown') LockMode,
?B.MACHINE,D.SPID ,b.PROGRAM
?from v$lock a,v$session b,all_objects c,V$PROCESS D
?where a.sid=b.sid and a.type in ('TM','TX')
?and c.object_id=a.id1
?AND B.PADDR=D.ADDR

解锁

alter?? system???? kill?? session?? 'sid,serial'

?

?

查看当前用户的缺省表空间

SQL>select username,default_tablespace from user_users;

  查看当前用户的角色
  SQL>select * from user_role_privs;

  查看当前用户的系统权限和表级权限
  SQL>select * from user_sys_privs;
  SQL>select * from user_tab_privs;

  查看用户下所有的表
  SQL>select * from user_tables;

?????查看用户下所有的表的列属性

?????SQL>select * from USER_TAB_COLUMNS where table_name=:table_Name;

  显示用户信息(所属表空间)
  select default_tablespace,temporary_tablespace?
  from dba_users where username='GAME';

?

  1、用户

查询所有用户: