Linux环境下rman备份的实例脚本
来源:互联网 发布:jenkins linux打包ios 编辑:程序博客网 时间:2024/05/22 00:50
背景:目标数据库192.168.1.172 Redhat Linux AS 3.0 Oracle 9.2.0.6
恢复目录数据库 192.168.1.244 Windows2000 Oracle 9.2.0.1 rman/rman
1、配置catalog恢复目录
create tablespace ts_rman datafile='d:oratestrman.dbf' size=100M;
create user rman identified by rman default tablespace ts_rman;
grant connect ,resource , RECOVERY_CATALOG_OWNER to rman;
连接到目标数据库和CATALOG数据库
rman target / catalogrman/rman@244
创建CATALOG用户的表,登记目标数据库
rman> create catalog
rman> register database
配置参数
rman> configure controlfile autobackup on;
rman> configure backup optimization on;
2、rman备份方案
每周日晚做一次零级备份,周一到周六做一次一级备份
************************************************************************
*** rman_bk_L0.sh ***
************************************************************************
#!/bin/sh
source /home/oracle/.bash_profile
cd $ORACLE_HOME/bin
./rman target / catalogrman/rman@244msglog=/home/oracle/work/log/rman_bk_L0_`date '+%Y%m%d%H%M%S'`.log <
run {
allocate channel c1 type disk;
backup incremental level 0 filesperset 5 tag 'dbL0' format '/mnt/raid/rman_bk/ora_o_%d_%t%s%p%u' database skip readonly;
sql 'alter system archive log current' ;
backup(archivelog all format '/mnt/raid/rman_bk/ora_a_%d_%t%s%p%u');
release channel c1;
}
list backup;
exit;
EOF
************************************************************************
*** rman_bk_L1.sh ***
************************************************************************
#!/bin/sh
source /home/oracle/.bash_profile
cd $ORACLE_HOME/bin
./rman target / catalogrman/rman@244msglog=/home/oracle/work/log/rman_bk_L1_`date '+%Y%m%d%H%M%S'`.log <
run {
allocate channel c1 type disk;
backup incremental level 1 filesperset 5 tag 'dbL1' format '/mnt/raid/rman_bk/ora_o_%d_%t%s%p%u' database skip readonly;
sql 'alter system archive log current' ;
backup(archivelog all format '/mnt/raid/rman_bk/ora_a_%d_%t%s%p%u');
release channel c1;
}
list backup;
exit;
EOF
然后使用crontab命令在linux上安排job如下:
00 02 * * 0 /home/oracle/work/bin/rman_bk_L0.sh
00 02 * * 1,2,3,4,5,6 /home/oracle/work/bin/rman_bk_L1.sh
注意:每周一要将冗余的备份手工清除掉
rman> report obsolete;
rman> delete obsolete;
原文地址http://msplinks.com.cn/MDFodHRwOi8vaGkuYmFpZHUuY29tL2hvY2tiYXNlL2Jsb2cvaXRlbS9mYWE3ODFiMTI1ZmY0MjU1MDgyMzAyMDIuaHRtbA==
- Linux环境下rman备份的实例脚本
- linux下进行oracle数据库的rman备份脚本
- linux 下RMAN备份shell脚本
- linux rman备份脚本
- linux系统rman的自动备份脚本
- RAC模式下的备份策略以及RMAN备份脚本
- Windows下RMAN备份脚本
- Windows下RMAN备份脚本
- Windows下RMAN备份脚本
- Windows下RMAN备份脚本
- Windows下RMAN备份脚本
- Windows 下RMAN备份脚本
- Windows下RMAN备份脚本
- linux rman 自动备份脚本
- Linux 下 Oracle备份脚本(RMAN/EXP)
- Nocatalog 下的RMAN 增量备份 shell脚本
- Nocatalog 下的RMAN 增量备份 shell脚本
- Nocatalog 下的RMAN 增量备份 shell脚本
- Sicily 1794. Missiles
- 自己实现的一个中缀表达式计算
- fancy
- 英语四级
- 重要文章【为列表页缓存而生:TCSQL实时列表缓存数据库帮助文档】
- Linux环境下rman备份的实例脚本
- ORACLE 10G rman 备份脚本
- FCKeditor在ASP设置环境中的使用
- 创建RMAN CATALOG
- 在ubuntu中安装五笔输入法
- 二级联动
- Fckeditor编辑器出现乱码的解决方法
- 物竞天择,适者生存
- Top 100 (sorted by "scattergory")