12
返回列表 发新帖
楼主: kelindun

oralce自动备份的问题

[复制链接]
论坛徽章:
4
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33管理团队2006纪念徽章
日期:2006-04-16 22:44:45会员2006贡献徽章
日期:2006-04-17 13:46:34
11#
发表于 2001-11-8 02:06 | 只看该作者
scripts calling scripts calling scripts is the #1 problem.  at the end you don't know which env gets sourced.

the easiest and cleanest way is to write a self contained script.  don't rely on any other environment scripts, if you don't have to.
e.g.,

5 0 * * 6 /home/xyz/script/exp-db.sh

exp-db.sh:
#!/bin/sh
ORACLE_HOME=....
ORACLE_SID=...
PATH=$ORACLE_HOME/bin:....
export ORACLE_HOME ORACLE_SID PATH
exp PARFILE=exp-db.par FILE=SID.dmp.`date +"%Y%m%d-%H%M"` LOG=SID.log.`date +"%Y%m%d-%H%M"`

(date command might work differently depending on the os)

exp-db.par:
USERID=username/passwd
FULL=Y

if you want to be fancy, add other DIRECT, COMPRESS, BUFFER stuff.

the reason you still need a par file (in stead of putting everything on the exp command) is that you don't want username and passwd show up when someone does a ps.

make sure exp-db.par and exp-db.sh are in the same directory, if not, make sure you specify the full path to the par file.

i guarantee you this method will work, unless of course your database is down

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表