Tuesday, July 31, 2012

Caputure Bind variables monitoring 11gr2

A developer ask me if i could give him the values of the bind variable.
There are several ways do this. In 11gr2 there is a way to capture the values of bind variable in currently running SQL.
You must have the enterprise edtion of Oracle 11gr2 and have the lisences for diagnostics & tuning packs.
If not i will show you other ways to get the values.

But here is an example of getting the values using oracle's real time monitoring
SQL>var id number
SQL>var naam varchar2(50)
SQL>exec :id :=71757;
SQL>exec :naam :='WRH$_SQLSTAT_PK';