在oracle控制台当你输入错误的时候,还不能删除,回退的解决方法

对于回退出现^H解决方法

oracle@prd:/home/oracle$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 18 23:14:16 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> sea^H^H  //本想打的是select ,结果输入sea,当想删除a 时,利用backspace键删除就就会出现^H,是很烦的事.只能回车。
SP2-0042: unknown command "sea" - rest of line ignored.
SQL> s -^H^_^_^_^_^_^_??^_^_^_^_^_
SP2-0734: unknown command beginning "s ..." - rest of line ignored.

解决方案: 修改oracle这个用户的.bash_profile文件,你用su - oracle登录后,修改用户的环境变量文件

//登录oracle这个用户

  [root@rac-2 ~]# su - oracle
  Last login: Sat Mar 19 00:47:12 CST 2022 on pts/0

  //默认登录是/home/oracle,你一旦在系统里增加一个用户对应/home下就会出现该用户的目录,该用户的权限仅限该目录

   oracle@prod:/home/oracle$pwd
   /home/oracle

   //查看环境变量文件可以 ll -a 查看

 // 在.bash_profile文件的最后位置,添加一行stty erase ^H
 oracle@prd:/home/oracle$vi .bash_profile  

   .... //上面的省略

   export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
   export PS1="`whoami`@$ORACLE_SID:"'$PWD$'  
   export DB_ALERT=/u01/oracle/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace
   alias sqlplus='rlwrap sqlplus'
   alias rman='rlwrap rman'
   alias lsnrctl='rlwrap lsnrctl'
   stty erase ^H  //新增一行

//修改完之后,使该文件生效 oracle@prd:/home/oracle$source .bash_profile 
//虽然问题小,但是解决大麻烦

 

posted @ 2022-03-18 23:37  jinzi  阅读(493)  评论(0编辑  收藏  举报