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