1. 首页 > ITPUX技术网 > 正文

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 <> tablespace.alert
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]

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息