批处理备份Oracle
@echo off
@title Oracle简易数据备份工具
:startBackupData
cls
echo.
echo Oracle简易数据备份工具
echo.
set nowDate=%date:~0,4%%date:~5,2%%date:~8,2%
set /p oraHost=请输入Oracle服务器地址(留空默认为192.168.0.2):
if "%oraHost%" == "" set oraHost=192.168.0.2
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
set /p oraProt=请输入Oracle服务器端口(留空默认为1522):
if "%oraProt%" == "" set oraProt=1522
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
set /p oraServer=请输入Oracle服务实例名称(留空默认为orcl):
if "%oraServer%" == "" set oraServer=orcl
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
:setUsername
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
set /p oraUsername=请输入Oracle用户名:
if "%oraUsername%" == "" goto :setUsername
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
:setPassword
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
set /p oraPassword=请输入Oracle密码:
if "%oraPassword%" == "" goto :setPassword
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
echo Oracl密码:%oraPassword%
set /p expFilePath=请输入导出数据存放位置(留空默认为路径为C:\%oraUsername%_%nowDate%.dmp):
if "%expFilePath%" == "" set expFilePath=C:\%oraUsername%_%nowDate%.dmp
:setConfirmBackup
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
echo Oracl密码:%oraPassword%
echo 存放位置:%expFilePath%
echo.
set /p oraBackConfim=请确实要备份的数据库信息,输入y进行备份,输入n重新备份:
if "%oraBackConfim%" == "y" goto :setBackupData
if "%oraBackConfim%" == "n" (goto :startBackupData) else (goto :setConfirmBackup)
exit
:setBackupData
echo.
echo 开始备份数据库...
exp %oraUsername%/%oraPassword%@%oraHost%:%oraProt%/%oraServer% full=n buffer=65535 feedback=10000 file=%expFilePath%
pause>nul
@title Oracle简易数据备份工具
:startBackupData
cls
echo.
echo Oracle简易数据备份工具
echo.
set nowDate=%date:~0,4%%date:~5,2%%date:~8,2%
set /p oraHost=请输入Oracle服务器地址(留空默认为192.168.0.2):
if "%oraHost%" == "" set oraHost=192.168.0.2
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
set /p oraProt=请输入Oracle服务器端口(留空默认为1522):
if "%oraProt%" == "" set oraProt=1522
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
set /p oraServer=请输入Oracle服务实例名称(留空默认为orcl):
if "%oraServer%" == "" set oraServer=orcl
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
:setUsername
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
set /p oraUsername=请输入Oracle用户名:
if "%oraUsername%" == "" goto :setUsername
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
:setPassword
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
set /p oraPassword=请输入Oracle密码:
if "%oraPassword%" == "" goto :setPassword
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
echo Oracl密码:%oraPassword%
set /p expFilePath=请输入导出数据存放位置(留空默认为路径为C:\%oraUsername%_%nowDate%.dmp):
if "%expFilePath%" == "" set expFilePath=C:\%oraUsername%_%nowDate%.dmp
:setConfirmBackup
cls
echo.
echo Oracle简易数据备份工具
echo.
echo 当前备份信息:
echo.
echo Oracle服务器地址:%oraHost%
echo Oracle服务器端口:%oraProt%
echo Oracle服务实例名称:%oraServer%
echo Oracle用户名:%oraUsername%
echo Oracl密码:%oraPassword%
echo 存放位置:%expFilePath%
echo.
set /p oraBackConfim=请确实要备份的数据库信息,输入y进行备份,输入n重新备份:
if "%oraBackConfim%" == "y" goto :setBackupData
if "%oraBackConfim%" == "n" (goto :startBackupData) else (goto :setConfirmBackup)
exit
:setBackupData
echo.
echo 开始备份数据库...
exp %oraUsername%/%oraPassword%@%oraHost%:%oraProt%/%oraServer% full=n buffer=65535 feedback=10000 file=%expFilePath%
pause>nul
相关推荐
lklong 2020-11-22
oraclemch 2020-11-06
shilukun 2020-10-10
周嘉笙 2020-11-09
iilegend 2020-10-19
EricRay 2020-10-16
zhuzhufxz 2020-09-16
dataminer 2020-08-17
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
数据库设计 2020-08-16
Seandba 2020-08-16
Omega 2020-08-16
zjyzz 2020-08-16
yanghuatong 2020-08-16
ktyl000 2020-08-16
dbasunny 2020-08-16