Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is there a way to capture complete query along with the bind values in oracle ?

Sai ChallaSep 9 2015 — edited Sep 10 2015

I am trying to capture all the queries being executed on a table in the database. These queries will be stored in a table and will be later executed on a different database to keep both the databases synchronized. In the trigger we are using the below select statement to capture the query :

select sq.sql_text from v$open_cursor oc,v$sql sq where sid = sys_context('USERENV','SID') order
by sq.last_active_time desc ;

But, if the queries are being executed as prepared statements then the above query being used is capturing the sql statements as:

UPDATE <TABLE_NAME> SET COL1_NAME = :1   WHERE COL2_NAME =:2   AND COL3_NAME = :3

I am unable to get the values of the above fields in my query. Is there any other way that I can achieve this and get the complete query ?

Comments

cormaco

If you install Virtualbox on your MacBook, you can use this appliance to get an Oracle database:
Developer Day - Hands-on Database Application Development (oracle.com)

Billy Verreynne

Mac was supported years ago with 10g. Think that even RAC support was planned. (https://docs.oracle.com/cd/B19306_01/install.102/b25286.pdf)
As I heard things went south between Oracle and Apple, and the support for Mac was discontinued.

L. Fernigrini

There are no Mac version for Oracle Databases, but as cormaco mentioned you can easily use VirtualBox to have a VM with Linux (you can use Oracle Linux) and install Oracle 18c XE on it.
Or you can use the VM he already pointed, it has Oracle 19c pre installed, and you can add 18c XE if you need (if you just want to test or do some Proof of Concept, then using the 19c should be OK, if you want to use it for commercial / production then you need either a license or to use the free XE edition).

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 8 2015
Added on Sep 9 2015
12 comments
589 views