代码拉取完成,页面将自动刷新
@echo off
set date=%date:~4%
if %date:~0,1%==2 (
rem echo win2000
goto OK
)
rem echo winXP
set date=%date:~4,-3%
: OK
set ORACLE_HOME1=%ORACLE_HOME%
set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
set path1=%PATH%
set TNS_ADMIN1=%TNS_ADMIN%
IF NOT "%2"=="NULL" SET ORACLE_HOME=%2
set path2=%ORACLE_HOME%
IF NOT exist %path2%\oci.dll (
GOTO NoOCI
rem IF exist %path2%\oci.dll
) else (
IF exist %path2%\exp.exe GOTO Okpath
IF exist %path2%\exp80.exe GOTO Okpath
)
:NoOCI
IF exist %path2%\bin\oci.dll (
set path2=%path2%\bin
GOTO Okpath
)
:Okpath
set PATH=%path2%\;%PATH1%
set expproc=exp.exe
rem IF exist %path2%\expdp.exe set expproc=expdp.exe
IF exist %path2%\%expproc% (
set expproc=%path2%\%expproc%
GOTO Okexp
)
IF exist %path2%\exp80.exe (
set expproc=%path2%\exp80.exe
GOTO Okexp
)
:Okexp
rem echo %ORACLE_HOME% %path2% %expproc%
rem pause
set TNS_ADMIN1=%TNS_ADMIN%
set TNS_ADMIN=%ORACLE_HOME%
IF NOT "%ORACLE_HOME%"=="%path2%" (
SET TNS_ADMIN=%ORACLE_HOME%\network\ADMIN
) else (
IF exist %ORACLE_HOME%\tnsnames.ora (
set TNS_ADMIN=%ORACLE_HOME%
) else (
IF exist %ORACLE_HOME%\network\ADMIN ( SET TNS_ADMIN=%ORACLE_HOME%\network\ADMIN )
)
)
rem echo %ORACLE_HOME% %path2% %expproc% %TNS_ADMIN%
rem pause
set username=erpsys
rem set expproc=d:\oracle\ora90\bin\exp
set server=erpsys@erp
set arcdir=e:\databak
set rardir=c:\progra~1\winrar\
set parfile=NULL
set istemp=
set zippass=
IF NOT "%1"=="" SET username=%1
rem IF NOT "%2"=="" SET expproc=%2
IF NOT "%3"=="" SET server=%3
IF NOT "%4"=="" SET arcdir=%4
rem IF NOT "%5"==""
SET rardir=%5
IF NOT "%6"=="NULL" SET date=%6
rem IF NOT "%7"=="NULL"
SET parfile=%7
SET istemp=%8
IF "%9"=="NULL" GOTO nozippass
IF "%9"=="" GOTO nozippass
SET zippass=-hp%9
:nozippass
REM IF not exist ..\par\default.par set parfile=default
set filename=%username%_%date%
if not "%parfile%"=="NULL" (
set filename=%username%_%date%_%parfile%
goto par
)
REM IF not exist ..\par\default.par set parfile=default
IF exist .\par\default.par set parfile=default
:par
if "%istemp%"=="temp" set parfile=temp
IF not exist %username% md %username%
cd %username%
IF not exist log md log
REM IF not exist par md par
IF not exist %arcdir%\%username% md %arcdir%\%username%
:start
rem echo %expproc% %username%/%server% parfile=..\par\%parfile%.par file=%filename%.dmp log=.\log\EXP_%filename%.log
rem pause
rem start /MIN /WAIT %expproc% %username%/%server% FULL=Y file=%username%_%dd%.dmp log=.\log\EXP_%username%_%dd%.log
if "%parfile%"=="" (
start /MIN /WAIT %expproc% %username%/%server% FULL=Y file=%filename%.dmp log=.\log\EXP_%filename%.log
goto zip
)
start /MIN /WAIT %expproc% %username%/%server% parfile=..\par\%parfile%.par file=%filename%.dmp log=.\log\EXP_%filename%.log
rem echo %expproc% %username%/%server% %expproc% %username%/%server%
rem pause
:zip
if not "%rardir%"=="NULL" (
IF exist %filename%.dmp start /MIN /WAIT %rardir%winrar a -idp -ao %zippass% %arcdir%\%username%\%filename%.rar %filename%.dmp
IF exist .\log\EXP_%filename%.log start /MIN /WAIT %rardir%winrar m -idp -ao %arcdir%\%username%\%username%_log.rar .\log\EXP_%filename%.log
)
cd ..
if %ERRORLEVEL%==0 (
if exist deloldfile.exe (
REM deloldfile %8 %date% %rardir% %filename% %arcdir% %username% %9
rem deloldfile %date% %parfile% %8
rem 2019-11-05 导出也由 deloldfile 执行 deloldfile %date% %7 %8
goto end
)
echo not deloldfile.exe
goto end
)
echo %ERRORLEVEL%
rem goto end
:end
set username=
set expproc=
set server=
set arcdir=
set rardir=
set parfile=
set date=
set filename=
set istemp=
set zippass=
set PATH=%PATH1%
set ORACLE_HOME=%ORACLE_HOME1%
set PATH1=
set path2=
set ORACLE_HOME1=
set TNS_ADMIN=%TNS_ADMIN1%
set TNS_ADMIN1=
rem 2019-11-05 增加 exit,以便调用后等待退出
@echo on
exit
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。