zoukankan      html  css  js  c++  java
  • oracle 查询占用undo资源的SQL

    --查询占用undo资源的SQL
    set pagesize 999 linesize 120
    col machine for a16
    col program for a20
    col status for a10
    col sql_id for a16
    col sql_text for a20
    select distinct s.machine,s.program,s.sid,round(t.used_ublk*8/1024,2) undo_MB,used_urec undo_records,s.status,l.sql_text
    from v$transaction t,gv$session s,v$sqlstats l
    where t.ses_addr=s.saddr
    and s.sql_id=l.sql_id(+)order by undo_MB;

    ---查询回滚需要多久
    select usn, state, undoblockstotal "Total", undoblocksdone "Done",
    undoblockstotal-undoblocksdone "ToDo",
    decode(cputime,0,'unknown',sysdate+(((undoblockstotal-
    undoblocksdone) / (undoblocksdone / cputime)) / 86400))
    "Estimated time to complete"
    from v$fast_start_transactions;

  • 相关阅读:
    expect
    grep
    Python函数
    Python的set
    Python字典
    Python循环
    Python条件判断
    Python列表
    Python字符串
    Python组织代码块的形式
  • 原文地址:https://www.cnblogs.com/ss-33/p/11205680.html
Copyright © 2011-2022 走看看