LINUX CRONTAB定時計劃調用SHELL備份資料庫

來源:互聯網
上載者:User

1、體系:採用LINUX CRONTAB定時計劃調用SHELL,執行RMAN

[oracle@DB]$ crontab -l

0 1 * * 0 /u01/bak/rman/script/inc0.sh

0 1 * * 1 /u01/bak/rman/script/inc2.sh

0 1 * * 2 /u01/bak/rman/script/inc2.sh

0 1 * * 3 /u01/bak/rman/script/inc2.sh

0 1 * * 4 /u01/bak/rman/script/inc1.sh

0 1 * * 5 /u01/bak/rman/script/inc2.sh

0 1 * * 6 /u01/bak/rman/script/inc2.sh

2、相關指令碼

drwxrwxrwx 2 oracle oinstall 4096 03-10 08:19 log

-rw------- 1 oracle oinstall 4458 03-09 17:37 nohup.out

-rwxrwxrwx 1 oracle oinstall   69 03-09 09:37 connect.rcv

-rwxrwxrwx 1 oracle oinstall   84 03-08 16:17 inc0.rcv

-rwxrwxrwx 1 oracle oinstall  165 03-08 16:17 inc0.sh

-rwxrwxrwx 1 oracle oinstall   84 03-08 16:17 inc1.rcv

-rwxrwxrwx 1 oracle oinstall  163 03-08 16:17 inc1.sh

-rwxrwxrwx 1 oracle oinstall   84 03-08 16:17 inc2.rcv

-rwxrwxrwx 1 oracle oinstall  164 03-08 16:17 inc2.sh

3、inc0.sh內容

export ORACLE_HOME=/home/oracle/product/10.2.0/db_1

nohup $ORACLE_HOME/bin/rman  cmdfile=/u01/bak/rman/script/inc0.rcv log=/u01/bak/rman/script/log/inc0.log append

4、inc0.rcv 內容

@@/u01/bak/rman/script/connect.rcv

run{

execute global script global_inc0;

}

exit;

5、看看global_inc0是什麼

-----是在RMAN中註冊的指令碼

replace global script global_inc0

comment ' A script for backup database using incremental level 0'

{

execute global script global_del_obso;

allocate channel ch1 device type disk;

set limit channel ch1 readrate=10240;

set limit channel ch1 kbytes=2048000;

backup as compressed backupset incremental level 0 database

format='/u01/bak/rman/inc0_%d_%U'

tag='Inc0';

release channel ch1;

execute global script global_arch;

execute global script global_bkctl;

}

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.