Home > Database > Mysql Tutorial > body text

RHEL5下RMAN的自动备份

WBOY
Release: 2016-06-07 17:36:02
Original
793 people have browsed it

RHEL5下RMAN的自动备份脚本,编写脚本放在服务器端定时执行: 要求 (1)数据库全备,同时备份控制文件和归档日志文件,在完成归

RHEL5下RMAN的自动备份脚本,编写脚本放在服务器端定时执行:

要求

(1)数据库全备,同时备份控制文件和归档日志文件,在完成归档日志文件备份后,,自动删除已备份的归档日志

(2)备份保留14天,过期自动删除

(3)保留rman操作日志

 

编写RMAN批处理文件:

#!/bin/bash
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 14;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to

'/u01/scripts/controlfile_%F';
allocate channel c1 device type disk format '/u01/scripts/db_bak_%U';
backup database skip inaccessible
plus archivelog filesperset 20
delete all input;
release channel c1;
}
allocate channel for maintenance device type disk;
crosscheck backupset;
delete noprompt obsolete;

编写命令执行批处理:


#!/bin/bash
Oracle_HOME=/u01/app/oracle/10.2.0/db_1
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=orcl
$ORACLE_HOME/bin/rman target / cmdfile='/u01/scripts/orcl_bak.rman'

 

RHEL5下RMAN的自动备份

RHEL5下RMAN的自动备份

 

推荐阅读:

RMAN 配置归档日志删除策略

Oracle基础教程之通过RMAN复制数据库

RMAN备份策略制定参考内容

RMAN备份学习笔记

Oracle数据库备份加密 RMAN加密

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template