#!/bin/bash
#As oracle user, chmod 744 /home/oracle/dbbackup/DBbackuprecover.sh
#crontab -e 35 1 * * * /home/oracle/dbbackup/rman.sh >/dev/null 2>&1
: modify local database's home directory
export ORACLE_HOME=/opt/oracle/10.2.0.1
export PATH=$ORACLE_HOME/bin:$PATH:
export NLS_LANG=AMERICAN_AMERICA.zhs16gbk
export LANG=AMERICAN_AMERICA.ZHS16GBK
export ORACLE_SID=ge01
rman target / <CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL=1 CUMULATIVE DATABASE SKIP INACCESSIBLE PLUS ARCHIVELOG DELETE ALL INPUT;
CROSSCHECK BACKUPSET;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
EXIT;
阅读(1561) | 评论(0) | 转发(0) |