Ora 02391 ошибка

PROBLEM: While connecting to the database, getting error: SQL> connect test9/test9 ERROR: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit SOLUTION: 1. Check how many sessions were already existed for that user: SELECT count(*) as connections,username FROM v$session where username=’&USER_NAME’ GROUP BY username; SQL> SELECT count(*) as connections,username FROM v$session where username='&USER_NAME' GROUP BY username; Enter value for […]

22158 views
1 min , 6 sec read
3

PROBLEM:

While connecting to the database, getting error:

SQL> connect test9/test9
ERROR:
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit

SOLUTION:

1. Check how many sessions were already existed for that user:

SELECT count(*) as connections,username FROM v$session where username=’&USER_NAME’ GROUP BY username;

SQL> SELECT count(*) as connections,username   FROM   v$session where username='&USER_NAME' GROUP  BY username;
Enter value for user_name: TEST9
old   1: SELECT count(*) as connections,username   FROM   v$session where username='&USER_NAME' GROUP  BY username
new   1: SELECT count(*) as connections,username   FROM   v$session where username='TEST9' GROUP  BY username

CONNECTIONS USERN
----------- -----
          2 TEST9

TEST9 user has currently 2 sessions.

2. Check the value of SESSIONS_PER_USER for this user

col username for a12
col profile for a19
col limit for a12
set lines 299
select a.username,b.PROFILE,b.RESOURCE_NAME,b.limit from dba_users a , dba_profiles b where a.profile=b.profile and b.RESOURCE_NAME=’SESSIONS_PER_USER’ and a.username=’&USER_NAME’;

Enter value for user_name: TEST9
old   1: select a.username,b.PROFILE,b.RESOURCE_NAME,b.limit from dba_users a , dba_profiles b where a.profile=b.profile and b.RESOURCE_NAME='SESSIONS_PER_USER' and a.username='&USER_NAME'
new   1: select a.username,b.PROFILE,b.RESOURCE_NAME,b.limit from dba_users a , dba_profiles b where a.profile=b.profile and b.RESOURCE_NAME='SESSIONS_PER_USER' and a.username='TEST9'

USERNAME     PROFILE             RESOURCE_NAME                    LIMIT
------------ ------------------- -------------------------------- ------------
TEST9        TEST                SESSIONS_PER_USER                2

We can see, the sessions_per_user allowed for this users in 2. To fix this user, increase the limit for SESSIONS_PER_USER in the profile.

Here the profile for the user is TEST

3. Alter the profile with higher SESSIONS_PER_USER value.

SQL> ALTER PROFILE TEST LIMIT SESSIONS_PER_USER 10;

Profile altered.

Now try to connect with the user.

 
 

Problem

Error’s from the JIRA logs indicate an ORA-02391 error is being reported. JIRA may be unreliable, or performing poorly and the behaviour may be intermittent. 

This behaviour may be particularly obvious when completing tasks that involve many queries to the JIRA database. 

The following appears in the atlassian-jira.log

java.sql.SQLException: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit

Diagnosis

Environment

  • JIRA is connected to an Oracle 11g or Oracle 12c Database.

