#!/bin/bash
# Check database space
#############################################################
SQLPATH=/home/oradba/chk
CHKFILE=$SQLPATH/spaceUsage.txt
TMPFILE=$SQLPATH/log/chk_db.tmp
ORACLE_HOME=/opt/oracle/product/9.2.0;export ORACLE_HOME
ORACLE_SID=dbcenter;export ORACLE_SID
NLS_LANG=american_america.ZHS16GBK;export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data;export ORA_NLS33
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
echo 'Check System Free Space:' >$CHKFILE
df -h >>$CHKFILE
echo ' ' >>$CHKFILE
$ORACLE_HOME/bin/sqlplus /nolog <>/dev/null
connect system/lido
set echo off
set pagesize 0
set verify off
set feedback off
set heading off
set termout off
set embedded on
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
spool $TMPFILE
@@$SQLPATH/chk.sql
EOF
cat $TMPFILE>>$CHKFILE
mail-files F10 HangQTs $CHKFILE
阅读(476) | 评论(0) | 转发(0) |