#!/bin/ksh
ORACLE_HOME=/oracle/app/oracle/product/9.2.0.8;export ORACLE_HOME
ORACLE_SID=800P; export ORACLE_SID
$ORACLE_HOME/bin/sqlplus -s “/ as sysdba” <
      set timing on
      set verify off
      spool /db25/paresh/hourly_ratio.lst
      select to_char(sysdate, ‘DD-MON-RRRR:HH24:MI:SS’) from dual;
      prompt ‘Total distinct users and total user sessions’
      select count(distinct username), count(1), round(count(1)/count(distinct username),1 )
        from v$session where username is not null;
      spool off
      EXIT
EOF
mailx -s “ATLAS total distinct users and total sessions counts” pmehta@1800flowers.com,rmagesh@1800flowers.com,bingram@1800flowers.com
