簡單備份數(shù)據(jù)庫的腳本
set date=%DATE:~0,10%md D:\sam\BACKUP\%date%
exp app/app@orcl_182 owner=app file=D:\sam\BACKUP\%date%\app.dmp
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\blog.rar e:\sam\webapps\blog
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\bbs.rar e:\sam\webapps\lxbbs
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\app.rar D:\webapps\app
-------------------------------------------------------------------
備注:備份Oracle數(shù)據(jù)庫
@echo off
Rem remove files 3 days before ...
echo wscript.echo dateadd("d",-3,date) > %tmp%\tmp.vbs
for /f "tokens=1,2,3* delims=-" %%i in ('cscript /nologo %tmp%\tmp.vbs') do (
set y=%%i
set m=%%j
set d=%%k
)
if %m% LSS 10 set m=0%m%
if %d% LSS 10 set d=0%d%
set before3days=%y%-%m%-%d%
del /Q /F D:\BACKUP\backfiles\USERMYGPS_%before3days%.dmp
Rem backup files.....
set date=%DATE:~0,10%
rem exp system/shmsa@orcl owner=USERMYGPS file=D:\BACKUP\backfiles\USERMYGPS_%date%.dmp
------------------
備份sql server2000
@echo off
Rem remove files 3 days before ...
echo wscript.echo dateadd("d",-3,date) > %tmp%\tmp.vbs
for /f "tokens=1,2,3* delims=-" %%i in ('cscript /nologo %tmp%\tmp.vbs') do (
set y=%%i
set m=%%j
set d=%%k
)
if %m% LSS 10 set m=0%m%
if %d% LSS 10 set d=0%d%
set before3days=%y%-%m%-%d%
del /Q /F d:\backup\backfiles\EquipManage_%before3days%.dmp
Rem backup files
isql -U sa -P shmsa -S SHMSA-SQL20001 -i local.sql









posted on 2008-07-14 00:14 MingIsMe 閱讀(173) 評(píng)論(0) 編輯 收藏 所屬分類: 10 Database