LINUX crontab scheduled call Shell backup database

Source: Internet
Author: User
Tags call shell connect backup linux

1, the system: the use of Linux crontab scheduled call Shell, the implementation of 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. Related scripts

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 03-09 09:37 CONNECT.RCV

-RWXRWXRWX 1 Oracle oinstall 03-08 16:17 INC0.RCV

-RWXRWXRWX 1 Oracle Oinstall 165 03-08 16:17 inc0.sh

-RWXRWXRWX 1 Oracle oinstall 03-08 16:17 INC1.RCV

-RWXRWXRWX 1 Oracle Oinstall 163 03-08 16:17 inc1.sh

-RWXRWXRWX 1 Oracle oinstall 03-08 16:17 INC2.RCV

-RWXRWXRWX 1 Oracle Oinstall 164 03-08 16:17 inc2.sh

3, inc0.sh content

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 content

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

run{

Execute global script global_inc0;

}

Exit

5, to see what GLOBAL_INC0 is

-----is a script registered in 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;

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.