@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display Pluggable databases
*  Versions   : 12.1 and above
*  Parameters : None
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  04-Aug-15  Vishal Gupta  Created
*/


PROMPT
PROMPT *********************************************
PROMPT *  Pluggable Databases
PROMPT *********************************************
 

COLUMN con_id                   HEADING "Con|ID"                     FORMAT 999
COLUMN dbid                     HEADING "DBID"                       FORMAT 9999999999999
COLUMN name                     HEADING "PluggableDBName"            FORMAT a20
COLUMN open_mode                HEADING "OpenMode"                   FORMAT a10
COLUMN restricted               HEADING "Restricted"                 FORMAT a10
COLUMN open_time                HEADING "OpenTime"                  FORMAT a35
COLUMN total_size               HEADING "Total|Size|(MB)"            FORMAT 999,999,999
COLUMN block_size               HEADING "Block|Size"                 FORMAT 99,999
COLUMN recovery_status          HEADING "Recovery|Status"            FORMAT a10
COLUMN snapshot_parent_con_id   HEADING "Snapshot|Parent|Con ID"      FORMAT 999

SELECT p.con_id
     , p.dbid
     , p.name
     , p.open_mode
     , p.restricted
     , p.open_time
     , ROUND(p.total_size/power(1024,2))  total_size
     , p.block_size
     , p.recovery_status
     , p.snapshot_parent_con_id
  FROM gv$pdbs p
;


@@footer