zoukankan      html  css  js  c++  java
  • 查看Oracle数据库中的,已经连接好的..当前用户状况

    参考:

    http://stackoverflow.com/questions/1043096/how-to-list-active-open-connections-in-oracle

    以sys身份连接进入,执行如下sql 语句:

    SQL> select
           substr(a.spid,1,9) pid,
           substr(b.sid,1,5) sid,
           substr(b.serial#,1,5) ser#,
           substr(b.machine,1,6) box,
           substr(b.username,1,10) username,
    --       b.server,
           substr(b.osuser,1,8) os_user,
           substr(b.program,1,30) program
    from v$session b, v$process a
    where
    b.paddr = a.addr
    and type='USER'
    order by spid; 

    **************************

    运行结果:

    PID       SID   SER#  BOX    USERNAME   OS_USER  PROGRAM
    --------- ----- ----- ------ ---------- -------- ------------------------------
    2744      1     5     localh SYS        oracle   sqlplus@localhost.localdomain
    6747      57    8     localh SYS        oracle   rman@localhost.localdomain (TN
    7457      60    20    localh SYSMAN     oracle   OMS
    7489      26    70    localh SYSMAN     oracle   OMS
    26819     49    6269  localh SYS        oracle   rman@localhost.localdomain (TN
    26822     43    3610  localh SYS        oracle   rman@localhost.localdomain (TN
    26829     45    4967  localh            oracle   oracle@localhost.localdomain (
    6911      61    14    localh SYS        oracle   rman@localhost.localdomain (TN
    7553      58    14    localh SYSMAN     oracle   OMS
    7558      62    3     localh SYSMAN     oracle   OMS
    26833     56    513   localh            oracle   oracle@localhost.localdomain (

    PID       SID   SER#  BOX    USERNAME   OS_USER  PROGRAM
    --------- ----- ----- ------ ---------- -------- ------------------------------
    6781      59    14    localh DBSNMP     oracle   emagent@localhost.localdomain
    6828      27    251   localh DBSNMP     oracle   emagent@localhost.localdomain
    6936      30    281   localh SYS        oracle   rman@localhost.localdomain (TN
    7254      42    367   localh DBSNMP     oracle   emagent@localhost.localdomain

    15 rows selected.

    SQL>

    可以看到,rman是以sys身份连接进入的。

  • 相关阅读:
    诸葛马前课andoid app 应用
    C#读写文件总结
    C#写的较完美验证码通用类
    利用C#转换图片格式及转换为ico
    集合>哈希表类Hashtable和SortedList排序列表类
    C# 4.0 新特性dynamic、可选参数、命名参数等
    String.Format格式说明
    C# 4动态编程新特性与DLR剖析
    C#中const和readonly的区别
    2014年7月阅读链接
  • 原文地址:https://www.cnblogs.com/gaojian/p/3645086.html
Copyright © 2011-2022 走看看