Tantalus – that Greek bloke who was doomed for all eternity to eternal thirst and hunger despite having food and water within reach. Had he been a Geek, rather than a Greek, he would’ve worked in a place where you can choose which OS to use…but be denied by the fact that, as a database developer, he had to use PL/SQLDeveloper – a Windows only IDE.
Oh the bitter irony. Well, unlike Tantalus, I’ve decided that, as with so many other problems in life, this particular dilemma can be resolved by alcohol – in this case, a glass of Wine.
WINE – formerly WINdows Emulator, now re-christened Wine Is Not an Emulator. It’s open source so, on this occasion, we don’t have to beware Geeks bearing gifts ( sorry).
For this particular exercise, I’m using Ubuntu 10.04.
PL/SQLDeveloper is that “other” PL/SQL IDE – this one being published by Allround Automations.
An acknowledgement before I go any further – this article by Nik Chakov was really useful.
Go into Synaptic Package Manager ( System / Administration / Synaptic Package Manager )
In the Quick Search type wine
Check the box to install wine and say yes to the host of packages that will also be marked.
Click Apply and let Synaptic do it’s thing.
When it’s all finished, you’ll have a menu entry for wine under the Applications menu.
Notepad comes pre-installed and is runnable from under the Wine / Accessories Menu
Installing the Oracle Client
Yes, we may well have a Oracle Client already on the machine, but PL/SQLDeveloper relies on the presence of a dll. So, head over to the Oracle Client Download Page.
Note – we need the full-fat instant client – the one with all the OCI stuff. I found this out the hard-way as I initally downloaded the sqlplus version (780 kb). What you actually need is the 49.1 MB instantclient-basic-win32-126.96.36.199.0.zip.
If you’re using Firefox, the file will be saved to the $HOME/Downloads directory.
Next step is to create get the files extracted into the appropriate directories in the Wine home directory. In Terminal…
$ cd $HOME/.wine/drive_c $ mkdir oracle $ cd oracle $ mkdir bin $ mkdir network $ cd network $ mkdir admin $ cd bin $ cp $HOME/Downloads/instantclient-basic-win32-188.8.131.52.0.zip . $ unzip instantclient-basic-win32.zip
At this point, I tidied up a bit…
$ mv instantclient_11_2/* . $ rmdir instantclient_11_2
So, we’ve got all of the required files in c:\oracle\bin
The oracle home is going to be c:\oracle
We need to define this in a Windows way so …
$ wine regedit
Add Oracle under HKEY_Local_Machine\Software
Amend the PATH by adding c:\oracle;c:\oracle\bin
We also need to add an entry for TNS_ADMIN to be c:\oracle\network\admin.
Next, we need a listener.ora and tnsnames.ora in the c:\oracle\network\admin directory.
These files are the same irrespective of the OS you’re running on so, if you’ve already got an oracle client configured, you can just copy these files accross.
The listener.ora first :
SQLNET.AUTHENTICATION_SERVICES=(NTS) NAMES.DIRECTORY_PATH=(LDAP,TNSNAMES,ONAMES,HOSTNAME) DEFAULT_SDU_SIZE=8761
Now the tnsnames.ora :
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = my-pc-name)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )
You can download a trial version from the Allround Automations site.
The downloaded file is plsqldev804.exe.
Copy this file to c:\Program Files ( $HOME/.wine/drive_c/Program Files)
We need to associate this file with wine so…
Go to the Applications Menu , Wine, Browse C: Drive then navigate to Program files.
Right click the file you’ve downloaded ( plsqldev804.exe )
Select the Permissions tab.
Here you need to check the Allow Executing File As Program as per the screenshot below :
Next open the Open With tab, click the Add button.
Now select Wine Windows Program Loader from the list and click Add.
Back in the Open With tab, select the Wine Windows Program Loader.
Back in the file explorer, Right-click the file and open with Wine.
The installer should now run as you’d normally expect. Accept all of the defaults.
Now for the test. You can either run PLSQLDeveloper from the desktop icon or from under the Wine menu ( Applications/Wine/Programs/Applications/PLSQLDeveloper ).
When you get the dialog box to connect to a database, you should have all of the databases in your tnsnames file in the drop-down.
One final step – ( thanks to the instructions at the Wine PLSQLDeveloper page) – to get the icons to display correctly, go into the PL/SQLDeveloper Tools/Preferences menu and in the User Interface Appearance section, uncheck the option for Faded disabled buttons. Now re-start PL/SQLDeveloper.
Hopefully, you should now have a fully functioning copy of PL/SQL Developer and just maybe one step closer to a Windows free working environment.