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

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

WBOY
WBOYOriginal
2016-06-07 15:06:531380browse

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

 



Statement:
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