Generate Excel and PDF in Oracle and Send Report by Email

First Install UTL_MAIL ### To install UTL_MAIL: [code language="sql"] sqlplus sys/**** @$ORACLE_HOME/rdbms/admin/utlmail.sql @$ORACLE_HOME/rdbms/admin/prvtmail.plb [/code] ### Create a Reporting User ### [code language="sql"] create user tctreport identified by tctreport; grant connect to tctreport; grant dba to tctreport; sqlplus tctreport/tctreport [/code] ## Grant TCTREPORT User permission to execute UTL_MAIL ## [code language="sql"] sqlplus "/as sysdba" grant execute … Continue reading Generate Excel and PDF in Oracle and Send Report by Email

Generate Excel | CSV Report from SQL*PLUS

Shell Script to generate a column seperator report in SQL*PLUS using a shell script. It can be opened in Excel and or text editor like NOTEPAD++   #!/bin/ksh . $HOME/.bash_profile NOW=$(date +”%a %b %e %T %Y”) HOST=$(hostname) MON2=$(date +”%b%Y”) cd $HOME/scripts rm -rf Report_$MON2.csv sqlplus -s /NOLOG << EOF > /tmp/log.txt CONNECT abc/***** set colsep … Continue reading Generate Excel | CSV Report from SQL*PLUS