• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

pl/sql ,dba-ebs 常用

mysql 搞代码 4年前 (2022-01-09) 19次浏览 已收录 0个评论

包括了: 查正在运行的SQL语句, 某个服务中的session 表空间管理 锁状态 数据库中当前活跃用户信息 。。。。 这些代码来至于dbadmin 项目 是一个美国的DBA 写的 不错,在googlde code中的 有 PL/SQL DBA g_sid v$session.SID%type := ‘-1’; g_serial# v$sess

包括了:
查正在运行的SQL语句,
某个服务中的session
表空间管理
锁状态
数据库中当前活跃用户信息
。。。。
这些代码来至于dbadmin 项目 是一个美国的DBA 写的 不错,在googlde code中的 有

PL/SQL DBA <style> .CodeEntity .code_pieces ul.piece_anchor{width:25px;position:absolute;top:25px;left:-30px;z-index:1000;} .CodeEntity .code_pieces ul.piece_anchor li{width:25px;background: #efe;margin-bottom:2px;} .CodeEntity .code_pieces ul.piece_anchor li{border-left:3px #40AA63 solid;border-right:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li:hover{border-right:3px #40AA63 solid;border-left:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li a{color: #333;padding: 3px 10px;} .CodeEntity .code_pieces .jump_to_code{visibility:hidden;position:relative;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code{visibility:visible;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code a{text-decoration:none;} .CodeEntity .code_pieces h2 i{float:right;font-style:normal;font-weight:normal;} .CodeEntity .code_pieces h2 i a{font-size:9pt;background: #FFFFFF;color:#00A;padding: 2px 5px;text-decoration:none;} </style> <!—ecms

    –> <!—ecms

  • $velocityCount
  • –> <!—ecms

–>

 g_sid      v$session.SID%type := '-1';  g_serial#  v$session.SERIAL#%type;  g_terminal v$session.TERMINAL%type;  g_username v$session.username%type;  function get_object_by_id(p_object_id in number) return varchar2 is    l_object_name varchar2(1000);  begin    select owner || '.' || object_name      into l_object_name      from dba_objects     where object_id = p_object_id;      return l_object_name;  exception    when others then      return p_object_id;  end;  function get_objects_locked_by_session(p_sid in number) return varchar2 is    l_result varchar2(1000) := '';    cursor locks is      select get_object_by_id(id1) locked_object        from v$lock       where type = 'TM'         and sid = p_sid;  begin    for c in locks loop      if l_result is not null then        l_result := l_result || chr(10);      end if;      l_result := l_result || c.locked_object;    end loop;    return l_result;  end;  procedure get_session_info(p_sid in number) is  begin    select serial#, terminal, username      into g_serial#, g_terminal, g_username      from v$session     where sid = p_sid;  end get_session_info;  function get_session_serial#(p_sid in number) return v$session.SERIAL#%type is  begin    if p_sid != g_sid then      get_session_info(p_sid);    end if;    return g_serial#;  end get_session_serial#;  function get_session_terminal(p_sid in number)    return v$session.terminal%type is  begin    if p_sid != g_sid then      get_session_info(p_sid);    end if;    return g_terminal;  end get_session_terminal;  function get_session_username(p_sid in number)    return v$session.username%type is  begin    if p_sid != g_sid then      get_session_info(p_sid);    end if;    return g_username;  end get_session_username;  function get_sids(p_process in varchar2) return varchar2 is    cursor users_sids is      select sid, module, program        from v$session s       where s.process = p_process          or s.process like p_process || ':%';      result varchar2(1000);  begin    result := '';    for c in users_sids loop      if c.program = 'JDBC Thin Client' then        result := 'Web sessions';      else        if result is not null then          result := r<div>本文来源gaodai.ma#com搞##代!^码@网3</div>esult || chr(10);        end if;        result := result || to_char(c.sid) || ' ' ||                  nvl(c.module, 'Main Menu');      end if;    end loop;    return result;  end;--还有很多 见附件 。。。。。。 

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:pl/sql ,dba-ebs 常用
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址