欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Windows系統(tǒng)下Oracle數(shù)據(jù)庫每天自動備份

 更新時間:2016年12月01日 09:30:02   作者:lodestar  
linux和unix下面使用shell可以很方便實(shí)現(xiàn),如果windows環(huán)境下可以結(jié)合計劃任務(wù)實(shí)現(xiàn)自動備份,下面通過本文給大家介紹實(shí)現(xiàn)方法,需要的朋友參考下吧

linux和unix下面使用shell可以很方便實(shí)現(xiàn),如果windows環(huán)境下可以結(jié)合計劃任務(wù)實(shí)現(xiàn)

1.創(chuàng)建備份目錄d:\backup, 創(chuàng)建批處理命令Bak.bat,編寫備份腳本

exp user/passwd@orcl DIRECT=Y BUFFER=100000 FILE=D:\backup\scdd%date:~0,10% OWNER=('scdd') LOG=D:\backup\data.log 
forfiles /p "D:\backup" /s /m *.dmp /d -3 /c "cmd /c del @path"

說明:

exp命令是oracle提供的dump備份命令,其中的%date:~0,10%是DOS里取日期的命令,例如:C:\Users\qyy>echo %date:~0,10%得到2016-11-30

forfiles是windows的文件查找命令,查找在backup,dmp后綴產(chǎn)生三天的文件,找到后執(zhí)行刪除操作

2.Windows定時任務(wù)每日自動執(zhí)行批處理文件 3.保留最近三天的文件,自動刪除以前日期的備份文件

forfiles參數(shù)說明:

/P 可是搜索的路徑。在我們這里就是要在哪個目錄尋找要刪除的文件

/M 根據(jù)搜索掩碼搜索文件。默認(rèn)為*,如果要找備份處dump文件,格式為*.dmp

/D 文件修改時間在某個時間之前或者之后。-3 表示3天之前的文件。

/s 包含子目錄

/C 表示為每個文件執(zhí)行的命令,如果要刪除該文件可以為"cmd /c del /F /s /q @file"。其中變量@file表示該文件名 f s q表示強(qiáng)制靜默刪除可以不用;cmd /c表示執(zhí)行字符串指定的命令然后終斷

其中@file可以返還如下結(jié)果,我們這里用@path

@file - returns the name of the file.

@fname - returns the file name without extension.

@ext - returns only the extension of the file.

@path - returns the full path of the file.

@relpath - returns the relative path of the file.

@isdir - returns "TRUE" if a file type is a directory, and "FALSE" for files. @fsize - returns the size of the file in bytes.

@fdate - returns the last modified date of the file.

@ftime - returns the last modified time of the file

以上所述是小編給大家介紹的Windows系統(tǒng)下Oracle數(shù)據(jù)庫每天自動備份,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論