Home » SQL & PL/SQL » SQL & PL/SQL » How to get the SQL queries based on SQL_ID. (Oracle 11G)
How to get the SQL queries based on SQL_ID. [message #588611] Thu, 27 June 2013 01:03 Go to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
Hi Experts,

I want to get the SQL queries based on SQL_ID.
I have tried the following query,but I am not getting full query.

SET linesize 132 pagesize 999
column sql_fulltext format a60 word_wrap
break on sql_text skip 1
SELECT   REPLACE (TRANSLATE (sql_text, '0123456789', '999999999'), '9', ''),sql_id
FROM   dba_hist_sqltext s
WHERE   s.sql_id = '7tvurftg8zryb';


One of my friend said use grid to get full query text.
Can you please help me how to use grid ,else any other method to get the full query based on SQL_ID.

Please help me.

Thanks in advance.
Re: How to get the SQL queries based on SQL_ID. [message #588613 is a reply to message #588611] Thu, 27 June 2013 01:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
And what is the problem with your query?
Note that the text of SQL currently in SGA can be gotten faster using v$sql (or v$sqltext).

Regards
Michel
Re: How to get the SQL queries based on SQL_ID. [message #588620 is a reply to message #588613] Thu, 27 June 2013 02:25 Go to previous messageGo to next message
ajaykumarkona
Messages: 399
Registered: August 2010
Senior Member
I am not getting full SQL code.
Some code is missing.
Please help me.

Thanks.
Re: How to get the SQL queries based on SQL_ID. [message #588621 is a reply to message #588620] Thu, 27 June 2013 02:47 Go to previous message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
set long 10000000


Regards
Michel
Previous Topic: Query Help..
Next Topic: i want to extract data from my local database table to text file using plsql
Goto Forum:
  


Current Time: Wed Aug 20 06:18:58 CDT 2025