powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Oracle [игнор отключен] [закрыт для гостей] / bind variable
11 сообщений из 11, страница 1 из 1
bind variable
    #32104538
amdy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
I need to see the actual value of bind variables, but not by using 10046 Event Trace which writes to trace file. The goal is to write a script , but the following script got me nowhere:
declare
text varchar2(1024);
tracef utl_file.file_type;
begin
tracef:=utl_file.fopen('/aviv/app/oracle/admin/work/udump','bind.trc','w');
text:='';
FOR cr in
(select q.sql_text line, c.curno cno
from v$sql q, v$sql_cursor c
where q.address=c.parent_handle )
LOOP
text:=' Cursor#='||cr.cno||' SQL='||cr.line||' Bind Vars=';
FOR cr2 in
(select cursor_num,position,datatype, value from v$sql_bind_data
where value is not null and cursor_num=cr.cno)
LOOP
text:=text||' position:'||cr2.position||' type:'|| cr2.datatype||' Value=' || cr2.value;
END LOOP;
utl_file.put_line(tracef,text);
END LOOP;
end;

need to see value of bind variables of other sessions.

Thanks
...
Рейтинг: 0 / 0
bind variable
    #32104632
.dba
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Этот скрипт конечно ничего не даст, т.к. v$sql_bind_data показывает бинд переменные только своей сессии.

Непонятно, почему нельзя использовать 10046 Event Trace ???
...
Рейтинг: 0 / 0
bind variable
    #32104638
Фотография MaxU
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
1. why don't you like solution with "10046 Event Trace"?
2. Could you please explain this - "the following script got me nowhere"?
do you mean you're getting NULLS in "v$sql_bind_data.value" column?
...
Рейтинг: 0 / 0
bind variable
    #32104639
Фотография MaxU
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Гена!!!

за тобой не успеешь!
...
Рейтинг: 0 / 0
bind variable
    #32104652
amdy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Hi
The main reason the Trace is not the option is very simple. You have to analyze the trace files, which are not very readble and control your disk space.
Does anyone have experience with LogMiner ? Can it be the answer ?
...
Рейтинг: 0 / 0
bind variable
    #32104665
Фотография MaxU
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
hi again!
after playing with LogMiner you'll consider "Trace is the option is VERY simple" !


digging in code returned by LogMiner is "a pain in the ass", but i'm still not sure it allows to see values of bind variables, this was out of interest when i've been playing with LogMiner...


you'd better ask Tom , because if he doesn't know the answer then most probably nobody will help you...


PS just my 2 eurocents: i'd consider parsing Trace files instead...

good luck!
...
Рейтинг: 0 / 0
bind variable
    #32104754
ShgGena
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
I guess you have a wrong point of view on a trace file and on using of a event 10046.
You have to run TKPROF utility for prepare a trace file to a readble format ant then
you can read and research information from a trace without any problems.
...
Рейтинг: 0 / 0
bind variable
    #32104759
.dba
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
>You have to run TKPROF utility for prepare a trace file to a readble format ant
>then you can read and research information from a trace without any problems.

Мне кажется, что tkprof не парсит дополнительные уровни трассировки. Т.е. bind variables в выходном файле уже не останется.
...
Рейтинг: 0 / 0
bind variable
    #32104766
ShgGena
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
In most cases - Yes, this is correct, because EXPLAIN PLAN can't recognize type of a bind variables.
It can work with a varchar2 (or just character) variables only.
But you can avoid this limitation/restriction in sql statments by putting appropriate type conversions in the SQL statement.
...
Рейтинг: 0 / 0
bind variable
    #32104782
.dba
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
>In most cases - Yes, this is correct, because EXPLAIN PLAN can't recognize type
>of a bind variables. It can work with a varchar2 (or just character) variables only.
>But you can avoid this limitation/restriction in sql statments by putting
>appropriate type conversions in the SQL statement

так мы вроде о разных вещах говорим. Человек хочет увидеть значения bind variables (а не тип). Их можно получить в трейс-файл. Но после обработки tkprof их в выходном файле не будет, т.к. это не предусмотрено в утилите tkprof.
...
Рейтинг: 0 / 0
bind variable
    #32104794
ShgGena
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Soglasen. Znacheniya tolko rukami parsat.
Kstati a eto ideya moget bit napisat perl script, kotoriy parsaet
bind variables v trace file.
...
Рейтинг: 0 / 0
11 сообщений из 11, страница 1 из 1
Форумы / Oracle [игнор отключен] [закрыт для гостей] / bind variable
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]