Oracle Database Backup:
-- Keep the backup record of the last week;
==== Body:
===== Start ======================
Copy codeThe Code is as follows:
Echo sets the backup file storage folder...
Set "tbuf = E: \ Cway \ backup"
Echo sets the backup file name (named in the day of the week, that is, the backup file is only saved for the last week )...
Set name = % date %
Set name = % name :~ -3%
Set name = ORCL_backup _ % name %
Whether a file with the same name exists in echo. If yes, delete the file with the same name...
If exist % tbuf % \ % name %. dmp del % tbuf % \ % name %. dmp
If exist % tbuf % \ % name %. log del % tbuf % \ % name %. log
Echo starts backing up the Oracle database of XX Project .....
Exp User1/PassWord1 @ Orcl file = % tbuf % \ % name %. dmp log = '% tbuf % \ % name %. Log'
Echo backup complete!
==== End ========
= Copy the content between "start" and "end" to the txt file and modify the corresponding parameters such as path and database name;
Save it as bat format, create a task plan, and set daily running to implement database backup.
Note:
(1) User: User Name for data backup;
(2) PassWord: PassWord;
(3) Orcl: Database Name;