@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display Exadata Cell Version
*  Parameters : None
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------------
*  05-Mar-14  Vishal Gupta  Added server mode to exadata model translation
*  20-Feb-13  Vishal Gupta  Created
*
*/


PROMPT 
PROMPT **************************************************
PROMPT *  E X A D A T A   C E L L    C O N F I G
PROMPT **************************************************


COLUMN cell_path                   HEADING "CellPath"                 FORMAT a15
COLUMN cellname                    HEADING "CellName"                 FORMAT a18
COLUMN id                          HEADING "Id "                      FORMAT a12
COLUMN exa_model                   HEADING "Exa|Model"                FORMAT a5
COLUMN makeModel                   HEADING "MakeModel"                FORMAT a30
COLUMN upTime                      HEADING "UpTime"                   FORMAT a15
COLUMN cellVersion                 HEADING "CellVersion"              FORMAT a35
COLUMN kernelVersion               HEADING "KernelVersion"            FORMAT a30
COLUMN releaseVersion              HEADING "Release|Version"          FORMAT a20
COLUMN releaseTrackingBug          HEADING "Release|Tracking|Bug"     FORMAT a20
COLUMN flashCacheMode              HEADING "FlashCache|Mode"          FORMAT a12
COLUMN flashCacheCompress          HEADING "FlashCache|Compression"   FORMAT a12


SELECT cell.name cellname
     , CASE 
         WHEN cell.makeModel LIKE '%X4275%'    THEN 'V2'
         WHEN cell.makeModel LIKE '%X4270 M2%' THEN 'X2-2'
         WHEN cell.makeModel LIKE '%X4270 M3%' THEN 'X3-2'
         WHEN cell.makeModel LIKE '%X4270 M4%' THEN 'X4-2'
         WHEN cell.makeModel LIKE '%X5-2%'     THEN 'X5-2'
         ELSE ''
       END exa_model  
     , REPLACE(REPLACE(REPLACE(REPLACE(cell.makeModel
               ,'Oracle Corporation SUN FIRE ')
               ,'SUN MICROSYSTEMS SUN FIRE ')
               ,'Oracle Corporation ') 
               ,'ORACLE SERVER ')               makeModel
     , cell.cellVersion
     , cell.kernelVersion
     , cell.releaseVersion
     , cell.releaseTrackingBug
     , cell.flashCacheMode
 FROM v$cell_config cc
    , XMLTable('/cli-output/cell' PASSING XMLTYPE(confval) 
                   COLUMNS 
                        name                VARCHAR2(100) PATH 'name'
                      , makeModel           VARCHAR2(100) PATH 'makeModel'
                      , cellVersion         VARCHAR2(100) PATH 'cellVersion'
                      , kernelVersion       VARCHAR2(100) PATH 'kernelVersion'
                      , releaseVersion      VARCHAR2(100) PATH 'releaseVersion'
                      , releaseTrackingBug  VARCHAR2(100) PATH 'releaseTrackingBug'
                      , flashCacheMode      VARCHAR2(100) PATH 'flashCacheMode'
                      , flashCacheCompress  VARCHAR2(100) PATH 'flashCacheCompress'
                 ) cell
WHERE cc.conftype = 'CELL'
ORDER BY cellname
;



@@footer