Unable execute “@”(at) sql file in sqlplus on hp-ux issue
I have a ORACLE db server on hp-ux, i want to execute a sql script file in sqlplus using “@” , get some error. but I use “start” sql file in sqlplus ,it work fine for me. now I have been resolved this error, just shared here.
SQL> @uptime SP2-0042: unknown command "uptime" - rest of line ignored. SQL> start uptime Session altered. SYSDATE STARTUP_TIME INSTANCE_NAME ------------------- ------------------- ---------------- 2015-01-05 13:04:54 2014-05-22 20:21:40 hbods SQL> host cat uptime.sql alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss'; select sysdate, startup_time,instance_name from gv$instance; SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for HPUX: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production SQL> host uname -a HP-UX hbodsdbb B.11.31 U ia64 0314585245 unlimited-user license
[oracle@hbodsdbb:/ora10g]#stty -a
speed 9600 baud; line = 0;
rows = 32; columns = 149
min = 4; time = 0;
intr = DEL; quit = ^\; erase = ^H; kill = @
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
stop = ^S; start = ^Q; susp <undef>; dsusp <undef>
[oracle@hbodsdbb:/ora10g]#echo $SHELL
/usr/bin/ksh
# another machine (It at sql worked.)
#uname -a
HP-UX -CRM-2 B.11.31 U ia64 2919238954 unlimited-user license
#stty -a
…
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^X
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
…
[oracle@hbodsdbb:/ora10g]#vi .profile
…
## stty kill ‘^X’
export TERM=vt100
…
#去掉stty kill该注释后或增一行
“.profile” 25 lines, 1100 characters
[oracle@hbodsdbb:/ora10g]#. .profile
[oracle@hbodsdbb:/ora10g]#stty -a
intr = DEL; quit = ^\; erase = ^H; kill = ^X
SQL> @uptime
Session altered.
SYSDATE STARTUP_TIME INSTANCE_NAME
——————- ——————- —————-
2015-01-05 13:39:32 2014-05-22 20:21:40 anbob
from man stty
Set the delete-line character to ^X (Ctrl-X) and the interrupti character to ^C.
stty kill ‘^X’ intr ‘^C’
This command is usually found in a .login or .profile file so that ^X and ^C need not be set by the user at each login session.
“stty ek” Reset ERASE and KILL characters back to default # and @.
对不起,这篇文章暂时关闭评论。