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

后端 未结 7 1995
独厮守ぢ
独厮守ぢ 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:11
    select count(*),sum(decode(status, 'ACTIVE',1,0)) from v$session where type= 'USER'
    
    0 讨论(0)
  • 2020-11-28 02:13

    The sessions parameter is derived from the processes parameter and changes accordingly when you change the number of max processes. See the Oracle docs for further info.

    To get only the info about the sessions:

        select current_utilization, limit_value 
        from v$resource_limit 
        where resource_name='sessions';
    
    CURRENT_UTILIZATION LIMIT_VALUE
    ------------------- -----------
                    110         792
    

    Try this to show info about both:

        select resource_name, current_utilization, max_utilization, limit_value 
        from v$resource_limit 
        where resource_name in ('sessions', 'processes');
    
    RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION LIMIT_VALUE
    ------------- ------------------- --------------- -----------
    processes                      96             309         500
    sessions                      104             323         792
    
    0 讨论(0)
  • 2020-11-28 02:14

    v$resource_limit view is so interesting for me in order to glance oracle sessions,processes..:

    https://bbdd-error.blogspot.com.es/2017/09/check-sessions-and-processes-limit-in.html

    0 讨论(0)
  • 2020-11-28 02:19

    There are a few different limits that might come in to play in determining the number of connections an Oracle database supports. The simplest approach would be to use the SESSIONS parameter and V$SESSION, i.e.

    The number of sessions the database was configured to allow

    SELECT name, value 
      FROM v$parameter
     WHERE name = 'sessions'
    

    The number of sessions currently active

    SELECT COUNT(*)
      FROM v$session
    

    As I said, though, there are other potential limits both at the database level and at the operating system level and depending on whether shared server has been configured. If shared server is ignored, you may well hit the limit of the PROCESSES parameter before you hit the limit of the SESSIONS parameter. And you may hit operating system limits because each session requires a certain amount of RAM.

    0 讨论(0)
  • 2020-11-28 02:28

    Use gv$session for RAC, if you want get the total number of session across the cluster.

    0 讨论(0)
  • 2020-11-28 02:29

    Note: this only answers part of the question.

    If you just want to know the maximum number of sessions allowed, then you can execute in sqlplus, as sysdba:

    SQL> show parameter sessions
    

    This gives you an output like:

        NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    java_max_sessionspace_size           integer     0
    java_soft_sessionspace_limit         integer     0
    license_max_sessions                 integer     0
    license_sessions_warning             integer     0
    sessions                             integer     248
    shared_server_sessions               integer
    

    The sessions parameter is the one what you want.

    0 讨论(0)
提交回复
热议问题