www.6766.com查询Oracle中正在执行和执行过的SQL语句

别的网民给出的正在奉行的sql语句代码

SELECT b.sid oracleID, b.username 登录Oracle用户名, b.serial#, spid 操作系统ID, paddr, sql_text 正在执行的SQL, b.machine 计算机名FROM v$process a, v$session b, v$sqlarea cWHERE a.addr = b.paddr AND b.sql_hash_value = c.hash_value
SELECT se.sid,se.serial#,pr.SPID,se.username,se.status, se.terminal,se.program,se.MODULE,、se.sql_address,st.event,st. p1text,si.physical_reads, si.block_changes FROM v$session se,v$session_wait st, v$sess_io si,v$process pr WHERE st.sid=se.sid AND st. sid=si.sid AND se.PADDR=pr.ADDR AND se.sid6 AND st. wait_time=0 AND st.event NOT LIKE '%SQL%' ORDER BY physical_reads DESC

以上正是本子之家小编收拾的关于查询Oracle中正在实施和举办过的SQL语句的有关内容,要是你有越来越好的不二秘诀,请探究留言,多谢

kill掉当前的锁对象足感到

其他

SELECT l.session_id sid, s.serial#, l.locked_mode 锁模式, l.oracle_username 登录用户, l.os_user_name 登录机器用户名, s.machine 机器名, s.terminal 终端用户名, o.object_name 被锁对象名, s.logon_time 登录数据库时间FROM v$locked_object l, all_objects o, v$session sWHERE l.object_id = o.object_id AND l.session_id = s.sidORDER BY sid, s.serial#;
select a.username, a.sid,b.SQL_TEXT, b.SQL_FULLTEXT from v$session a, v$sqlarea b where a.sql_address = b.address ---执行过的select b.SQL_TEXT,b.FIRST_LOAD_TIME,b.SQL_FULLTEXT from v$sqlarea bwhere b.FIRST_LOAD_TIME between '2016-10-1/09:24:47' and '2016-10-1/09:24:47' order by b.FIRST_LOAD_TIME

得到消息oracle当前的被锁对象

www.6766.com,搜索前十条质量差的sql.

select OSUSER,PROGRAM,USERNAME,SCHEMANAME,B.Cpu_Time,STATUS,B.SQL_TEXT from V$SESSION A LEFT JOIN V$SQL B ON A.SQL_ADDRESS=B.ADDRESS AND A.SQL_HASH_VALUE=B.HASH_VALUE order by b.cpu_time desc select address, sql_text, piece from v$session, v$sqltext where address = sql_address -- and machine =  you machine name  order by address, piece 
SELECT OSUSER 电脑登录身份, PROGRAM 发起请求的程序, USERNAME 登录系统的用户名, SCHEMANAME, B.Cpu_Time 花费cpu的时间, STATUS, B.SQL_TEXT 执行的sqlFROM V$SESSION ALEFT JOIN V$SQL B ON A.SQL_ADDRESS = B.ADDRESS AND A.SQL_HASH_VALUE = B.HASH_VALUEORDER BY b.cpu_time DESC

翻看占io相当大的正在运行的session

查询Oracle正在实施的sql语句及奉行该语句的客商

查看正在试行sql的发起者的发放程序

alter system kill session 'sid, s.serial#‘;
SELECT * FROM (select PARSING_USER_ID,EXECUTIONS,SORTS, COMMAND_TYPE,DISK_READS,sql_text FROM v$sqlarea order BY disk_reads DESC )where ROWNUM10 ; 

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图