How to use Windows Automated tasks for Oracle data backup and cleanup

Source: Internet
Author: User

Many times, we need to perform Oracle backup through the client, where we use automated tasks from Windows to automate Oracle backup and backup cleanup

The use of automatic tasks is slightly

1. Create an automatic backup script

@echo off @echo ================================================

Automated backup scripts for Oracle databases @echo Windows environment

@echo Description: When you start a backup, you need to configure the following variables

@echo 1, Backup_dir specify which directory to back up to

@echo 2, Oracle_username specify the ORACLE user name to use for the backup

@echo 3, Oracle_password specifies the ORACLE password used for the backup

@echo 4, oracle_db specifies the ORACLE connection name used for the backup

@echo 5, back_option backup option, can be empty, can be full=y, can be owner=a user, B user and so on .... @echo 6, Rar_cmd specifies the RAR command line compression tool In the Catalog

@echo ================================================

REM The following variables need to be configured according to the actual situation

Set Backup_dir=f:\database_bak\

Set Oracle_username=name

Set Oracle_password=pwd

Set Oracle_db=dbname

Set Back_option=full=y

Set rar_cmd= "C:progra~1winrarrar.exe"

for/f "tokens=1,2"%%a in (' date/t ') do set today=%%a set back_name=%oracle_db%_%today% (%time:~0,2% time%time:~3,2% min) _ Set BA Ck_full_name=%backup_dir%%back_name%

REM Start back up exp%oracle_username%/%oracle_password%@%oracle_db%%back_option% file= "%back_full_name%.dmp" log= "%BACK_" Full_name%exp.log "

2. Create a Delete script

RD/S/q F:\database_BAK
MD F:\database_BAK

3. Finally, we can set the time to clean up the backup by automatic task, so that the disk is not full.

How to use Windows Automated tasks for Oracle data backup and cleanup

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.