Oracle 12c RMAN備份文檔

來源:互聯網
上載者:User

標籤:

建立備份目錄,查看剩餘空間

[[email protected] ~]$ df -hdf: ‘/home/oratest/.gvfs’: Permission deniedFilesystem               Size  Used Avail Use% Mounted on/dev/mapper/centos-root  450G   27G  423G   6% /devtmpfs                 5.8G     0  5.8G   0% /devtmpfs                    5.8G  2.9G  3.0G  50% /dev/shmtmpfs                    5.8G   34M  5.8G   1% /runtmpfs                    5.8G     0  5.8G   0% /sys/fs/cgroup/dev/sda1                497M  128M  370M  26% /boot

建立目錄,並且更改許可權為資料庫使用者

sudo mkdir -p /rman_backup/bak_data  /rman_backup/scripts
[[email protected] ~]$ sudo chgrp -R dba /rman_backup/
[[email protected] ~]$ sudo chown -R oracle /rman_backup/

rman參數配置

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS ;

全備指令碼 BackupFull.sh

# script .:BackupFull.sh# creater:wangshengzhuang# date:2016/01/05# desc: backup full database datafile in archive with rman# connect databaseexport ORACLE_BASE=/home/oratest/app/oratestexport ORACLE_HOME=/home/oratest/app/oratest/product/12.1.0/dbhome_1export ORACLE_SID=CISTESTexport PATH=$ORACLE_HOME/bin:$PATHrman target/ << EOFRun{       Allocate channel c1 type disk;       Backup incremental level 0 tag ‘db0‘    format  ‘/rman_backup/bak_data/db0_%d_%T_%s‘ database         include current controlfile              plus archivelog filesperset 20         format  ‘/rman_backup/bak_data/arc0_%d_%T_%s‘  ;       Delete noprompt obsolete;       Release channel c1;}EOF#

增量備份BackupIncr1.sh

# script .:BackupFull.sh# creater:wangshengzhuang# date:2016/01/05# desc: backup incremental database datafile in archive with rman# connect databaseexport ORACLE_BASE=/home/oratest/app/oratestexport ORACLE_HOME=/home/oratest/app/oratest/product/12.1.0/dbhome_1export ORACLE_SID=CISTESTexport PATH=$ORACLE_HOME/bin:$PATHrman target/ << EOFRun{       Allocate channel c1 type disk;       Backup incremental level 1 tag ‘db1‘    format  ‘/rman_backup/bak_data/db1_%d_%T_%s‘ database         include current controlfile              plus archivelog filesperset 20         format  ‘/rman_backup/bak_data/arc1_%d_%T_%s‘  ;       Delete noprompt obsolete;       Release channel c1;}EOF#

配置定時調度

周日和周三淩晨1:00執行0級全庫備份,周一、二、四、五六淩晨1:00執行1級增量備份

[[email protected] scripts]$ crontab -e0 1 * * 0 /rman_backup/scripts/BackupFull.sh  >>/rman_backup/BackupFull.log0 1 * * 3 /rman_backup/scripts/BackupFull.sh  >>/rman_backup/BackupFull.log0 1 * * 1-2 /rman_backup/scripts/BackupIncr1.sh  >>/rman_backup/BackupIncr.log0 1 * * 4-6 /rman_backup/scripts/BackupIncr1.sh  >>/rman_backup/BackupIncr.log

reload調度

[[email protected] cistest]$ sudo /sbin/service crond reloadRedirecting to /bin/systemctl reload  crond.service

Oracle 12c RMAN備份文檔

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.