The bat script is as follows:
Set yr = % date :~ 0, 4%
Set mo = % date :~ 5, 2%
Set dy = % date :~ 8, 2%
Set dmpName = % yr % mo % dy %
Exp username/password @ dbname file = d: \ % dmpName %. dmp owner = username log = d: \ log _ % dmpName %. log
The execution process is to obtain the year, month, and date, and concatenate a string to name the backup file. Then, call the Oracle export tool exp to back up data by specifying the user name, password, database name, backup file name, and log name.
After the script is edited, you need to add a scheduled task to ensure that the script is periodically executed. Open attachment-System Tools-Task Scheduler creation.
Note: Many online scripts apply to % date :~ Incorrect Use of X, Y %. The meaning of the first parameter X should be the starting position of the string without objection. The second parameter Y should be the truncation length, not the cutoff position.
For example, in the doscommand line date command, print "2011/08/30 Tuesday". If you want to get 20110830, use % date: ~ In the bat script :~ 2011 for, % date :~ 5, 2%, get 08, and so on.
Author "why"