Is there a good alternative to SQL*PLUS for Oracle?

前端 未结 16 724
一生所求
一生所求 2021-02-01 02:24

I am not a fan of using SQL*PLUS as an interface to Oracle. I usually use yasql, but it hasn\'t been updated since 2005 and can do with some improvements. A quick Google searc

16条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 03:07

    I just use socat to add readline support to sqlplus. History and a working backspace key actually turn sqlplus into a pretty decent tool.

    In my .bashrc:

    function sqlplus {
            socat READLINE,history=$HOME/.sqlplus_history EXEC:"$ORACLE_HOME/bin/sqlplus $(echo $@ | sed 's/\([\:]\)/\\\1/g')",pty,setsid,ctty
            status=$?
    }
    

    You might see alternatives that alias sqlplus to socat, but you will quickly discover that doing so prevents you from invoking sqlplus with its various command line options.

    CAVEAT: Be sure to set $HOME/.sqlplus_history permissions to 0600. Passwords that you type end up in the history file. You might also consider adding cat /dev/null > $HOME/.sqlplus_history to your .bash_logout.

提交回复
热议问题