Automatic Backup and FTP upload of Oracle files in Linux

Source: Internet
Author: User

How to implement automatic backup

Five. Sh files are provided in this directory.Script files, which have the following functions:

1. Export. Sh -- export all tables whose owner is zhaoilei in the database

2. hotbackup. Sh -- full database backup for the database

3. rm. Sh -- delete useless backup and export information

4. rmsh. Sh -- trigger the first three script files with time

5. FTP. Sh -- automatically upload to the Web server

 

 

There are two instructions on the above script:

1. You must create two directories, accountbk and expfile, under/home/Oracle, to store the full-database backup and export files respectively.

2. For Scheduled backup, enter crontab/path/rmsh. Sh in the command line.

 

In addition, you can modify these scripts based on your installation path, user name, password, and export needs.

If the backup file encoding format is incorrectModify

Export nls_lang = "simplified chinese_china.zhs16gbk"

Note: The code here must be/home/Oracle/. bash_profileInIn.

 

Notes for automatic backup:

1)Judge crond in the command lineStart?

A)/Sbin/service crond status

B)If it is not started, switch to rootEnter the following characters to start crond:
/Sbin/service crond start
Add this statement
/Etc/rc. d/rc. Local
Make crondAuto Start

C)Everything goes well, modify export. Sh, Hotbackup. Sh, Rm. Sh, ftp. ShSelect the execution permission.

D)Execute export. Sh in the command lineCheck whether the file can be stored in expfile.File generation. If possible, the configuration is complete. If not, modify the export. Sh according to the prompted information.File.

E)Enter crontab/home/Oracle/rmsh. ShPut the automatic backup file into the scheduled execution sequence

FTP considerations
1) how to obtain the system time extfile = 'date + "% m _ % d" 'in FTP "'
2) how to connect the string file = "fulltmp _" $ extfile "_ 23_00.dmp" in FTP"

The attachment is the compressed file/files/mintqzy/sh.rar of the script.

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.