Monday, September 08, 2008

PL/SQL developer on Linux

I have made the decisions to switch from a windows work laptop to a Linux laptop. At some points this can be hard, for example I use a tool called PL/SQL Developer from allroundautomations. I use the tool to code PL/SQL code for Oracle and is one of the things I start at first in the morning; mail, Firefox and then PL/SQL Developer. So switching to a Linux only laptop was challenging because I needed to get this windows program running under windows.

To run windows applications on a Linux box you can use wine, Wine is an Open Source implementation of the Windows API on top of X, OpenGL, and Unix. So I installed wine and gave myself a windows runtime enviroment. The following steps to make PL/SQL developer run under windows are:

Download and unpack (no need for installation) the Oracle instant client package which you can download from the oracle website and place this in your virtual C drive.

Next step, create a location to store you TNSNAMES.ORA file. I have placed it inside the instant client directory.

Now you have to make some changes to the system.reg file of wine. Here are settings stored which are used in 'windows'. You have to set the location of your TNSNAMES.ORA file as a TNS_ADMIN variable and you have to set the location of the instant client in the PATH variable. This made in my case the following:

[System\\CurrentControlSet\\Control\\Session Manager\\Environment] 1220471456

"APPDATA"="C:\\windows\\profiles\\jlouwers\\Application Data"

"ComSpec"=str(2):"C:\\windows\\system32\\cmd.exe"

"LOCALAPPDATA"="C:\\windows\\profiles\\jlouwers\\Local Settings\\Application Data"

"NUMBER_OF_PROCESSORS"="2"

"OS"="Windows_NT"

"PATH"=str(2):"C:\\windows\\system32;C:\\windows;C:\\instantclient_11_1"

"PROCESSOR_ARCHITECTURE"="x86"

"PROCESSOR_IDENTIFIER"="x86 Family 6 Model 15 Stepping 13, GenuineIntel"

"PROCESSOR_LEVEL"="6"

"PROCESSOR_REVISION"="0f0d"

"ProgramFiles"="C:\\Program Files"

"SystemDrive"="c:"

"SYSTEMROOT"="C:\\windows"

"TEMP"=str(2):"C:\\windows\\temp"

"TMP"=str(2):"C:\\windows\\temp"

"TNS_ADMIN"="c:\\instantclient_11_1\\tns"

"windir"=str(2):"C:\\windows"

"winsysdir"="C:\\windows\\system32"


Now you also have to set some things in PL/SQL developer itself to make things work correct. Install PL/SQL developer, this should go without any problem. After you installed it open PL/SQL developer and go to the preferences menu. Under 'Oracle' – 'Connections' set the Oracle Home. In my case this was 'C:\instantclient_11_1' and set the location of the OCI library, in my case this was 'c:\instantclient_11_1\oci.dll'. The last thing you have to do is to uncheck 'faded disabled buttons' under 'User Interface' – Apperance. This is to solve the problem of some menu items not displaying.

When this is set, restart PL/SQL developer and you are able to use like it was installed on a windows pc.





Post a Comment