Diagnostic Steps

  • The Oracle Alert Log will be reporting similar ORA-02391 errors.
  • Attempting to connect to the Oracle Database as the user specified in the dbconflg.xml file, may not be permitted with the same error. 
  • Connecting to the JIRA as a DBA user and running the following will show a large number of connections to the database by the JIRA USER:

    SELECT count(*) as connections, 
           username 
    FROM   v$session 
    GROUP  BY username 
    ORDER  BY username; 
  • Checking the Limits for the affected user shows the user is approaching the maximum connection limit (replace <JIRA_DATABASE_USER> with the username in your dbconfig.xml file:

    SELECT DISTINCT username, 
                    profile, 
                    resource_name, 
                    limit
    FROM   dba_profiles 
           NATURAL JOIN dba_users 
    WHERE  resource_name = 'SESSIONS_PER_USER' 
           AND username = '<JIRA_DATABASE_USER>'; 

Cause

The total number of database connections to the Oracle Database by the specified user has reached the maximum, and therefore no more connections can be established for the current user.

Resolution

  1. Ensure the maximum pool size in the JIRA instance’s dbconfig.xml file is not greater than the SESSIONS_PER_USER limit in Oracle. To do this:

    1. Check the dbconfig.xml under the property: <pool-max-size>. This value should be no smaller than the values documented in: 

    2. Check the SESSIONS_PER_USER setting is equal or higher than the maximum pool size
      1. If this value is low, increase this limit or set the limit to UNLIMITED from the Oracle Database. 
    3. Confirm that no other applications are connecting to the Oracle database using the same user.

Last modified on Mar 30, 2016

Related content

  • No related content found

May 3, 2021

I got ” ORA-02391 Exceeded simultaneous session_per_user limit ”  error in Oracle database.

ORA-02391 Exceeded simultaneous session_per_user limit

Details of error are as follows.

ORA-02391:   exceeded simultaneous SESSIONS_PER_USER limit

Cause:   An attempt was made to exceed the maximum number of concurrent sessions allowed by the SESSIONS_PER_USER clause of the user profile.

Action:   End one or more concurrent sessions or ask the database administrator to increase the SESSIONS_PER_USER limit of the user profile.

exceeded simultaneous SESSIONS_PER_USER limit

This ORA-02391 errors are related with the attempt was made to exceed the maximum number of concurrent sessions allowed by the SESSIONS_PER_USER clause of the user profile.

The owner of the job is assigned to unlimited SESSIONS_PER_USER profile:

SQL> select profile from dba_users where username = 'USER1';

PROFILE
------------------------------
APPLICATION_USER


SQL> select PROFILE, RESOURCE_NAME, RESOURCE_TYPE, LIMIT from dba_profiles where PROFILE = 'APPLICATION_USER'

PROFILE              RESOURCE_NAME            RESOURCE_TYPE   LIMIT
-------------------- ------------------------ --------------- ---------------
APPLICATION_USER     COMPOSITE_LIMIT          KERNEL          DEFAULT
APPLICATION_USER     SESSIONS_PER_USER        KERNEL          UNLIMITED

End one or more concurrent sessions or ask the database administrator to increase the SESSIONS_PER_USER limit of the user profile.

1. Assign SYS a profile with sufficient SESSIONS_PER_USER, e.g. unlimited

OR

2. Increase SESSIONS_PER_USER for the profile assigned to SYS, until errors are no longer reported

Check your user limit as follows.

select PROFILE, LIMIT from dba_profiles WHERE RESOURCE_NAME = 'SESSIONS_PER_USER' AND PROFILE = 'PROFILE_NAME';

SESSIONS_PER_USER Parameter

Then you can limit the profile’s limit as follows.

alter profile PROFILE_NAME limit SESSIONS_PER_USER 150;

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 1,576 views last month,  1 views today

Есть ли запрос, который я могу использовать для получения количества сеансов, которые я могу использовать одновременно? Я выполняю несколько подключений к базе данных и получаю сообщение об ошибке:

ORA-02391: превышен лимит одновременных SESSIONS_PER_USER

Как я могу узнать значение этого лимита?

4 ответа

Лучший ответ

Получите ПРОФИЛЬ для этого пользователя

select profile from dba_users where username = :who;

Затем получите лимит ресурсов для этого профиля

SELECT P1.LIMIT AS "Concurrent Sessions (Per User)"
FROM   DBA_PROFILES P1
WHERE  P1.PROFILE       = :PROFILE
   AND P1.RESOURCE_NAME = 'SESSIONS_PER_USER';

Или же

В SQL Developer откройте панель администратора баз данных и просмотрите пользователей и профили в разделе «Безопасность».

browsing users and profiles in SQL Developer


2

thatjeffsmith
11 Сен 2015 в 14:42

В то время как другие решения предоставляют заявления об изменении лимита сеанса пользователя, диагностические запросы у меня не работали, хотя я полный новичок и, возможно, выполнил это неправильно. Следующие запросы от Atlassian помог мне.

Для проверки количества сеансов на пользователя, чтобы вы могли видеть, какие пользователи приближаются к своему пределу:

SELECT count(*) as connections, 
       username 
FROM   v$session 
GROUP  BY username 
ORDER  BY username; 

И проверить, какой это предел:

SELECT DISTINCT username, 
                profile, 
                resource_name, 
                limit
FROM   dba_profiles 
       NATURAL JOIN dba_users 
WHERE  resource_name = 'SESSIONS_PER_USER';

Оттуда остальная часть связанного сайта или другие решения здесь, вероятно, могут помочь с изменением лимита в соответствии с вашими потребностями.


0

Blaisem
16 Июл 2020 в 05:38

Начните с этого запроса, чтобы узнать, сколько сеансов вы используете

select count(*) from v$session where username='YourUser';

Затем узнайте, сколько вам разрешено в профиле для вашего пользователя

select profile from dba_users where username ='YourUser';

Ну наконец то

select PROFILE, LIMIT
from dba_profiles
WHERE RESOURCE_NAME = 'SESSIONS_PER_USER'
AND PROFILE = 'YourUserProfile';

И исправление

Alter profile YourUserProfile  limit SESSIONS_PER_USER 100;

Ограничения существуют по определенной причине, поскольку каждый сеанс потребляет ресурсы. Если вы увеличиваете лимит, необходимо тщательно спланировать производственные системы, чтобы у вас не закончилась память.


3

Jeromy French
12 Ноя 2019 в 14:03

Это настройка профиля

SELECT * FROM DBA_PROFILES WHERE RESOURCE_NAME = 'SESSIONS_PER_USER';

Вы можете изменить его, используя

ALTER PROFILE <profile name> LIMIT SESSIONS_PER_USER <number>;

Или

ALTER PROFILE <profile name> LIMIT SESSIONS_PER_USER UNLIMITED;


3

Husqvik
11 Сен 2015 в 14:24

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Oracle network error
  • Ora 01843 not a valid month ошибка
  • Ora error 471
  • Oracle net configuration assistant failed windows 10 как исправить
  • Ora 01843 not a valid month как исправить

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии