@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display all SQL Profiles
*  Parameters : 
*          
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  16-May-12  Vishal Gupta  First cut
*/

COLUMN  name               HEADING "Name"                         FORMAT a30
COLUMN  category           HEADING "Category"                     FORMAT a15
COLUMN  created            HEADING "Created"                      FORMAT a15
COLUMN  last_modified      HEADING "LastModified"                 FORMAT a15
COLUMN  force_matching     HEADING "Force|Match"                  FORMAT a5
COLUMN  sql_id             HEADING "SQL_id"                       FORMAT a13
COLUMN  signature          HEADING "Signature"                    FORMAT 999999999999999999999
COLUMN  description        HEADING "Description"                  FORMAT a50

--BREAK ON name ON CATEGORY ON created ON last_modified ON type ON status ON force_matching ON signature ON description

SELECT /*+ ORDERED */ 
       sp.name
     , sp.category
     , to_char(sp.created,'DD-MON-YY HH24:MI') created
     , to_char(sp.last_modified,'DD-MON-YY HH24:MI') last_modified
     , sp.type
     , sp.status
     , sp.force_matching
     , sys.DBMS_SQLTUNE_UTIL0.SQLTEXT_TO_SQLID(sp.sql_text) sql_id
     , sp.signature
     , sp.description
  FROM dba_sql_profiles sp
ORDER BY sp.last_modified DESC  
;  

@@footer
