Getting your bind variables back

  1. Get a heap dump. 
    • For the pipeline:
      1. Hook up jconsole to the instance
      2. select com.sun.management
      3. select operations
      4. click on dumpHeap. The dump will be local to java instance you connected to, put in a file name, and click true.
      5. Transfer that file back to your computer
  2. Open up the heap dump in Netbeans
    • Go to Profile -> Load Heap Dump
    • Select your heap dump
  3. Find your statements with OQL:
    • For prepared statements use:
      select {instance: sql, content: sql.sqlObject.odbc_sql.toString()} from oracle.jdbc.driver.T2CPreparedStatement sql
    • For callable statements (i.e. stored procedures) use:
      select {instance: sql, content: sql.sqlObject.odbc_sql.toString()} from oracle.jdbc.driver.T2CCallableStatement sql
  4. For the prepared statements, take a look at the content. The content should be the sql you are looking for.
  5. You're going to have to look through the bind variables in the T2C*Statement.  Usually called lastBound* or boundInt, boundLong, etc...
  • No labels