@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display restore points
*  Parameters : None
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  25-Apr-16  Vishal Gupta  Created
*/


/************************************
*  CONFIGURATION PARAMETERS
************************************/
DEFINE BYTES_FORMAT="9,999,999"
--DEFINE BYTES_HEADING="KB"
--DEFINE BYTES_DIVIDER="1024"
DEFINE BYTES_HEADING="MB"
DEFINE BYTES_DIVIDER="1024/1024"
--DEFINE BYTES_HEADING="GB"
--DEFINE BYTES_DIVIDER="1024/1024/1024"


PROMPT *****************************************************************
PROMPT *  Restore Points
PROMPT *****************************************************************


COLUMN time                          HEADING "Time"                  FORMAT a18
COLUMN name                          HEADING "Name"                  FORMAT a40
COLUMN guarantee_flashback_database  HEADING "Guar|ant'd"            FORMAT a5
COLUMN preserved                     HEADING "Pre|ser|ved"           FORMAT a3
COLUMN restore_point_time            HEADING "Restore|Point|Time"    FORMAT a18
COLUMN scn                           HEADING "SCN"                   FORMAT 999999999999999
COLUMN database_incarnation#         HEADING "DB|Inc#"               FORMAT 9999
COLUMN storage_size                  HEADING "Size(&&BYTES_HEADING)" FORMAT &&BYTES_FORMAT




SELECT TO_CHAR(r.time,'DD-MON-YY HH24:MI:SS')  time
     , r.name                                                      
	 , r.guarantee_flashback_database  
	 , r.preserved    
	 , r.database_incarnation#
	 , r.scn
	 , (r.storage_size)/&&BYTES_DIVIDER      storage_size                                        
     , TO_CHAR(r.restore_point_time,'DD-MON-YY HH24:MI:SS')  restore_point_time
  FROM v$restore_point r
ORDER BY r.time  
;
  

@@footer
