1. shell script: #!/bin/ksh export ORACLE_SID= export ORACLE_HOME= export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib export PATH=$ORACLE_HOME/bin:$HOME/dba:$PATH sqlplus -s " u/p@prod" <<EOF set verify off set feed off set pagesize 1000 set linesize 130 set head on set markup html on entmap ON spool on preformat off spool cap_report.xls @cap_report.sql spool off EOF BDATE=`sqlplus -s "u/p" <<EOF set pages 0 trimsp on feed off timing off time off select TRUNC(SYSDATE-7) from dual; exit EOF ` EDATE=`sqlplus -s "u/p" <<EOF set pages 0 trimsp on feed off timing off time off select TRUNC(SYSDATE-1) from dual; exit EOF ` (echo "IBMS PROD load metrics and top SQL for $BDATE to $EDATE";uuencode cap_report.xls cap_report.xls)|mail -s "IBMS PROD load metrics and top SQL for $BDATE to $EDATE" email@email.com mv cap_report.xls cap_report.xls.`date +%Y%m%d%H%M%S` 2. the sql cap_re...