sql text - cheeyoung/sqlplus-public GitHub Wiki

Views

Examples

sql_fulltext column in V$SQLAREA and V$SQL view

set long 10000

SELECT sql_id
, sql_fulltext
FROM v$sqlarea
WHERE sql_id = :vc_sql_id
/

piece and sql_text columns in V$SQLTEXT


VC_SQL_ID                                                                       
--------------------------------------------------------------------------------
1fkh93md0802n                                                                   


SYSDATE                                                                         
-------------------                                                             
2017-02-06 05:37:56                                                             


      DBID NAME      DB_UNIQUE_NAME                 CREATED                     
---------- --------- ------------------------------ -------------------         
PLATFORM_NAME                                                                   
--------------------------------------------------------------------------------
 656224430 ......    ......                         2015-12-10 13:02:46         
Solaris[tm] OE (64-bit)                                                         
                                                                                


INSTANCE_NUMBER INSTANCE_NAME                                                   
--------------- ----------------                                                
HOST_NAME                                                                       
----------------------------------------------------------------                
VERSION           STARTUP_TIME        PAR    THREAD#                            
----------------- ------------------- --- ----------                            
              1 S111W6                                                          
........                                                                        
11.1.0.7.0        2017-02-06 02:49:04 NO           1                            
                                                                                

         0 select   LOW_OPTIMAL_SIZE,           HIGH_OPTIMAL_SIZE,              
         1   OPTIMAL_EXECUTIONS,           ONEPASS_EXECUTIONS,           MU     
         2 LTIPASSES_EXECUTIONS,           TOTAL_EXECUTIONS    from   GV$SQ     
         3 L_WORKAREA_HISTOGRAM    where  INST_ID = USERENV('Instance')         

References

10.71 V$SQLAREA 21c
10.46 V$SQL 21c
10.78 V$SQLTEXT 21c