unix、linux oracle rman导出脚本

::说明
:这个脚本是在oracle监听不可以正常使用的情况下使用。
:或者是直接手动备份oracle数据库时使用。
============================================================

1、修改系统/etc/crontab文件

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
上面是系统默认的,下面是自行添加的。
34 14 * * * root run-parts /home/oracle/backup3/client/bin/temppath  #调用脚本路径

2、/home/oracle/backup3/client/bin/temppath/*.sh脚本内容

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10G
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=ZSDB
export LANG=zh_CN
export NLS_LANG=AMERICAN
rm -rf /opt/oracle/wavetop/OraExp/*
rman @/home/oracle/backup3/client/bin/temppath/bak.rman #调用rman脚本

3、被调用rman脚本内容如下:

connect target sys/sys
connect catalog yyshuju/yyshuju@rman
run {
allocate channel c0 type disk
maxpiecesize = 1073741824
format '/opt/oracle/wavetop/OraExp/BACKUP_1304745304_%U.OD0';
backup
incremental level 0
skip inaccessible
tag Backup_Level0
database;
release channel c0;
allocate channel c0 type disk
maxpiecesize = 1073741824
format '/opt/oracle/wavetop/OraExp/BACKUP_1304745304_%U.ocl';
backup
skip inaccessible
tag Backup_Controlfile
current controlfile;
release channel c0;
}
exit

 

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

转载于:http://blog.itpub.net/7755871/viewspace-738425/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值