10 Replies Latest reply: Apr 10, 2013 7:10 AM by 860675 RSS

    Issue of Sqlplus

    HuaMin Chen
      Hi,
      Before this, everything is fine for my Oracle express 11g inside my OL5.8.

      Now I get this
      oracle@localhost:~$ sqlplus /nolog
      bash: sqlplus: command not found

      using oracle user in my OL 5.8. why?
        • 1. Re: Issue of Sqlplus
          User477708-OC
          paths and enviroments

          did you set up your profile?

          echo $ORACLE_HOME
          • 2. Re: Issue of Sqlplus
            Billy~Verreynne
            You need a valid Oracle environment. I prefer setting this explicitly via +.bash_profile+ in the user account.

            Alternatively, you can simply source the default Oracle environment script, e.g.
            oracle@localhost:~$ . /usr/local/bin/oraenv
            • 3. Re: Issue of Sqlplus
              EdStevens
              HuaMin Chen wrote:
              Hi,
              Before this, everything is fine for my Oracle express 11g inside my OL5.8.

              Now I get this
              oracle@localhost:~$ sqlplus /nolog
              bash: sqlplus: command not found

              using oracle user in my OL 5.8. why?
              By definition ... the message "bash: xxxxxxxx: command not found" is issued by the OS when it cannot find an executable file 'xxxxxxxx' in any of the directories listed in the $PATH environment variable. It has to do with sqlplus only because in your case 'xxxxxxxx' was 'sqlplus'.

              So you have to ask yourself, "why isn't the directory that contains sqlplus not included in the PATH environment variable?"
              • 4. Re: Issue of Sqlplus
                HuaMin Chen
                Thanks all.
                Billy,
                I've adjusted the file and here is my current bash_profile
                case $- in
                i ) # We're interactive
                if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                esac
                . /usr/local/bin/oraenv

                but I still cannot run sqlplus.

                Edstevens,
                I was really confused what change was leading to the problem as it was fine before this.
                • 5. Re: Issue of Sqlplus
                  sb92075
                  HuaMin Chen wrote:
                  Thanks all.
                  Billy,
                  I've adjusted the file and here is my current bash_profile
                  case $- in
                  i ) # We're interactive
                  if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                  esac
                  . /usr/local/bin/oraenv

                  but I still cannot run sqlplus.

                  Edstevens,
                  I was really confused what change was leading to the problem as it was fine before this.
                  post results from OS command below

                  env | sort
                  • 6. Re: Issue of Sqlplus
                    HuaMin Chen
                    Thanks. See this
                    oracle@localhost:~$ env | sort
                    COLORTERM=gnome-terminal
                    CVS_RSH=ssh
                    DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1EhQ6dGR9B,guid=49edf9c60b91703ddb5827005164dd4b
                    DESKTOP_SESSION=default
                    DESKTOP_STARTUP_ID=
                    DISPLAY=:0.0
                    G_BROKEN_FILENAMES=1
                    GDMSESSION=default
                    GDM_XSERVER_LOCATION=local
                    GNOME_DESKTOP_SESSION_ID=Default
                    GNOME_KEYRING_SOCKET=/tmp/keyring-L8DvEv/socket
                    GTK_IM_MODULE=scim-bridge
                    GTK_RC_FILES=/etc/gtk/gtkrc:/u01/app/oracle/.gtkrc-1.2-gnome2
                    HISTSIZE=1000
                    HOME=/u01/app/oracle
                    HOSTNAME=localhost.localdomain
                    INPUTRC=/etc/inputrc
                    LANG=en_US.UTF-8
                    LESSOPEN=|/usr/bin/lesspipe.sh %s
                    LOGNAME=oracle
                    LS_COLORS=
                    MAIL=/var/spool/mail/oracle
                    PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
                    PS1=\[\033]0;\u@\h:\w\007\]\u@\h:\w\$
                    PWD=/u01/app/oracle
                    QT_IM_MODULE=scim
                    SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/3295
                    SHELL=/bin/bash
                    SHLVL=2
                    SSH_AGENT_PID=3349
                    SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
                    SSH_AUTH_SOCK=/tmp/ssh-xVXCID3295/agent.3295
                    TERM=xterm
                    USERNAME=oracle
                    USER=oracle
                    _=/usr/bin/env
                    WINDOWID=27263058
                    XAUTHORITY=/tmp/.gdmW54NVW
                    XMODIFIERS=@im=SCIM
                    • 7. Re: Issue of Sqlplus
                      sb92075
                      HuaMin Chen wrote:
                      Thanks. See this
                      oracle@localhost:~$ env | sort
                      COLORTERM=gnome-terminal
                      CVS_RSH=ssh
                      DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1EhQ6dGR9B,guid=49edf9c60b91703ddb5827005164dd4b
                      DESKTOP_SESSION=default
                      DESKTOP_STARTUP_ID=
                      DISPLAY=:0.0
                      G_BROKEN_FILENAMES=1
                      GDMSESSION=default
                      GDM_XSERVER_LOCATION=local
                      GNOME_DESKTOP_SESSION_ID=Default
                      GNOME_KEYRING_SOCKET=/tmp/keyring-L8DvEv/socket
                      GTK_IM_MODULE=scim-bridge
                      GTK_RC_FILES=/etc/gtk/gtkrc:/u01/app/oracle/.gtkrc-1.2-gnome2
                      HISTSIZE=1000
                      HOME=/u01/app/oracle
                      HOSTNAME=localhost.localdomain
                      INPUTRC=/etc/inputrc
                      LANG=en_US.UTF-8
                      LESSOPEN=|/usr/bin/lesspipe.sh %s
                      LOGNAME=oracle
                      LS_COLORS=
                      MAIL=/var/spool/mail/oracle
                      PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
                      sqlplus does not exist in any directory listed in PATH above
                      • 8. Re: Issue of Sqlplus
                        Billy~Verreynne
                        HuaMin Chen wrote:
                        Thanks all.
                        Billy,
                        I've adjusted the file and here is my current bash_profile
                        case $- in
                        i ) # We're interactive
                        if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                        esac
                        . /usr/local/bin/oraenv

                        but I still cannot run sqlplus.
                        The oraenv script is an interactive script. It prompts the user to enter/select values. If you run it in the background, these prompts will likely read null values and not set the environment correctly.

                        You need to set another environment variable to tell oraenv to use defaults and not prompt - cannot recall what this variable name is. Suggest you do some web research on this, and how to set the local environment for Oracle database s/w.
                        • 9. Re: Issue of Sqlplus
                          EdStevens
                          HuaMin Chen wrote:
                          Thanks all.
                          Billy,
                          I've adjusted the file and here is my current bash_profile
                          case $- in
                          i ) # We're interactive
                          if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                          esac
                          . /usr/local/bin/oraenv
                          As SB said, oraenv is meant to be interactive. To run it in batch, you must do as follows:
                          export PATH=/usr/local/bin:$PATH
                          export ORACLE_SID=<your oracle sid value>
                          export ORAENV_ASK=NO
                          . oraenv
                          unset ORAENV_ASK
                          but I still cannot run sqlplus.

                          Edstevens,
                          I was really confused what change was leading to the problem as it was fine before this.
                          • 10. Re: Issue of Sqlplus
                            860675
                            first check sqlplus utility available there