Automatic backup of Oracle database under Aix/linux

Source: Internet
Author: User
Tags call back

There was a colleague, back and forth operation of the development and production of the database, the results mistakenly deleted the production of the database, that mood I think it is not common people can understand, although Oracle can have a method to restore, but not thorough.

Therefore, in the work, whether it is development or maintenance, backup database is very necessary.

Simple and practical evening automatic backup Database small case

Step one, create a backup script, named orabak.sh

#路径名, specify the path to the backup filepath=/oracle/orabak# defines the backup database file name filename, based on the specified date format= `Date+%y%m%d_%h%m# switch to the specified path and create a folder CD $FILEPATHmkdir$FILENAMEchmod 775$FILENAME #oracle variable settings export USER=Oracle;export Oracle_sid=Orcl;export Oracle_home=/oracle/app/oracle/product/11.2.0/Dbhome_1;export PATH= $ORACLE _home/bin: $PATH; exp is used here #导出数据库 Expdpexp Scott can be used as needed/[email protected]file="$FILENAME". DMP log="$FILENAME". log Owner=scott rows=y# Packaging+pressurized CD.Tar-CF $FILENAME.Tar$FILENAMERM-RF $FILENAMEgzip$FILENAME.Tarexiteof

Step two, use timed script crontab to automatically call back up script

Linux/aix uses the CRONTAB-E command, and then the last line to add a modifier script, for example:

Ten  A SH  /oracle/orabak/orabak. SH

As for the specific use of crontab, you can refer to my other small knowledge point

About the use of crontab under Linux

Automatic backup of Oracle database under Aix/linux

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.