Home > Database > Mysql Tutorial > 【错误更正】oracle 备份: 每天备份,全备份,保留七天。

【错误更正】oracle 备份: 每天备份,全备份,保留七天。

WBOY
Release: 2016-06-07 15:06:53
Original
1385 people have browsed it

1. 保留七天 只保留七天的备份是这样设置的 RMAN connect target/ connected to target database: DBSID (DBID=3100778490) RMAN configure retention policy to recovery window of 7 days; 2. 备份脚本 vi /root/rmanbak.sh #! /bin/bash su - oracle ! rm

1. 保留七天

只保留七天的备份是这样设置的

RMAN> connect target/

 

connected to target database: DBSID (DBID=3100778490)

RMAN> configure retention policy to recovery window of 7 days; 

2. 备份脚本

vi /root/rmanbak.sh

#! /bin/bash

su - oracle

rman target /

backup AS COMPRESSED BACKUPSET   database

include current controlfile format '/orabak/db_%d_%T_%s'

plus archivelog format '/orabak/arch_%d_%T_%s' ;

#delete obsolete;(使用此脚本会提示输入yes or no,造成自动删除失败)

delete noprompt obsolete;

#(不提示输入yes or no)
exit; 

EOF

3. 每天凌晨2点备份

crontab设值为

00 2 * * * /root/rmanbak.sh

 



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