查看oracle的sql语句历史记录和锁表的情况 (2012-01-04 20:59:59) 转载▼ 标签: 杂谈 分类: database 查询sql的历史记录 select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('用户名') order by t.LAST_ACTIVE_TIME descselect * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc 查看一段时间内的执行情况…
转载地址:https://blog.csdn.net/cicon/article/details/68068462##一.postgresql解决锁表--查询是否锁表了select oid from pg_class where relname='可能锁表了的表'select pid from pg_locks where relation='上面查出的oid'--如果查询到了结果,表示该表被锁 则需要释放锁定select pg_cancel_backend(上面查到的pid) 12345 二.…
--查询是否锁表了select oid from pg_class where relname='可能锁表了的表'select pid from pg_locks where relation='上面查出的oid'--如果查询到了结果,表示该表被锁 则需要释放锁定select pg_cancel_backend(上面查到的pid)…
查询oracle用户名,机器名,锁表对象 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 s where l.object_id = o.object_id and l.ses…