Oracle automatically backs up DMP files

Source: Internet
Author: User

Oracle Database automatic Backup implementation effect
    1. Export DMP format files using the Oracle EXP command;
    2. Automatically compress DMP files using 7z command line to reduce storage space;
    3. Use Windows timed tasks to automatically back up, and periodically delete backups up to n days;
Backup Bat Command
@echo offrem ********************** configuration start **********************rem connect Oracle IP Port database name set SID=127.0.0.1:1521/orclrem User Name set username connected to Oracle=orclrem connecting Oracle's password set password=123the REM backup file folder for example (D:\bak) set Bak_path=D:\bakrem 7za.exe Compressed file path set Rar_path=D:\bak\7za.exerem ********************** configuration end **********************set Connect=%username%/%password%@%sid%echo Delete 7 days ago the spare files and log 7z files forfiles/p%bak_path%/M *.dmp/d-7/c "cmd/c del @path"forfiles/p%bak_path%/M *.log/d-7/c "cmd/c del @path"forfiles/p%bak_path%/M *.7z/d-7/c "cmd/c del @path"Echo start back up REM If the backup folder does not exist, create an if not exist"%bak_path%" mkdir "%bak_path%"Set filename=oraclebak%date:~0,4%%date:~5,2%%date:~8,2%set filepath=%BAK_PATH%\%FILENAME%REM execute EXP EXPORT command exp%connect% file=%filepath%.dmp owner=%username% log=%filepath%.log indexes=y grants=y constraints=y compress=Yrem If there is 7za.exe then perform compression, there is no direct exit if exist%rar_path% (%rar_path% a%filepath%.7z%filepath%.dmp%filepath%.logrem Delete dmp files after compression if errorlevel0(del%filepath%.dmpdel%filepath%.log)) Else (Echo compressed file does not exist, DMP does not compress exit) exit

Save the above text as a bat file, and the new Windows scheduled task executes the Bat command periodically for scheduled backups.

Oracle automatically backs up DMP files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.