Oracle查询被锁的表及进程的方法

Oracle查询可以有多种方法,下面为您介绍的是如何Oracle查询被锁的表及Oracle查询连接的进程的方法,希望对您能够有所帮助。

一、查看被锁的表

select p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a, v$locked_object b,all_objects c where p.addr=a.paddr and a.process=b.process and c.object_id=b.object_id

二、查看连接的进程

SELECT sid, serial#, username, osuser FROM v$session;

三、杀掉进程

alter system kill session ‘sid,serial#’;

四、查看当前用户下表的占用空间

Select Segment_Name, Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name

五、查询所有对象占用空间

select owner, segment_name,sum(bytes/1024/1024)   from   dba_segments group by owner,segment_name

六、查询数据库中各对象占用空间大小

Select Segment_Name,b.object_type, Sum(bytes)/1024/1024 From User_Extents a,user_objects b where a.segment_name=b.object_name Group By Segment_Name,b.object_type order by object_type, Segment_Name

七、Oracle中去除字段中的回车符

update ywj_yxglobj set table_name = replace(table_name,chr(10),”) where table_name like ‘ACCT_INFO%’

时间: 2024-10-13 22:00:21

Oracle查询被锁的表及进程的方法的相关文章

Oracle查询被锁的表及解锁方法

1.用下列sql语句查询操作不当引起锁表的进程的SESSION_ID及USERNAME SELECT S.SID SESSION_ID, S.USERNAME, DECODE(LMODE, 0, 'None', 1, 'Null', 2, 'Row-S (SS)', 3, 'Row-X (SX)', 4, 'Share', 5, 'S/Row-X (SSX)', 6, 'Exclusive', TO_CHAR(LMODE)) MODE_HELD, DECODE(REQUEST, 0, 'None

oracle查看被锁的表和被锁的进程,杀掉进程

-- 1. 查看被锁的表 SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username,b.os_user_name FROM v$process p, v$session a, v$locked_object b, all_objects c WHERE p.addr = a.paddr AND a.process = b.process AND c.object_id = b.object_id -- 2.

oracle查看被锁的表及解除锁

-- 查看被锁对象 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; --杀死进程 alter system kill session '24,111'; (其中24,111分别是上面查询出的sid,serial# ora-00031:session

oracle查看被锁的表和解锁

--以下几个为相关表SELECT * FROM v$lock;SELECT * FROM v$sqlarea;SELECT * FROM v$session;SELECT * FROM v$process ;SELECT * FROM v$locked_object;SELECT * FROM all_objects;SELECT * FROM v$session_wait; --查看被锁的表select b.owner,b.object_name,a.session_id,a.locked_m

170308、oracle查看被锁的表和解锁

--以下几个为相关表SELECT * FROM v$lock;SELECT * FROM v$sqlarea;SELECT * FROM v$session;SELECT * FROM v$process ;SELECT * FROM v$locked_object;SELECT * FROM all_objects;SELECT * FROM v$session_wait; --查看被锁的表 select b.owner,b.object_name,a.session_id,a.locked_

Oracle 查询字段在什么表

-- 查询字段在什么表 select * from all_tab_cols t where t.column_name='ABC'; -- 查询字段在什么表并且 判断是否是主键 select * from all_tab_cols t left join ( select a.table_name, a.constraint_name, a.column_name, b.constraint_type -- 字段约束类型(P:主键) from user_cons_columns a inner

oracle查询包含在子表中的主表数据

Oracle数据库,查询某表中包含在子表中的数据,子表中数据按特定条件来源于该父表,SQL命令如 select * from a_table a where a.commandId in (select commandId from b_table where type = 1) a_table父表,b_table子表,a和b表都有commandId列,a表的commandId主键关联b表中的外键commandId,要求a表中commandId包含在b表commandId中,且b表的type黑白

Oracle 查询库中所有表名、字段名、表名说明、字段名说明(原创)

查询所有表名:select t.table_name from user_tables t;查询所有字段名:select t.column_name from user_col_comments t;查询指定表的所有字段名:select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';查询指定表的所有字段名和字段说明:select t.column_name, t.column_name from

Oracle 查询库中所有表名、字段名、字段名说明,查询表的数据条数、表名、中文表名、

查询所有表名:select t.table_name from user_tables t;查询所有字段名:select t.column_name from user_col_comments t;查询指定表的所有字段名:select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';查询指定表的所有字段名和字段说明:select t.column_name, t.column_name from