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.