Automatic backup of Oracle 11g database

Source: Internet
Author: User

Crontab timed task trigger with Linux. The implementation process is as follows:

First, sign in with an Oracle account

Second, add the xxxxx.sh script under the/home/oracle directory.

Content: Export oracle_sid=xxxxx

Export Oracle_base=/u1/app/oracle

Export oracle_home=/u1/app/oracle/product/11.2.0.3/db

Export path= $ORACLE _home/bin: $PATH

filename=$ (Date +%y%m%d)

Exp System/[email protected](SID) file=/var/dbbak/$filename. DMP owner=(SID User)

Third, add xxxxxx.sh file execution permissions

chmod u+x mesdbbackup1.sh

Iv. adding Linux schedules using the CRONTAB-E command

2 * * */HOME/ORACLE/XXXXXX.SH (Backup daily 2:30) test phase Setup

Crontab Format Description

We can add the command to execute with CRONTAB-E. The result of the command execution, either standard output or error output, is sent to the user in the form of a message.

The added command must be in the following format:

* * * * * */command path

The first five fields can take an integer value, specify when to start working, and the sixth field is a string, the command field, which includes the commands that the crontab dispatch executes. Each field is segmented with spaces and tabs.

The first 5 fields indicate:

Minutes: 0-59

Hours: 1-23

Date: 1-31

Month: 1-12

Week: 0-6 (0 = Sunday)

You can also use some special symbols:

*: Indicates any moment

,: Represents the Split

-: Represents a segment, as in the second end: 1-5, which means 1 to 5 points

/N: Indicates that each n unit executes once, as in the second paragraph, */1, which indicates that the command is executed every 1 hours. Can also be written as 1-23/1.

Some examples:

XX 8,12,16 * * */data/app/scripts/monitor/df.sh

2 * * */data/app/scripts/hotbackup/hot_database_backup.sh

Ten 8,12,16 * * */data/app/scripts/monitor/check_ind_unusable.sh

Ten 8,12,16 * * */data/app/scripts/monitor/check_maxfilesize.sh

Ten 8,12,16 * * */data/app/scripts/monitor/check_objectsize.sh

43 21 * * * 21:43 execution

15 05 * * * 05:15 execution

0 17 * * * 17:00 execution

0 17 * * 1 per Monday of 17:00 executions

0,10 17 * * 0,2,3 executed every Sunday, Tuesday, Wednesday of 17:00 and 17:10

0-10 17 1 * * Every month 1st from 17:00 to 7:10 each 1-minute execution

0 0 1,15 * 1 each month 1st and 15th and a day of 0:00 execution

42 4 1 * * Every month 1st 4:42 minutes execution

0 21 * 1-6 weeks one to Saturday 21:00 execution

0,10,20,30,40,50 * * * * * every 10 minutes

*/10 * * * * * every 10 minutes

* 1 * * * * Every 1 minutes from 1:0 to 1:59

0 1 * * * 1:00 execution

0 */1 * * * 0 minutes every 1 hours

0 * * * * 0 minutes every 1 hours

2 8-20/3 * * * 8:02,11:02,14:02,17:02,20:02 execution

30 5 1,15 * * 1st and 15th of 5:30 execution

Backup results:

Automatic Backup is set to 2:30 every day. It can be seen that the system was automatically backed up in the morning of 17th, after the 10-16 PM was implemented.

Automatically back up log logs

Automatically back up Oracle 11g databases

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.