bash自动查询表空间及上传脚本
[mw_shl_code=shell,false]#!/bin/ksh
ipadder=`ifconfig -a|awk '/(cast)/ {print $2}'|cut -d':' -f2|head -1`
name=`hostname`
systime=`date`
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export ORACLE_SID=bccb11
export ORACLE_TERM=xterm
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$PATH:$HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:/sbin
sqlplus -s / as sysdba <
echo $ipadder >> tablespace.alert
echo $name >> tablespace.alert
echo $systime >> tablespace.alert
echo "########################################################################" >> tablespace.alert
ftp -in << EOF
open 192.168.10.11
user oracle oracle
bin
lcd /home/oracle
put tablespace.alert
bye
EOF
rm -rf /home/oracle/tablespace.alert[/mw_shl_code]