Automatic Oracle Database Backup (3)

Source: Internet
Author: User

4. Start the backup process

Cron is a permanent process started and executed by/etc/rc. local. Cron check/var/spool/cron/crontabs /? Lined up with ke Jia machinery Nai ?, Find the task to be executed and the time when the task is executed.

Each row of the Crontab file consists of six fields (minutes, hours, day of month, month, day of week, and command). The fields are separated by spaces or tabs:

Minutes: minute field. The value ranges from 0 to 59.

Hours: small time domain. The value ranges from 0 to 23.

Day of month: date. The value ranges from 1 to 31.

Month: month. The value ranges from 1 to 12.

Day of week: day of the week. The value ranges from 0 to 6. The value of Sunday is 0.

Command: the command to be run

If a domain is? Regular? Indicates that the command can be executed within all possible values of the domain.

If a field is two numbers separated by a hyphen, the command can include two numbers in the range between the two numbers ).

If a field is composed of a series of values separated by commas, the command can be executed within the range of these values.

If both the date and week fields have values, these two fields are valid.

Now, we write a file to start the automatic backup process. It is worth noting that the file can only be edited using the crontab-e command under the Oracle user name. Otherwise, it will not be scheduled and the file name is set to Oracle, the file will be stored in the/var/spool/cron/crontabs directory. After editing, you can run the crontab-l command at the $ prompt in Oracle.

Oracle file content:

0 23 ?? ?? ?? /Oracle/ora-backup

# Perform database backup at 23 o'clock every day

0 2 ?? ?? ?? /Oracle/tar-backup

# Back Up Files to tape at 2 o'clock every day

0 4 ?? ?? ?? Ftp-I host2

# Back Up Files to another host at 4 o'clock every day

After the above operations, the system will automatically generate a backup every night, and automatically copy the backup files to the tape and the other host. What the system administrator needs to do is to change a disk of tape every several days, depending on the size of the backup file and the size of the tape) and clean up the backup directory. In this way, they can free themselves from the hassle of backing up data and do other meaningful work. The database implements both tape backup and remote backup, which greatly improves the security.


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.