How to access the oracle DB installed in windows from UNIX

I have installed the unix on windows and followed the steps given in how to run Linux Commands on Windows 10?

And also I have installed the Oracle DB on same windows machine.

Now I have to access the sqlplus from unix box.

I am getting sqlplus: command not found when i type sqlplus in unix screen.

I have done sudo ln -s /mnt/d/Oracle/bin/sqlplus /bin/sqlplus but still it says command not found.

So this unix package which i installed does not have SQLPLUS ?

Thanks,
Ramesh Selvam

Welcome!
What kind of file is the /mnt/d/Oracle/bin/sqlplus ?
Find out with
file /mnt/d/Oracle/bin/sqlplus
If it's a dynamically linked binary then examine it with
ldd /mnt/d/Oracle/bin/sqlplus

@rameshemessage ,

NB: sqlplus is an oracle utility, nothing to do with linux.

What happens if you try to execute the command below (show the command typed and all outputs please (copy/paste all the output ))
/mnt/d/Oracle/bin/sqlplus
or
sudo /mnt/d/Oracle/bin/sqlplus

to avoid confusion, clarify

is 'linux' an WSL instance or something else ? (presume WSL)
is the Oracle DB running under Windows or under WSL (presume WSL)
which version of Oracle is installed?

tks

I uninstalled the DB installed on Windows 10 and currently re-installing it. I will paste the output once DB is ready

Yes. linux is an WSL Instance
Oracle DB is running under windows not under WSL
19c enterprise edition.
Thanks
Ramesh Selvam.

This is the output..

ramesh@DESKTOP-MSHN1Q8:~$ sudo /mnt/d/Oracle/bin/sqlplus
[sudo] password for ramesh:
sudo: /mnt/d/Oracle/bin/sqlplus: command not found
ramesh@DESKTOP-MSHN1Q8:~$

ramesh@DESKTOP-MSHN1Q8:~$ file /mnt/d/Oracle/bin/sqlplus
/mnt/d/Oracle/bin/sqlplus: cannot open `/mnt/d/Oracle/bin/sqlplus' (No such file or directory)
ramesh@DESKTOP-MSHN1Q8:~$

So where is the sqlplus binary actually installed?
Which tutorial/instructions did you follow? What installation script did you use?

@rameshemessage , ok
so you need to install sqlplus onto the linux instance , or see if the sqlcl utility is available on the WSL instance , or visit https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/ and follow instructions

to run sqlplus from WINDOWS , install the oracle client tools - check out oracle.com/downloads , ditto for installing them on WSL , buy you'll have additional fun to deal with in connecting across the two environments (TNS...)

(its been a long time since i've done any of this so, E&O are likely)

I have downloaded the DB from this oracle website and followed the installation.
notes

Not sure if I unzip the file I could see the sql plus under /bin..seems like it did not install..but If open sqlplus.exe file I could connect to installed DB.

Thanks,
Ramesh Selvam

1 Like

Which Oracle website is "this oracle website"? Did you install Windows version only? sqlplus.exe (binary for Windows) is not sqlplus (binary for Linux) - you most likely need to install each client separately in respective OS.

@rameshemessage , so, are you saying you have successfully connected to the dB using sqlplus.exe ?

Thanks..it worked after installing the Oracle Instant client for Linux. Though in UBUNTU it needs different way to install but I did it.

Thanks

1 Like