1.使当前会话生效
define_editor=vi
SQL> select * from dual; D - X SQL> edit Wrote file afiedt.buf 21 1* select * from dual
(这一步如果不能退出,使用ctrl+D) SQL> set _EDITOR=vi SP2-0158: unknown SET option "_EDITOR=vi" SQL> define_editor=vi SQL> ed Wrote file afiedt.buf 1* select * from dual SQL> ed Wrote file afiedt.buf 1* select 1 from dual SQL> / 1 ---------- 1 SQL>
2.默认生效
打开$ORACLE_HOME/sqlplus/admin/glogin.sql文件,在末尾添加一行:
define_editor=vi