代码拉取完成,页面将自动刷新
-- | PURPOSE : Query all DML and DDL locks in the database. This script will |
-- | query critical information about the lock including Lock Type, |
-- | Object Name/Owner, OS/Oracle User and Wait time (in minutes). |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
SET PAGESIZE 66
COLUMN Object FORMAT a30 HEADING 'Object'
COLUMN Type FORMAT a4 HEADING 'Type'
COLUMN UserID FORMAT a20 HEADING 'OS/Oracle'
COLUMN Hold FORMAT a10 HEADING 'Hold'
COLUMN Program FORMAT a35 HEADING 'Program'
COLUMN usercode FORMAT a12 HEADING 'SID/Serial#'
COLUMN WaitMin FORMAT 999,999 HEADING 'Wait Time (minutes)'
SELECT
a.osuser || ':' || a.username UserID
, a.sid || '/' || a.serial# usercode
, b.lock_type Type, b.mode_held Hold
, c.owner || '.' || c.object_name Object
, a.program Program
, d.seconds_in_wait WaitSec
FROM
v$session a
, dba_locks b
, sys.dba_objects c
, v$session_wait d
WHERE
a.sid = b.session_id
AND b.lock_type IN ('DML','DDL')
AND b.lock_id1 = c.object_id
AND b.session_id = d.sid
/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。