rman备份脚本shell版-创新互联
1、数据库全备到硬盘
创新互联建站专注于青山企业网站建设,响应式网站建设,商城建设。青山网站建设公司,为青山等地区提供建站服务。全流程定制网站建设,专业设计,全程项目跟踪,创新互联建站专业和态度为您提供的服务[oracle@centos7 scripts]$ cat rman_backup.sh source /home/oracle/.bash_profile rman target / log=/home/oracle/backup/backupall_rman.log<2、增量备份脚本
0级增量
[oracle@centos7 scripts]$ cat rman_backup_level0.sh source /home/oracle/.bash_profile rman target / log=/home/oracle/backup/backupall_rman.log<1级增量
[oracle@centos7 scripts]$ cat rman_backup_level1.sh source /home/oracle/.bash_profile rman target / log=/home/oracle/backup/backupall_rman.log<注意:1级备份需要在0级备份的基础上执行。
3、支持全备和增量备份
[oracle@centos7 scripts]$ cat db_back_rman.sh ##=========================================================== ## db_bak_rman.sh ## created by Robinson ## 2017/12/15 ## usage: db_bak_rman.sh <$ORACLE_SID> <$BACKUP_LEVEL> ## BACKUP_LEVEL: ## F: full backup ## 0: level 0 ## 1: level 1 ##============================================================ #!/bin/bash # User specific environment and startup programs if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi ORACLE_SID=${1}; export ORACLE_SID RMAN_LEVEL=${2}; export RMAN_LEVEL TIMESTAMP=`date +%Y%m%d%H%M`; export TIMESTAMP DATE=`date +%Y%m%d`; export DATE RMAN_DIR=/u02/database/${ORACLE_SID}/backup/rman; export RMAN_DIR RMAN_DATA=${RMAN_DIR}/${DATE}; export RMAN_DATA #RMAN_LOG=$RMAN_DATA/log; export RMAN_LOG RMAN_LOG=/u02/database/${ORACLE_SID}/backup/rman/log export RMAN_LOG # Check rman level #====================================================================== if [ "$RMAN_LEVEL" == "F" ]; then unset INCR_LVL BACKUP_TYPE=full else INCR_LVL="INCREMENTAL LEVEL ${RMAN_LEVEL}" BACKUP_TYPE=lev${RMAN_LEVEL} fi RMAN_FILE=${RMAN_DATA}/${ORACLE_SID}_${BACKUP_TYPE}_${TIMESTAMP}; export RMAN_FILE SSH_LOG=${RMAN_LOG}/${ORACLE_SID}_${BACKUP_TYPE}_${TIMESTAMP}.log; export SSH_LOG MAXPIECESIZE=4G; export MAXPIECESIZE #Check RMAN Backup Path #========================================================================= if ! test -d ${RMAN_DATA} then mkdir -p ${RMAN_DATA} fi echo "---------------------------------" >>${SSH_LOG} echo " " >>${SSH_LOG} echo "Rman Begin to Working ........." >>${SSH_LOG} echo "Begin time at:" `date` --`date +%Y%m%d%H%M` >>${SSH_LOG} #Startup rman to backup #============================================================================= $ORACLE_HOME/bin/rman log=${RMAN_FILE}.log <另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
文章标题:rman备份脚本shell版-创新互联
当前地址:http://ybzwz.com/article/dhiceg.html