The “sqlplus is not recognized as an internal command” error comes up when you are trying to access the Oracle utility via the command prompt. The command line interface allows you to access the different utilities installed on your computer despite your current working directory in the prompt. This is enabled with the help of environment variables. As such, when the utility that you are trying to access is not mentioned as an environment variable, you will not be able to execute it and thus the error message in question occurs. In this article, we are going to show you how to change fix and it is pretty easy, so just follow through.
As it turns out, environment variables affect the environment that processes can run in. In essence, they become a part of the environment in which a process is running and as such, the process has access to those variables. Adding a utility in the PATH variable allows you to access it from anywhere using the command line interface and usually when you install tools that come with a command line utility, they are added to the PATH variable automatically.
This, in return, allows you to run the tools directly without having to add them manually. However, in some cases, when this does not work out, you will have to do so manually and everything should be good. In addition to that, sometimes the path provided is not correct which can also result in the error message mentioned above.
There are two ways using which you can go about this. The first is through a command line interface and the second takes you through a graphical user interface. We will be mentioning both of them so you can follow any that you like. With that said, let us get started without any further ado.
1. Add SQLPLUS to PATH Variable using Command Prompt
The first way that we are going to go through to resolve the error message in question is using the command prompt. If you are comfortable with using the command prompt, then this should be pretty easy for you. However, if you would like to avoid a command line driven solution, you can skip this and move on to the next method down below which takes you through a graphical interface approach.
Using the command prompt, you can easily set the PATH variable to include the bin directory of Oracle so that sqlplus can be executed from anywhere. To do this, follow the instructions down below:
- First of all, open up a command prompt window by searching for it in the Start Menu.
- Once the command prompt window is up, you can use the “set PATH=C:\YOUR\ORACLE\INSTALLATION\DIRECTORY\bin;%PATH” to update the PATH variable.
- Make sure to replace the “C:\YOUR\ORACLE\INSTALLATION\DIRECTORY\” text with the correct location of where Oracle is installed. Also, ensure that you do not remove the “\bin\” directory from the path above. In addition to that, do not remove the “;%PATH” part of the location either. Only replace what we have told you to above.
- With that done, you should be able to use sqlplus without any errors. You might have to open up a new command prompt window.
2. Add SQLPLUS to Path Variable using GUI
If you are not comfortable with adding the bin folder of your Oracle installation to the PATH variable using the command prompt, you can also choose to edit the environment variables via the graphical interface. This is pretty simple and easy to do as well. To do this, just follow the instructions given down below:
- First of all, open up the Windows Settings window by pressing the Windows key + I on your keyboard.
- Once the Settings window is up, on the System tab, make your way to About.
- On the About section, click on the Advanced system settings option provided.
- A new window called System Properties will open. Click on the Environment Variables button provided at the bottom right corner.
- Then, highlight the Path variable and then click the Edit button.
- Click on the New button and then paste the path of the bin folder located in the installation directory of Oracle. Make sure you include the bin folder in the address or it won’t work.
- With that done, click the OK button.
- After that, open up a command prompt window and you should be able to execute sqlplus without any issues.