Windows Scheduled tasks + batch files for scheduled backups of Oracle databases

Source: Internet
Author: User

1. Create a batch file

@echo off rem ########################################################### rem # Windows Server 2008 Oracle Database Automatic backup batch script REM ###########################################################Setcurdate=%date:~0,4%%date:~5,2%%date:~8,2%Sethour=%time:~,2%if "%time:~,1%"==" " SetHour=0%time:~1,1%Setcurtime=%hour%%time:~3,2%%time:~6,2%REM Setting the database name, user name, and passwordSetOwner=ORCLSetUser=FlzdSetpassword=Flzdrem Create a backup directory with a directory structure of Oraclebak/yyyymmdd/ifNot exist"Oraclebak"mkdir oraclebakcd OraclebakifNot exist"%curdate%"mkdir%curdate%SetFilename=%curdate%/%owner%_%curdate%%curtime%. DMPSetExplog=%curdate%/%owner%_%curdate%%curtime%_log.log REM calls Oracle's EXP command to export user data exp%user%/%password%@%owner% file=%filename% log=%explog% owner=%user% grants=N Exit

2. Create a Windows Scheduled task

2.1 Control Panel Administrative Tools Task Scheduler Create tasks

Note:

1 Create a new text file, copy and paste the contents, and modify the file name extension. bat

2 The number of hours in a batch file does not automatically fill 0 when there is only one digit

3 Windows Create Task Schedule add operation need to fill in the starting with this optional parameter (otherwise, may error when exporting) the path where the script executes

  

Windows Scheduled tasks + batch files for scheduled backups of Oracle databases

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.