正德厚生,臻于至善

oracle rman backup scripts

####################################################################full database
vi /backup/ebsbackup_db_level0.sh
backup_path="/backup"
#backup
mkdir -p $backup_path
chown -R oracle:oinstall $backup_path
su - oracle -c 'rman target / nocatalog msglog=/backup/rman_L0.`date +%Y%m%d%H%M%S`.log' <<EOF
run
    {
		#CONFIGURE DEVICE TYPE DISK PARALLELISM 16 BACKUP TYPE TO COMPRESSED BACKUPSET;
		backup as compressed backupset incremental level 0 format '$backup_path/BZPROD_DATA_level0_%Y%M%D$(date +%H%M%S)_%U' database;
		#sql "alter system archive log current";
		#sql "alter system archive log current";
		#sql "alter system archive log current";
		backup as compressed backupset archivelog all format '$backup_path/BZPROD_ARCH_%Y%M%D$(date +%H%M%S)_%U';
		backup current controlfile format '$backup_path/BZPROD_CONTROLFILE_level0_%Y%M%D$(date +%H%M%S)_%U';
   }
EOF
####################################################################archivelog
vi /backup/ebsbackup_db_arch.sh
backup_path="/backup"
#backup
mkdir -p $backup_path
chown -R oracle:oinstall $backup_path
su - oracle -c 'rman target / nocatalog msglog=/backup/rman_arch.`date +%Y%m%d%H%M%S`.log' <<EOF
run
    {
		#CONFIGURE DEVICE TYPE DISK PARALLELISM 16 BACKUP TYPE TO COMPRESSED BACKUPSET;
		#sql "alter system archive log current";
		#sql "alter system archive log current";
		#sql "alter system archive log current";
		backup as compressed backupset archivelog all format '$backup_path/BZPROD_ARCH_%Y%M%D$(date +%H%M%S)_%U';
		backup current controlfile format '$backup_path/BZPROD_CONTROLFILE_arch_%Y%M%D$(date +%H%M%S)_%U';
   }
EOF
####################################################################
chmod +x /backup/ebsbackup_db_level0.sh /backup/ebsbackup_db_arch.sh

nohup sh /backup/ebsbackup_db_level0.sh &
nohup sh /backup/ebsbackup_db_arch.sh &
赞(0) 打赏
未经允许不得转载:徐万新之路 » oracle rman backup scripts

评论 抢沙发

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫

微信扫一扫

登录

找回密码

注册