Source of the problem
If the trace (.trc) file is missing Bind Variable values (or Parameter values in a OracleCommand in ODP.NET for example) this is due to the way the trace has been started.
If you use one of the following commands as the Using Application Tracing Tools page states:
ALTER SESSION SET SQL_TRACE = TRUE;
EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
..you are not recording bind values!
Solution
To record bind variable values there are other, alternative ways, to start the trace depending on your Database version and loaded packages.
If you are on Oracle 10g+ the easiest way is to use the following command to start the trace:
DBMS_MONITOR.session_trace_enable(waits=>FALSE, binds=>TRUE)
Here is the complete list of available commands to start the trace with bind variables recording (source: SQL trace, 10046, trcsess and tkprof in Oracle 10g):
-- All versions.
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
EXEC DBMS_SYSTEM.set_ev(si=>123, se=>1234, ev=>10046, le=>4, nm=>' ');
-- All versions, requires DBMS_SUPPORT package to be loaded.
EXEC DBMS_SUPPORT.start_trace(waits=>FALSE, binds=>TRUE);
EXEC DBMS_SUPPORT.start_trace_in_session(sid=>123, serial=>1234, waits=>FALSE, binds=>TRUE);
-- Oracle 10g
EXEC DBMS_MONITOR.session_trace_enable(waits=>FALSE, binds=>TRUE);
EXEC DBMS_MONITOR.session_trace_enable(session_id =>1234, serial_num=>1234, binds=>TRUE, binds=>TRUE);
EXEC DBMS_MONITOR.client_id_trace_enable(client_id=>'tim_hall', waits=>FALSE, binds=>TRUE);
EXEC DBMS_MONITOR.serv_mod_act_trace_enable(service_name=>'db10g', module_name=>'test_api', action_name=>'running', -
> waits=>FALSE, binds=>TRUE);