SELECT A.OWNER,A.OBJECT_NAME,B.XIDUSN,B.XIDSLOT,B.XIDSQN,B.SESSION_ID,B.ORACLE_USERNAME, B.OS_USER_NAME,B.PROCESS, B.LOCKED_MODE, C.MACHINE,C.STATUS,C.SERVER,C.SID,C.SERIAL#,C.PROGRAMFROM ALL_OBJECTS A,V$LOCKED_OBJECT B,SYS.GV_$SESSION C WHERE ( A.OB…
oracle表设计 http://blog.csdn.net/lanpy88/article/details/7580820 Oracle查看所有表和字段 获取表: select table_name from user_tables; //当前用户的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables w…
  oracle 查看锁表情况与解表 CreateTime--2018年4月27日17:24:37 Author:Marydon 1.锁表查询 --锁表查询 SELECT OBJECT_NAME AS TABLE_NAME, MACHINE, S.SID, S.SERIAL# FROM GV$LOCKED_OBJECT L, DBA_OBJECTS O, GV$SESSION S WHERE L.OBJECT_ID = O.OBJECT_ID AND L.SESSION_ID = S.SID;…
查看当前用户的缺省表空间 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语句1: select sess.sid,     sess.serial#,     lo.oracle_username,     lo.os_user_name,     ao.object_name,     lo.locked_mode     from v$locked_object lo,     dba_objects ao,     v$session sess where ao.object_id = lo.object_id and lo.session…
select sess.sid,     sess.serial#,     lo.oracle_username,     lo.os_user_name,     ao.object_name,     lo.locked_mode     from v$locked_object lo,     dba_objects ao,     v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid;…
查看锁表进程SQL语句1: select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao, v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid; 查看锁表进程SQL语句2: sel…
(1)锁表查询的代码有以下的形式:select count(*) from v$locked_object;select * from v$locked_object;(2)查看哪个表被锁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;(3)查看是哪个session引起的select b.user…
1.查看所有表空间大小.剩余量: select dbf.tablespace_name,dbf.totalspace "总量(M)",dbf.totalblocks as 总块数,dfs.freespace "剩余总量(M)",dfs.freeblocks "剩余块数",(dfs.freespace / dbf.totalspace) * 100 "空闲比例" from (select t.tablespace_name,su…
查看锁表进程SQL语句1: select sess.sid,     sess.serial#,     lo.oracle_username,     lo.os_user_name,     ao.object_name,     lo.locked_mode     from v$locked_object lo,     dba_objects ao,     v$session sess where ao.object_id = lo.object_id and lo.session_…
-- 查看所有表空间的数据使用情况 SELECT Upper(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)", To_char(, 2), '990.99') || '%' "使用比", F.TOTAL_BYTES "空闲空间(M)", F.MAX_BYTE…
--查看哪些表被锁住了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 b.username,b.sid,b.serial#,logon_time from v$locked_object a , v$session b where a.session_id =…
场景:在做数据库巡检时,检查大表是必不可少的操作,可以查看各表占用表空间的大小 代码: as sizes,q.num_rows,t.segment_type from dba_segments t left join dba_tables q on t.segment_name=q.table_name and t.owner=q.owner where t.segment_type='TABLE' and t.tablespace_name='TS_AAA' --需要查看的表空间 desc…
/* *locked *query locked object and analyse reason,kill it * */ select 'alter system kill session ''' || SID || ',' || SERIAL# || ''';' from (select distinct a.sid, a.Serial#, status, machine, LOCKWAIT, logon_time from v$session a, v$locked_object b…
--注意权限问题 1.查看是否有被锁的表: 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 2.查看是哪个进程锁的 select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.ses…
源地址:http://blog.csdn.net/zhanggnol/article/details/6683697 select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC; 还可以直接查看dblink的:select t.table_name,t.num_rows from user_tables@dblink t ORDER BY NUM_ROWS DESC;…
源地址:http://blog.csdn.net/zhanggnol/article/details/6683697 select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC; 还可以直接查看dblink的:select t.table_name,t.num_rows from user_tables@dblink t ORDER BY NUM_ROWS DESC;…
select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC; 还可以直接查看dblink的:select t.table_name,t.num_rows from user_tables@dblink t ORDER BY NUM_ROWS DESC;…
分2步骤: 1. select * from user_constraints e where e.table_name='xxx'; 2. select a.constraint_type,a.table_name,a.status, b.table_name,b.column_name,b.constraint_name from user_constraints a inner join user_cons_columns bon a.constraint_name = b.constra…
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where a.object_id = b.object_id…
select OBJECT_NAME, CREATED from DBA_OBJECTS obj, USER_TABLES tab where obj.OBJECT_NAME = tab.TABLE_NAME order by obj.CREATED desc;…
select table_name from user_tables;…
https://zhidao.baidu.com/question/131972827.html…
解锁语句: alter system kill session 'sid, serial#'; alter system kill session '23, 1647'; 查询那些对象被锁: select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session s where l.object_id = o.object_id and l.session_id=s.sid; 杀死一个进…
SELECT a.object_id, a.session_id, b.object_nameFROM v$locked_object a, dba_objects bWHERE a.object_id = b.object_id…
参考: oracle查看锁表进程,杀掉锁表进程 Oracle的锁表与解锁 查看锁表进程SQL语句: select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID; 杀掉锁表进程: 如有記錄則表示有lock,記錄下SID和serial# ,將記錄的ID替換下面的738,1429,即可解除LOCK alter system kill session '738,1429'; Oracle有自己的进程管理策略,很多…
◆Oracle查询用户表空间:select * from user_all_tables ◆Oracle查询所有函数和储存过程:select * from user_source ◆Oracle查询所有用户:select * from all_users.select * from dba_users ◆Oracle查看当前用户连接:select * from v$Session ◆Oracle查看当前用户权限:select * from session_privs ◆Oracle查看用户表空间…
Oracle查看SQL执行计划的方式     获取Oracle sql执行计划并查看执行计划,是掌握和判断数据库性能的基本技巧.下面案例介绍了多种查看sql执行计划的方式:   基本有以下几种方式: 1.通过sql_trace初始化参数 2.通过Autotrace 3.通过explain plan 4.通过dbms_xplan.display_cursor 5.通过dbms_xplan.display_awr 6.通过10046事件 1.通过explain plan 工具 12:24:00 SC…
select a.constraint_name, a.table_name, b.constraint_name from user_constraints a, user_constraints b where a.constraint_type = 'R'  and b.constraint_type = 'P'  and a.r_constraint_name = b.constraint_name -- P 代表主键, R 代表外键 查询某一张表的约束: select constrai…
查看 哪些表 被锁了 SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid; 解除锁定: --alter system kill session 'sid, serial#'; ALTER system kill session '23, 1…