Oracle 11g windows expdp备份脚本
SQL语句:创建备份目录
CREATE OR REPLACE DIRECTORY backup AS 'e:\tank';
GRANT READ, WRITE ON DIRECTORY backup TO tank;
以下为windows 批处理脚本。
//说明: 备份tank用户下的指为schemas为tank的那所有备,并发通道为4个,保留备份30天。
@echo off
rem set backupfile=f_database_%date:~0,4%-%date:~5,2%-%date:~8,2%.dmp
rem set logfile=f_database_%date:~0,4%-%date:~5,2%-%date:~8,2%.log
rem delete 30days files
forfiles /p "e:\tank" /d -30 /c "cmd /c echo deleting @file ... && del /f @path"
cd e:\tank
rem backup schemas
set backupfile=tank_%date:~0,4%-%date:~5,2%-%date:~8,2%.dmp
set logfile=tank_%date:~0,4%-%date:~5,2%-%date:~8,2%.log
"D:\app\Administrator\product\11.2.0\dbhome_1\BIN\expdp.exe" tank/tank directory=backup dumpfile=%backupfile% logfile=%logfile% schemas=tank parallel=4
阅读(2707) | 评论(0) | 转发(0) |