Oracle Database automatic backup compression below bat is the bat script for automatic backup of oracle Database under window, which can be used to back up the. dmp file of the database and compress it. Set a scheduled task to be executed every morning on the server to automate backup and packaging every day. Automatic backup script for Oracle databases in rem windows. Rem can set this batch to automatically execute windows tasks. Www.2cto.com @ echo off @ echo ==================================== =================@ echo: when the backup is started, you need to configure the following variables @ echo 1 and BACKUP_DIR to specify which directory to back up @ echo 2 and ORACLE_USERNAME to specify the Oracle username @ echo 3 for backup and ORACLE_PASSWORD to specify the Oracle password @ echo 4 for backup. ORACLE_DB specifies the Oracle connection name @ echo 5 and BACK_OPTION backup options used for backup, can be blank, can be full = y, can be owner = a user, B user, etc .... @ echo 6. RAR_CMD specify the directory where the RAR command line compression tool is located @ echo ==================== ======================================== Www.2cto.com. configuration ------> note: this script must be placed in the BACKUP_DIR directory set BACKUP_DIR = E: \ apache-tomcat-6.0.35 \ webapps \ trace \ Download \ DBbaker set ORACLE_USERNAME = ysdb set ORACLE_PASSWORD = ysdb set ORACLE_DB = orcl10 set BACK_OPTION = set RAR_CMD = "C: \ Program Files \ WinRAR \ WinRAR.exe "for/f" tokens = 1, 2 "% a in ('date/t ') do set TODAY = % a set BACK_NAME = % ORACLE_DB % _ % TODAY % set BACK _ FULL_NAME = % BACKUP_DIR % \ % BACK_NAME % rem start backup exp % ORACLE_USERNAME %/% ORACLE_PASSWORD % @ % ORACLE_DB % BACK_OPTION % file = "% BACK_FULL_NAME %. dmp "rem log =" % BACK_FULL_NAME % exp. log "rem compresses and deletes the original file % RAR_CMD % a-df" %back_full_name1_back.rar "" % BACK_FULL_NAME %. dmp "rem" % BACK_FULL_NAME % exp. below log "www.2cto.com is the bat script used to obtain the database backup that has been backed up by the online server. You can set a scheduled task to automatically execute rem in windows every day, and download the online database backup file to a local script. Rem can set this batch to automatically execute windows tasks. Rem the following variables need to be configured according to the actual situation ------> Note: This script must be placed in the same directory as wget, the file will be downloaded to the current directory for/f "tokens = 1, 2" % a in ('date/t') do set TODAY = % a set back_name1_orcl10_1_today1_back.rar set url = http://211.112.121.19:8080/trace/Download/DBbaker/%BACK_NAME% Wget % url % back_oracle.rar http://up.2cto.com/2013/0201/20130201093636811.rargetbackup.rarhttp://up.2cto.com/2013/0201/20130201093644278.rarwget.rar http://up.2cto.com/2013/0201/20130201093651643.rar