Now let's introduce our project using the Exp tool to automatically back up Oracle every day.
With this tool we can also use the command line to export using PL/SQL developer.
We want to use the EXP command to export Oracle's data, first of all to ensure that our local computer installed Oracle database software, That is: the Exp.exe command to install the Oracle server together with our system, if our system does not have an Oracle server installed and copied from other places of this exp.exe, generally cannot be performed. Such as:
We enter exp in the cmd window, displaying the following information indicating that the EXP command can be used.
Script for. bat Batch: Name: Yujkdbpro.bat
@echo off echo Delete the spare files and logs from 10 days ago forfiles/p "D:\oracle-bak"/M *.dmp/d -10/c "cmd/c del @path" forfiles/p "D:\oracle-bak"/M *.log/d -10/c "cmd/c del @path" Echo is backing up the Oracle database, please wait a moment ... Exp Yujk/[email PROTECTED]:1521/YUJKDB file=d:\oracle-bak\yujkdbpro%date:~0,4%%date:~5,2%%date:~8,2%.dmp log=D:\ Oracle-bak\yujkdbpro%date:~0,4%%date:~5,2%%date:~8,2%.log OWNER=YUJK buffer=65535 The echo task is complete! |
The last generated backup file and log file is as follows:
Here we need to add this Yujkdbpro.bat batch script to the window's timed task, implementing the script every day to implement the backup. Can self-Baidu a bit.
Reference Links:
76064334
53635602/
52410516
Automatic daily backup of Oracle database