zoukankan      html  css  js  c++  java
  • 查看oracle的sql语句历史记录和锁表的情况

    转自: http://blog.sina.com.cn/s/blog_91339bff0100vbdc.html

    查询sql的历史记录

    select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('用户名') order by t.LAST_ACTIVE_TIME desc
    select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc

    查看一段时间内的执行情况

    select * from v$sqlarea t where ( to_char(t.LAST_ACTIVE_TIME,'yyyy-mm-dd hh24:mi:ss') > '2011-12-28 14:11:39' ) and (to_char(t.LAST_ACTIVE_TIME,'yyyy-mm-dd hh24:mi:ss') < '2011-12-28 14:11:43') order by t.LAST_ACTIVE_TIME desc

    查询当前时间

    select sysdate from dual

    查询锁表的情况

    select * from v$locked_object;
    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 = b.sid order by b.logon_time;

  • 相关阅读:
    代码操作
    购物车
    利息计算器
    生成海报
    知识库
    JavaScript处理字符串--参照W3C
    C#输入排序-冒泡
    enum举例
    C# 表达式计算器----数据结构
    C# 测试单词的完美度
  • 原文地址:https://www.cnblogs.com/summer520/p/3639234.html
Copyright © 2011-2022 走看看