MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/rdbms/xml/em/orarep/optstats/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/rdbms/xml/em/orarep/optstats/optstatsHtml.xsl

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- +++++++++++++++++++++++++++ global variables ++++++++++++++++++++++++++  -->
<!-- report detail level -->
<xsl:variable name="level" select="/report/header/level"/>
<!-- is the first operation an auto stats gathering operation -->
<xsl:variable name="auto" 
              select="count(/report/operations/operation[position()=1 and contains(@name,'(auto)')])"/>
<!-- is this a cdb-wide report? -->
<xsl:variable name="cdb" 
  select="count(/report/operations/operation[position()=1]/@container_id)"/>

<xsl:template match="/">
 <html>
 <head>
 <title> 
   Optimizer Statistics Operations Report 
 </title>
  <style type="text/css">
    body, table, input, select, textarea
    {font:normal normal 8pt Verdana,Arial;text-decoration:none;color:#000000;}
    .s8 {font-size:8pt;color:#006699}
    .s9 {font-size:10pt;color:#006699}
    .s10 {font-size:14pt;color:#006699;}
    .s16 {border-width : 1px; border-color : #CCCC99;
            border-style: solid;color:#006699;font-size:8pt;}
    .s17 {border-width : 1px; border-color : #CCCC99;
           border-style: solid;font-size:8pt;}
    .s27 {border-width : 1px; border-color : #CCCC99; border-style: solid;}
   </style>
 </head>
 <body>
         <table class="ex" cellspacing="0" border="1" width="100%">
           <tr BORDERCOLOR="#336699">
              <xsl:if test="$cdb">
              <th align="left" bgcolor="#CCCC99" class="s16">CDB Id</th>
	      </xsl:if>
	      <th align="left" bgcolor="#CCCC99" class="s16">Operation Id</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Operation</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Target</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Start Time</th>
              <th align="left" bgcolor="#CCCC99" class="s16">End Time</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Status</th>
	    <xsl:if test="$level!='BASIC'">
              <th align="left" bgcolor="#CCCC99" class="s16">Total Tasks</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Successful Tasks</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Failed Tasks</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Active Tasks</th>
	     <xsl:if test="$level!='TYPICAL'">
              <th align="left" bgcolor="#CCCC99" class="s16">Job Name</th>
	      <th align="left" bgcolor="#CCCC99" class="s16">Session Id</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Additional Info</th>
	     </xsl:if>
	    </xsl:if>  
           </tr>


           <xsl:apply-templates select="report/operations/operation"/>
         </table>
	
	 <xsl:apply-templates select="report/operations/operation/tasks"/>     
  </body>
 </html>
</xsl:template>

<!-- +++++++++++++++++++++++++++ operation ++++++++++++++++++++++++++  -->
<xsl:template match="operation">
  
            <tr valign="top"  class="s16">
               <xsl:if test="$cdb">
               <td><xsl:value-of select="./@container_id"/></td>
 	       </xsl:if>
	       <td><xsl:value-of select="./@id"/></td>
	       <td><xsl:value-of select="./@name"/></td>
               <td><xsl:value-of select="./@target"/></td>
               <td><xsl:value-of select="./@start_time"/></td>
               <td><xsl:value-of select="./@end_time"/></td>
               <td><xsl:value-of select="./@status"/></td>
	     <xsl:if test="$level!='BASIC'">
               <td><xsl:value-of select="./@total_objects"/></td>
               <td><xsl:value-of select="./@num_completed"/></td>
               <td><xsl:value-of select="./@num_failed"/></td>
               <td><xsl:value-of select="./@num_inprogress"/></td>
	      <xsl:if test="$level!='TYPICAL'">
               <td><xsl:value-of select="./@job_name"/></td>
	       <td><xsl:value-of select="./@session_id"/></td>
               <td> 
                 <xsl:if test="params">
                   <b><xsl:text>Parameters: </xsl:text></b>  
                 </xsl:if>
                 <xsl:for-each select="./params/param">
                   <xsl:text>[</xsl:text>  
                     <xsl:value-of select="./@name"/>:
                     <xsl:value-of select="./@val"/>
                   <xsl:text>] </xsl:text>
                 </xsl:for-each>
		 <xsl:if test="error">
                   <br/><b><xsl:text>Error: </xsl:text></b>
		   <xsl:value-of select="./error/text()"/>  
                 </xsl:if>
               </td>
	      </xsl:if>
	    </xsl:if>  
          </tr>     
	           	    
</xsl:template>

<!-- +++++++++++++++++++++++++++ tasks ++++++++++++++++++++++++++  -->
<xsl:template match="tasks">
  <table class="ex" cellspacing="0" border="1" bgcolor="#FFE87C" width="100%">       
       <tr valign="center"  class="s16">
         <td align="center">
           <hr/><b><font size="2"> T   A   S   K   S </font></b> <hr/>
          <table class="ex" cellspacing="0" border="1" bgcolor="#FFFFFF" width="97%">	 
           <tr BORDERCOLOR="#336699">
              <th align="left" bgcolor="#CCCC99" class="s16">Target</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Type</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Start Time</th>
              <th align="left" bgcolor="#CCCC99" class="s16">End Time</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Status</th>
            <xsl:if test="$level='ALL'">    
              <th align="left" bgcolor="#CCCC99" class="s16">Rank</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Job Name</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Estimated Cost</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Batching Info</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Histogram Columns</th>
              <th align="left" bgcolor="#CCCC99" class="s16">Extended Stats</th>
             <xsl:if test="$auto">
              <th align="left" bgcolor="#CCCC99" class="s16">Reason Code</th>
	     </xsl:if>
              <th align="left" bgcolor="#CCCC99" class="s16">Additional Info</th>
            </xsl:if>
            </tr>

            <xsl:apply-templates select="task"/>
          </table>
	  <br/>
       </td>
      </tr>   
  </table>     
</xsl:template>


<!-- +++++++++++++++++++++++++++ task ++++++++++++++++++++++++++  -->
<xsl:template match="task">
  
            <tr valign="top"  class="s16">
               <td><xsl:value-of select="./@target"/></td>
               <td><xsl:value-of select="./@target_type"/></td>
               <td><xsl:value-of select="./@start_time"/></td>
               <td><xsl:value-of select="./@end_time"/></td>
               <td><xsl:value-of select="./@completion_status"/></td>
             <xsl:if test="$level='ALL'">    
               <td><xsl:value-of select="./@rank"/></td>
               <td><xsl:value-of select="./@job_name"/></td>
               <td><xsl:value-of select="./@estimated_cost"/></td>
               <td><xsl:value-of select="./@batching_info"/></td>
               <td><xsl:value-of select="./@histograms"/></td>
               <td><xsl:value-of select="./@extended_stats"/></td>
	      <xsl:if test="$auto">
               <td><xsl:value-of select="./@reason_code"/></td>
	      </xsl:if>
               <td><xsl:value-of select="./@additional_notes"/></td>
             </xsl:if>
            </tr>            
</xsl:template>


</xsl:stylesheet>

OHA YOOOO