Oracle's Real-Time SQL Monitoring feature (V$SQL_MONITOR)
Read bind variable values of currently executing SQL
If you are running on Oracle 11.2+ and have the licenses for Oracle Diagnostics & Tuning Packs and when Oracle's SQL monitoring feature actually kicks in, then you can use V$SQL_MONITOR to view the bind variable values of currently executing SQL. Normally the bind variable values live in the private memory (PGA) of a process, but when SQL Monitoring kicks in for a statement in Oracle 11.2, it will copy the current bind variable values to SGA (V$SQL_MONITOR), so these will be readable by other users (like you, who's trying to troubleshoot a performance problem) as well.
A little example, executed on Oracle 18.104.22.168 is here. I set up couple of bind variables and then run a query which is designed to take very long time to complete:
Once the SQL monitoring kicks in (in about 5 seconds of CPU + IO wait time usage by default), the bind variable values will appear in V$SQL_MONITOR.BIND_XML column for my session:
Here you go, in addition to current bind variable values I even see the bind variable data types (and their max lengths) which can be useful when troubleshooting some types or problems (like cursor sharing or implicit datatype conversion related problems).
Note that there's an undocumented parameter _sqlmon_binds_xml_format which controls whether the bind values are shown in human-readable format or a hex-dump in the BINDS_XML column:
So, if you are not running on Oracle 11.2 or you don't have Diag+Tuning pack licenses or if the SQL Monitoring just doesn't kick in due to some bug, then what to do?
Well then you can go back to the old-fashioned way of connecting to the target process via ORADEBUG, issuing an ERRORSTACK level 3 dump and read the contents of the tracefile. I have explained it here.