Scheduled Oracle backup in CentOS6.4

Source: Internet
Author: User
In CentOS6.4 environment, the solution of backing up a user database at every night is implemented: using the scheduled task mechanism in linux, the command is crontab; using the exp tool to export the database

In the CentOS 6.4 environment, you can back up your database at every night. Solution: Use the scheduled task mechanism in linux and run the crontab command to export the database using the exp tool.

Objective: To back up a user database at every night in CentOS 6.4: Use the scheduled task mechanism in linux and run the crontab command to export the database using the exp tool; then, let crontab call exp regularly to implement automatic backup.

Steps:

1. log on with an oralce user --"

Compile the sh file -- oracle_backup.sh for backing up the Oracle database;

Content: su-oracle c "$ bin/exp $ username/$ password file = $ date_backup.dmp owner = $ user log = $ date_log"

Sh: rq = 'date + "% Y % m % d" 'of the dynamically spliced date "'

Create a folder for the above command

Mkdir backup_data; stores backup files

Mkdir back_log; stores logs.

After that, remember to grant the writable permission to the file: chmod 777 $ path/oracle_backup.sh

2. Use the root user to log on and execute the command --"

# Crontab-e

Content:

0 23 *** "$ path/oracle_back.sh" (minutes, days, months, and weeks)

This command generates a root file under/var/spool/cron with the input in the previous line.

3. check whether it is successful

Crontab-l allows you to view periodic tasks of the current user.

Crontab-r removes periodic tasks of the current user

Related reading:

Scheduled Oracle backup in Ubuntu 11.04

Implementation of regular Oracle Database Backup in Ubuntu

,

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.