Copy the following command to a TXT text document, and then change the corresponding number of parameters to the required number of parameters, after all, save the file in the bat format.
This will only need to double-click the bat file every time you need to back up. None of the rest of 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 commands can be copied directly using the
@echo off Echo starts REM ########################################################### REM # Windows Server 2003 under Oracle database own master Backup Batch script REM ########################################################### REM takes the current system time, may be different depending on the operating system value 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 assuming 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 all, username, and password set owner=xxx (write your database service name here) set User=xxx (a corresponding user of the database you want to back up) set Password=xxx (corresponding PASSWORD) REM create a backup folder. Folder structure is 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
Take the initiative to back up the database into the DMP format of the Bat notation under window