I have this huge query running in production that is using up all the temp tablespace. I put the complete query together using the v$sqltext view and it is using bind valirables. How do I get the values of these bind variables ? v$sql_cursor does not have that sql address anymore, so I am not able to retrive the data from v$sql_bind_data. And this is on Oracle 9.2.0.5. Any suggestions appreciated.
Here is the query I ran to figure out what is using the temp tablespace :
and here is the query I was trying to run to get the values for the bind variables :Code:SELECT a.TABLESPACE, b.SID, b.status, b.serial#, c.address, SUM(a.blocks) ,c.sql_text, c.piece FROM v$sort_usage a,v$session b,v$sqltext c, v$sql_cursor sqlc , v$sql_bind_data sqlbd WHERE a.session_addr = b.saddr AND b.sql_address = c.address AND c.address = sqlc.parent_handle AND sqlbd.cursor_num = sqlc.curno GROUP BY a.TABLESPACE, b.SID, b.status, b.serial#, c.address, c.sql_text, c.piece ORDER BY a.TABLESPACE,b.SID,b.serial#,c.address, c.piece;
Thanks.Code:SELECT SQL.sql_text line, sqlbd.cursor_num, sqlbd.position, sqlbd.datatype, 'xx' || sqlbd.VALUE || 'xx' FROM v$sql SQL, v$sql_cursor sqlc , v$sql_bind_data sqlbd WHERE SQL.address = '3E601000' AND SQL.address=sqlc.parent_handle AND sqlbd.cursor_num = sqlc.curno


Reply With Quote
Bookmarks