我使用批处理文件来调用过程,但收到错误:
ORA-12560:TNS =协议适配器错误。
以下是我正在使用的批处理文件。另请参阅随附的屏幕截图。
@echo off
set user_name=DSAGILE
set password=mpno2015#02zwcr
set net_SID=FRDSTT1D
(
echo @ProcedureToExecute.sql
echo exit
) | sqlplus -s %user_name%/%password%@%net_SID%
pause
答案 0 :(得分:0)
您只需要正确设置环境,例如
C:\temp\oh>sqlplus scott/tiger
SQL*Plus: Release 12.2.0.1.0 Production on Wed Feb 7 10:55:42 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name: ^C
C:\temp\oh>set ORACLE_HOME=c:\oracle\product\12.2.0.1
C:\temp\oh>set ORACLE_SID=db122
C:\temp\oh>sqlplus scott/tiger
SQL*Plus: Release 12.2.0.1.0 Production on Wed Feb 7 10:56:05 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Fri Feb 02 2018 15:00:42 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production