
求助批處理登錄Oracle失敗后如何執(zhí)行后續(xù)命令RT,以下是部分代碼:
目的是登錄Oracle數(shù)據(jù)庫(kù)后獲取某個(gè)文件。問(wèn)題:當(dāng)實(shí)例或者密碼輸入錯(cuò)誤后,腳本會(huì)卡在登錄那個(gè)階段,errorlevel也沒(méi)有返回值,此時(shí)該怎樣跳過(guò)這條命令繼續(xù)執(zhí)行?nclick="copycode($('code0'));">復(fù)制代碼
- :create1
- set /p ORA_SID=Please enter the ORACLE_SID:
- @echo.
- set /p pass=Please enter the password:
- @echo.
- sqlplus sys/%pass%@%ORA_SID% as sysdba @%p%/get_rebuild.sql>nul
- for /f usebackq %%b in (`sed -n /.trc/p C:gettrc.txt`) do (set var=%%b)
- if exist %var% (
- echo Get the control file rebuild scripts from the %ORA_SID% successfully ! &echo.
- )else(
- echo Get the control file rebuild scripts from the %ORA_SID% failed ! &echo.
- echo Please re-enter the ORACLE_SID or verifythe database status is normal ! &echo.
- goto create1
- )
- goto create2

