Use Crontab in RedHat Linux to implement Oracle 10 Gb scheduled backup (including SFTP download instructions ).
This is to say that regular backup is a hot backup, that is, writing a shell script. The syntax is oracle10g, and 9i is slightly modified (using exp syntax)
After the scheduled backup, you can use the client machine to automatically download, use the sftp client, and set it to automatic download. If not, you can go to the Internet to find the implementation of sftp. java has open source.
1. Create a shell backup script file
#! /Bin/sh
# Oracle command
Expcmd = "/opt/ora10/product/10g/bin /"
# Bakup dir: the Backup directory needs to be created first with expdp, which is contained in 10 Gb. You can run the create directory command on your own.
Dbbakdir = "dbbakdir"
# Bakup file name
Filebak1 = "$ (date + % Y % m % d % H % M % S) dbbak1.dmp"
# Bakup db log
Dboplog = "db1.log"
# Table name is used to back up a table. For other statements, see the expdp syntax.
Tablenames = "xxxtablename"
./Expdp username/password @ dbname directory = $ dbbakdir dumpfile = $ filebak1 logfile = $ dboplog filesize = 4G tables = $ tablenames
Save it as/oralce/shelltest. sh and grant the execution permission chmod + x. You need to use oracle to install users such as useroracle and cannot use root users.
2. Add a crontab task
Use oracle to install a user, such as useroracle, to execute the following command
# Crontab-e
30 01 ***/oralce/shelltest. sh
The preceding settings are executed at half past one every morning. For the specific syntax, see the crontab format.
After setting, you can use the crontab-l command to view