top of page

CerebroSQL: main window

Открытая·2 пользователя

Oracle open cursor information

[EN]

Viewing information about open cursors by sessions in the Oracle DBMS

Database parameter open_cursors

Specifies the maximum number of open cursors (handles to private SQL areas) that a session can have at one time. You can use this setting to prevent a session from opening too many cursors. It is important to set the OPEN_CURSORS value high enough to prevent your application from running out of open cursors. The number will vary from one application to another. Assuming the session does not open the number of cursors specified in OPEN_CURSORS, setting this value higher than is actually necessary does not incur any additional overhead.


Opening a window

  • Action menu - Open cursor

  • In the main window, click on the line "open cursor"




select a.value,

       s.username,

       nvl(s.OSUSER,'-')||' ('|| nvl(s.MACHINE,'-')||')' US,

       s.sid||':'||s.serial# SS,

       '300' MAX_OPEN

  from v$sesstat a,

       v$statname b,

       v$session s

where a.statistic# = b.statistic#

   and s.sid=a.sid

   and b.name = 'opened cursors current'

   and s.username is not null

order by a.value desc


View detailed information

Select a session in the list "List session"



  • In the Session information block - information about the session from v$session will be displayed


select status, schemaname, osuser, machine, program, logon_time

  from v$session where sid=$$SID

  • "Cursor" tab - list of all session cursors with their state


select SQL_ID, SQL_TEXT, cursor_type

  from V$OPEN_CURSOR oc where oc.sid=$$SID


Viewing details about SQL queries

In the list of cursors on the "Cursor" tab, double-click on any line



Window structure

  • Query text - SQL query text

select SQL_FULLTEXT, HASH_VALUE from v$sql where sql_id=$$SQL_ID

  • Query plan execute - SQL query execution plan


select * from TABLE(DBMS_XPLAN.DISPLAY_CURSOR('$$SQL_ID'))

  • Event - session waits when executing a request (data for the last 10 minutes). Information is retrieved from a local database. Data is collected by the system when the Monitoring mode is enabled - Use mode "Real-time" in the program settings


select count(*) "CountRW",

       c_event

  from cer_ash_database c

 where c_dbname = $$CONNECTALIAS

   and c_dbts>= datetime('now','-600 seconds','localtime')

   and c_dbts< datetime('now','-1 seconds','localtime')

   and c_sql_id="$$SQL_ID"

group by c_event

  • Session list - a list of sessions that executed the request in the last 10 minutes. Information is retrieved from a local database. Data is collected by the system when the Monitoring mode is enabled - Use mode "Real-time" in the program settings


select c_sid,

       c_serial,

       c_username||'@'||c_machine "hm"

  from cer_ash_database c

 where c_dbname = $$CONNECTALIAS

   and c_dbts>= datetime('now','-600 seconds','localtime')

   and c_dbts< datetime('now','-1 seconds','localtime')

   and c_sql_id="$$SQL_ID"

group by c_sid||':'||c_serial||'['||c_username||'@'||c_machine||']'

order by c_sid



[RU]

Просмотр информации о открытых курсорах сессиями в СУБД Oracle

Параметр БД open_cursors

Указывает максимальное количество открытых курсоров (дескрипторов частных областей SQL), которые сеанс может иметь одновременно. Вы можете использовать этот параметр, чтобы предотвратить открытие сеансом чрезмерного количества курсоров. Важно установить значение OPEN_CURSORS достаточно высоким, чтобы предотвратить нехватку открытых курсоров в вашем приложении. Число будет варьироваться от одного приложения к другому. Предполагая, что сеанс не открывает количество курсоров, указанное в OPEN_CURSORS, установка этого значения выше, чем это действительно необходимо, не требует дополнительных затрат.


Открытие окна

  • Меню Action - Open cursor

  • В основном окне кликнув по строке "open cursor"



select a.value,

s.username,

nvl(s.OSUSER,'-')||' ('|| nvl(s.MACHINE,'-')||')' US,

s.sid||':'||s.serial# SS,

'300' MAX_OPEN

from v$sesstat a,

v$statname b,

v$session s

where a.statistic# = b.statistic#

and s.sid=a.sid

and b.name = 'opened cursors current'

and s.username is not null

order by a.value desc



Просмотр подробной информации

Выделить сессию в списке "List session"



  • В блоке Session information - отобразится информация о сессии из v$session


select status, schemaname, osuser, machine, program, logon_time

from v$session where sid=$$SID

  • Вкладка "Cursor" список всех курсоров сессии с их состоянием


select SQL_ID, SQL_TEXT, cursor_type

from V$OPEN_CURSOR oc where oc.sid=$$SID


Просмотр сведений о SQL запросах

В списке курсоров на вкладке "Cursor" дважды кликнуть по любой строке



Структура окна

  • Query text - текст SQL запроса


select SQL_FULLTEXT, HASH_VALUE from v$sql where sql_id=$$SQL_ID

  • Query plan execute - план выполнения SQL запроса


select * from TABLE(DBMS_XPLAN.DISPLAY_CURSOR('$$SQL_ID'))

  • Event - ожидания сессий при выполнении запроса (данные за последние 10 минут). Информация извлекается из локальной базы данных. Данные собираются системой при включенном режиме Monitoring - Use mode "Real-time" в настройках программы


select count(*) "CountRW",

c_event

from cer_ash_database c

where c_dbname = $$CONNECTALIAS

and c_dbts>= datetime('now','-600 seconds','localtime')

and c_dbts< datetime('now','-1 seconds','localtime')

and c_sql_id="$$SQL_ID"

group by c_event

  • Session list - список сессий выполнивших запрос за последние 10 минут. Информация извлекается из локальной базы данных. Данные собираются системой при включенном режиме Monitoring - Use mode "Real-time" в настройках программы


select c_sid,

c_serial,

c_username||'@'||c_machine "hm"

from cer_ash_database c

where c_dbname = $$CONNECTALIAS

and c_dbts>= datetime('now','-600 seconds','localtime')

and c_dbts< datetime('now','-1 seconds','localtime')

and c_sql_id="$$SQL_ID"

group by c_sid||':'||c_serial||'['||c_username||'@'||c_machine||']'

order by c_sid


24 просмотра

О группе

Добро пожаловать в группу! Общайтесь с другими участниками, получайте обновления и делитесь фото и видео.

Участники

bottom of page