1

I want to install Oracle Database 12c on my Windows 10 PC and use it with Linux commands on the provided bash. Can I do this? If so, then how?

1
  • 1
    You should check whether this is supported by the vendor. I doubt it. In addition, it is possible this isn't supported by the wsl either, as unix sockets and network support is incomplete.
    – simlev
    Commented Jul 20, 2017 at 15:29

2 Answers 2

1

I use Ubuntu on Windows 10 all the time for local Windows installations. Just set up environmental variables. Here is the example for my 11gR2 database environment file. (If it’s just one installation, you can add to .bash_profile.)

 #!/bin/bash
 export ORACLE_SID=ora  
 export ORACLE_HOME=/mnt/c/ora/product/11.2.0/db_1
 export PATH=$ORACLE_HOME/BIN:$PATH  
 alias sqlplus='rlwrap sqlplus.exe /nolog'
 alias s='rlwrap sqlplus.exe / as sysdba' 
 alias lsnrctl='lsnrctl.exe'
 alias oradim='oradim.exe'
 alias rman='rman.exe' 
 alias adrci='adrci.exe'
1

I have successfully done this with WSL 2 and Oracle XE 11g.

  1. In the Windows Firewall allow incoming requests through Oracle's default port 1521.

  2. In Bash get the IP Address of the WSL network adapter:

grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'
  1. Test the communication with Oracle using telnet:
telnet ip.from.step.2 1521
  1. Follow this tutorial to install Oracle Instant Client for Linux (same version as the Oracle DB)

  2. Connect with the Oracle server using sqlplus:

sqlplus user/password@//ip.from.step.2:1521/db_name

Update: Instead of opening the port in the Firewall you can add a rule to allow connections to C:\oraclexe\app\oracle\product\11.2.0\server\BIN\tnslsnr.exe.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .