ITPub博客

首页 > IT职业 > IT生活 > 没事干写个每天导出的教本

没事干写个每天导出的教本

原创 IT生活 作者:foreverlee 时间:2005-04-11 16:12:23 0 删除 编辑

bash-2.05$ cat smbk.sh
#Backup script written by foreverlee
#version 1.2
#!/bin/sh
ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/product/9.2.0
ORACLE_SID=orcl
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

dateStr=`/bin/date +%Y%m%d`

dmpFileName=$dateStr'sm.dmp'
dmpLogName=$dateStr'sm.log'

dmpLocation='/oradata/orabk/'$dmpFileName
logLocation='/oradata/orabk/'$dmpLogName
$ORACLE_HOME/bin/exp xx/xx owner=xx file=$dmpLocation log=$logLocation rows=y FEEDBACK=100000 buffer=100000000

##rm last backup file
dateAgo=`date --date='1 days ago' +%Y%m%d`
rmDmpFileName=$dateAgo'sm.dmp'
rmDmpLocation='/oradata/orabk/'$rmDmpFileName
rm rmDmpLocation

[@more@]

bash-2.05$ cat smbk.sh
#Backup script written by liyong
#version 1.2
#!/bin/sh
ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/product/9.2.0
ORACLE_SID=orcl
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

dateStr=`/bin/date +%Y%m%d`

dmpFileName=$dateStr'sm.dmp'
dmpLogName=$dateStr'sm.log'

dmpLocation='/oradata/orabk/'$dmpFileName
logLocation='/oradata/orabk/'$dmpLogName
$ORACLE_HOME/bin/exp liyong/beijingya owner=sm file=$dmpLocation log=$logLocation rows=y FEEDBACK=100000 buffer=100000000

##rm last backup file
dateAgo=`date --date='1 days ago' +%Y%m%d`
rmDmpFileName=$dateAgo'sm.dmp'
rmDmpLocation='/oradata/orabk/'$rmDmpFileName
rm rmDmpLocation

--------------------

再补充一个

#Backup script writen by liyong
#2006.05.22
#version 1.2
#!/bin/sh
export ORACLE_BASE=/oas/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/wireless
export ORACLE_SID=wireless
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

#Set variable for this script.
dateStr=`/bin/date +%Y%m%d`
dmpFileName=$dateStr'wap.dmp'
dmpLogName=$dateStr'wap.log'
dmpLocation='/backup/wap/dataSource/'$dmpFileName
logLocation='/backup/wap/dataSource/'$dmpLogName

#Begin to dump.
echo $(date +"%y-%m-%d %H:%M:%S") >>$logLocation
echo "----------Begin to dump wap's data.-----------" >>$logLocation
exp liyong/beijingya owner=wap file=$dmpLocation log=$logLocation rows=y FEEDBACK=100000 buffer=100000000
echo "----------End to dump wap's data.-----------" >>$logLocation
echo $(date +"%y-%m-%d %H:%M:%S") >>$logLocation

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/76065/viewspace-795686/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-11-26

  • 博文量
    72
  • 访问量
    1356238