Automatically backs up the database to the bat notation in DMP format under window

Source: Internet
Author: User

Copy the following command into a TXT text document, then modify the corresponding parameters for the parameters you need, and after everything is done, save the file in the bat format.
So every time you need to back up the time only need to double-click the bat file, the other is not you, you just need to wait quietly ...
</pre><pre code_snippet_id= "494366" snippet_file_name= "blog_20141023_4_5799611" name= "code" class= "plain" >
The following command can be copied directly using the
@echo off echo start rem ########################################################### REM # Windows Server 2003 Oracle Database Auto-Provisioning Batch script REM ########################################################### REM takes the current system time, may vary depending on the operating system set Curdate=%date : ~0,4%%date:~5,2%%date:~8,2%set curmon=%date:~0,4%%date:~5,2%set Curtime=%time:~0,2%rem hours if less than 10, then 0 if "% in front of Curtime% "= =" 0 "set curtime=00if"%curtime% "= =" 1 "Set curtime=01if"%curtime% "= =" 2 "Set curtime=02if"%curtime% "= =" 3 "s ET curtime=03if "%curtime%" = = "4" Set curtime=04if "%curtime%" = = "5" Set curtime=05if "%curtime%" = = "6" Set Curtime=06if " %curtime% "= =" 7 "Set curtime=07if"%curtime% "= =" 8 "Set curtime=08if"%curtime% "= =" 9 "Set Curtime=09set curtime=%curtime% %time:~3,2%%time:~6,2%rem set the owner, username and password set owner=xxx (write your database service name here) set User=xxx (a user for the database you want to back up) set password= XXX (corresponding password) REM create backup directory with directory structure of oraclebak/yyyymmdd/if not exist "Oraclebak" mkdir oraclebakcd oraclebakif Not exist "%curmon%" mkdir%curmon%set filenAme=%curmon%/%user%_%curdate%_%curtime%. DMP set Explog=%curmon%/%user%_%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

Automatically backs up the database to the bat notation in DMP format under window

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.