时间:2021-05-02
一、增量备份脚本
0级备份脚本:红色部分为自定义的备份文件放置的目录
复制代码 代码如下:
#script.:BackupFull.sh
#creater:xyh
#date:2014-03-08
#desc:backup full database datafile in archive with rman
#connect database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rman target/ << EOF_RMAN
run{
allocate channel c1 type disk;
backup incremental level 0 tag 'db0' format
'/home/oracle/RmanBackup/db0_%d_%T_%s' database include current controlfile;
sql 'alter system archive log current';
backup filesperset 5 format '/home/oracle/RmanBackup/cf0_%d_%T_%s' archivelog all delete input;
#filesperset 5表示备份集里面最多包含5个文件
delete noprompt obsolete;
release channel c1;
}
# end
1级备份脚本
复制代码 代码如下:
#script.:Incrl.sh
#creater:xyh
#date:2014-03-08
#desc:backup full database datafile in archive with rman
#connect database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rman target/ << EOF_RMAN
run{
allocate channel c1 type disk;
backup incremental level 1 tag 'db1' format
'/home/oracle/RmanBackup/db1_%d_%T_%s' database include current controlfile;
sql 'alter system archive log current';
backup filesperset 5 format '/home/oracle/RmanBackup/cf1_%d_%T_%s' archivelog all delete input;
#filesperset 5表示备份集里面最多包含5个文件
delete noprompt obsolete;
release channel c1;
}
#end
复制代码 代码如下:
crontab -e
复制代码 代码如下:
0 1 * * 0 /home/oracle/BackupFull.sh >>/home/oracle/BackupFull.log
0 1 * * 3 /home/oracle/BackupFull.sh >>/home/oracle/BackupFull.log
30 1 * * 1-2 /home/oracle/Incrl.sh >>/home/oracle/Incr.log
30 1 * * 4-6 /home/oracle/Incrl.sh >>/home/oracle/Incr.log
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
一.windows平台1.rman自动备份方法#Author:Edward.Zhou--#Purpose:Windows平台下采用PowerShell使用rma
1.登陆到服务器上创建rman自动删除两天前的归档日志脚本[oracle@108~]$cat>>del_ora_log.rman/home/oracle/rma
简介类似oracle的rman,用于postgres的备份与恢复下载https://github.com/ossc-db/pg_rman/tree/V1.3.9
适用于前后台分离的服务一个jar包一个前台工程实现自动杀端口,复制文件,备份数据,发布新版本。脚本复制到Linux中【./jb.sh】按Enter运行即可内容如
对于自动化运维,诸如备份恢复之类的,DBA经常需要将SQL语句封装到shell脚本。本文描述了在Linux环境下mysql数据库中,shell脚本下调用sql语