Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
Markup HTML - fix column length of each row in each table in the output

Background: With shell script and Markup HTML on, we are fetching information from multiple databases hosted on different machines.

Every time, script connects to the database and fetches information(only one row is fetched from each database), it creates a new table and html code is appended to a logfile.

for SID in $(cat /home/oracle/rmanbackupreport_GG/scripts_GG/dblist);
do
 echo $SID
sqlplus -s username/\"PASSWORD\"@${SID} << EOF
 set feed off term off trims on linesize 300 pages 300 echo off underline off heading off
 set markup html on
 spool ${LOG_DIR}/rman_job_output.log
 set lines 220
 set pages 1000
 col cf for 9,999
 col df for 9,999
 col elapsed_seconds heading "ELAPSED|SECONDS"
 col i0 for 9,999
 col i1 for 9,999
 col l for 9,999
 col output_mbytes for 9,999,999 heading "OUTPUT|MBYTES"
 col status  entmap off
 col time_taken_display for a10 heading "TIME|TAKEN"
 col output_instance for 9999 heading "OUT|INST"
 select a.name,a.open_mode,
   to_char(j.start_time, 'yyyy-mm-dd hh24:mi:ss') start_time,
   to_char(j.end_time, 'yyyy-mm-dd hh24:mi:ss') end_time,
   (j.output_bytes/1024/1024) output_mbytes,
   case
   when  j.status='COMPLETED' then '<font color="green">'||j.status||'</font>'
   else '<font color="red">'||j.status||'</font>'
   end status,
   j.input_type,
   decode(to_char(j.start_time, 'd'), 1, 'Sunday', 2, 'Monday',
                                      3, 'Tuesday', 4, 'Wednesday',
                                      5, 'Thursday', 6, 'Friday',
                                      7, 'Saturday') dow,
   j.elapsed_seconds, j.time_taken_display
 from V\$RMAN_BACKUP_JOB_DETAILS j,V\$DATABASE a
 where j.start_time > trunc(sysdate)-3 and j.input_type <> 'ARCHIVELOG'
and j.session_stamp=(select max(session_stamp) from v\$RMAN_BACKUP_JOB_DETAILS j where j.start_time > trunc(sysdate)-7 and j.input_type <> 'ARCHIVELOG')
  /
 spool off
 exit
EOF
 cat ${LOG_DIR}/rman_job_output.log |grep -v 'SQL>'|grep -v 'SQL&gt'  >> ${LOG_DIR}/rman_job_status.txt
rm ${LOG_DIR}/rman_job_output.log
done
if [ -e ${LOG_DIR}/RMAN_REPORT.html ]
  then
    `rm   ${LOG_DIR}/RMAN_REPORT.html `
fi

Issue: When I combine all these tables using a logfile, width of each column is different in every row - which ultimately makes output look ugly.

Expectation: Is there a way that we can fix width of each column so that it looks like a single table.

Below is the current output -- Current output of the script

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda