标题: [其他] 求助,批处理登录Oracle失败后如何执行后续命令 [打印本页]
作者: yuyuyuyu 时间: 2017-7-3 18:39 标题: 求助,批处理登录Oracle失败后如何执行后续命令
RT,以下是部分代码:- :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 verify the database status is normal ! &echo.
- goto create1
- )
- goto create2
复制代码
目的是登录Oracle数据库后获取某个文件。
问题:当实例或者密码输入错误后,脚本会卡在登录那个阶段,errorlevel也没有返回值,此时该怎样跳过这条命令继续执行?
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |