Oracle Database backup:
--Keep the backup record of the most recent week;
= = = Text:
= = Start ==============
Echo Set backup file Folder ...
Set "Tbuf=e:cwaybackup"
echo Sets the backup file name (named after the day of the week, that is, the backup file only saves the last week) ...
Set name=%date%
Set name=%name:~-3%
Set name=orcl_backup_%name%
Echo whether there is a file with the same name, delete file if present ...
If exist%tbuf%%name%.dmp del%tbuf%%name%.dmp
If exist%tbuf%%name%.log del%tbuf%%name%.log
Echo starts backing up the XX project Oracle database .....
Exp USER1/PASSWORD1@ORCL file=%tbuf%%name%.dmp log= '%tbuf%%name%.log '
echo Backup completed!
= = End =======
= = will "Start", "end" between the contents of the copy to TXT file, modify the corresponding parameters such as: path, database name, etc.;
Save as Bat format, create a task schedule, and set up a daily run to implement a database backup.
Note:
(1) User: The username to back up the data;
(2) PassWord: password;
(3) ORCL: Database name;