How to check the maximum number of allowed connections to an Oracle database?

后端 未结 7 2005
独厮守ぢ
独厮守ぢ 2020-11-28 01:59

What\'s the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of se

相关标签:
7条回答
  • 2020-11-28 02:30

    I thought this would work, based on this source.

    SELECT
      'Currently, ' 
      || (SELECT COUNT(*) FROM V$SESSION)
      || ' out of ' 
      || DECODE(VL.SESSIONS_MAX,0,'unlimited',VL.SESSIONS_MAX) 
      || ' connections are used.' AS USAGE_MESSAGE
    FROM 
      V$LICENSE VL
    

    However, Justin Cave is right. This query gives better results:

    SELECT
      'Currently, ' 
      || (SELECT COUNT(*) FROM V$SESSION)
      || ' out of ' 
      || VP.VALUE 
      || ' connections are used.' AS USAGE_MESSAGE
    FROM 
      V$PARAMETER VP
    WHERE VP.NAME = 'sessions'
    
    0 讨论(0)
提交回复
热议问题