Oracle Database automatic backup compression bat

Source: Internet
Author: User

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

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.