Category Archives: Oracle

All those yellow sticky notes about Oracle will usually end under this category.

Java 7 update 51 and broken Raritan KVM console

We’re surprised by broken Raritan KVM console (Java application) on some of our workstations, mine included. We could login to the Raritan KVM (Dominion KX II), but could not open console to any server. We’re always greeted with the error:
Error while getting the list of open Targets, please try again in a few seconds.
First we upgraded Raritan firmware to the latest one (2.5.0.5.886), but the error was still there. The next suspect was Java itself. I noticed that coworkers working with older version of JRE does not have the problem…and to make long story short, we finally found explanation for new “security feature” introduced in Java 7 U51, a quote from Oracle release notes:
java7u51_unsigned_1

Since Dominion KVM server applet is not signed the JRE will block the app by default. The solution is to add url to Raritan KVM server to the exception list.

First, make sure that you open correct (the latest) Java Control Panel, this is especially important if you happen to have more than one JRE/JDK on your machine, because you won’t find the “Exception Site List” in older Java Control Panel. In my case (Windows7, x64) the best approach is to manually find the executable:

C:\Program Files (x86)\Java\jre7\bin\javacpl.exe

Then check the version:

java7u51_unsigned_2

Add url to exception list:

java7u51_unsigned_3

Advertisement

How to fix default (ugly) fonts in SQL Developer on Linux

Here is a short note on how to (at least) partially fix ghastly default fonts that SQL Developer is cursed with it on Linux. After I installed the recently released SQL Developer 4.0 on my Fedora 19 workstation, I immediately increased the font size from 11 points to 14 by editing:

$ nano ~/.sqldeveloper/system4.0.0.13.80/o.sqldeveloper.12.2.0.13.80/ide.properties

# To modify the font size for all look-and-feels in all locales, set
# the Ide.FontSize property.  For example:
Ide.FontSize=14

…plus, I changed the way how Java is smoothing fonts by adding two variables in product.conf file:

$ nano ~/.sqldeveloper/4.0.0/product.conf

AddVMOption -Dswing.aatext=true
AddVMOption -Dawt.useSystemAAFontSettings=lcd

Make sure that SQL Developer is not running while editing product.conf file, because it’ll overwrite your changes at exit!

And here is, somehow prettier SQL Developer IDE:

sqldeveloper-fonts-linux

Toad and pipe on Slovenian Keyboard

After you install Toad on workstation with Slovenian keyboard you might find out that you can not enter pipe (|) as usual, with AltGr+W in Toad Editor. Entering AltGr+W will open “Watches” instead of displaying pipe. The workaround is simple, go to Toad menu and select View -> Toad Options… -> Toolbars/Menus -> Shortcuts.
In combo box sort the content on column Category. Scroll to the “Editor” entries and find the line for command “Watches”. Select the line and replace default Ctrl + Alt + W with something new, for example Shift + Ctrl + Alt + W, as shown on the picture.

toad-watches

This is apparently a bug in Toad where Ctrl + Alt + W somehow equals AltGr + W!?

True XCOPY runtime for Oracle ODP.NET application

I was struggling for quite some time with my colleague at work on migration of our legacy (ODAC 10g + .NET 2.0) client/server applications to centrally managed runtime environment. Applications that run flawlessly by the users with Windows XP SP3, stopped working on newer configurations with Windows 7 x64 and ODAC 11g R5.

This is a short memo on how to prepare runtime environment for Oracle ODAC based .NET application that can be run from a network drive. Oracle at the time of this writing does NOT have a proper document covering a “true” XCOPY based installation. With a “true” XCOPY installation I mean the one that doesn’t need any super user privilege to install application on client — we want totally GAC agnostic ODP.NET application runtime env. In short, we don’t want to run neither install.bat nor configure.bat script from ODAC client zip file shipped by Oracle.
(If you wonder why? Because GAC is utterly disgusting .NET “thing”, almost as disgusting as the windows registry, and a clear evidence that MS will never learn from *nix).

In summary the objective is:

  • allow our end users with Windows XP SP3 (32-bit) or Windows 7 EE (32-bit or 64-bit) to run simple WinForms .NET applications in C/S mode
  • some clients are also developers with local (“by-the-book”) installation of ODAC (10g, 11g) with GAC registrations, they should be able to run prod. applications in a complete isolation from their local environment.
  • all .NET application must be installed centrally on our main file server and must as well use centrally installed Oracle client with ODAC
  • all that is needed to install application on client workstation is to create shortcut that points to startup routine to launch application from file server. No super-user privilege is allowed as a prerequisite for application installation!

And here are the steps that we followed:

  1. Download “ODAC 11.2 Release 5 (11.2.0.3.20) with Xcopy Deployment” from OTN”
  2. Unzip ODAC1120320Xcopy_32bit.zip to some temporary directory, let’s say G:\TEMP. Then copy relevant directories (in our case instant client + ODP.NET 4.0) to network drive.
    Do NOT run install.bat! Let’s say that our target network directory that’ll be used by all .NET apps is N:\ORACLE\ORA11odacR5.

    // copy instant client and odp.net4 from temp directory
    // to network based N:\ORACLE\ORA11odacR5
    cmd> g:
    cmd> cd g:\temp
    cmd> xcopy instantclient_11_2 N:\ORACLE\ora11odacR5 /I /E /F /R /Y
    cmd> xcopy odp.net4 N:\ORACLE\ora11odacR5 /I /E /F /R /Y

  3. make sure that .NET application build is targeted at .NET 4.0 and x86 platform. We do NOT recommend using “Any CPU” for mix (32-bit & 64-bit) clients, sometimes we run into problems on x64. We also strongly recommend using 4.0 for the lowest .NET target framework. Previously (.NET 2.0 – 3.5) we needed to authorize client PC’s before users could run .NET apps from our file server. On .NET 4.0 this is not necessary any more. Since 4.0 is the highest .NET framework version still supported on XP SP3 the decision to deploy to 4.0 was trivial. Some screenshots showing our build instructions:

    odac-runtime1

    odac-runtime2

    odac-runtime3

    odac-runtime4

    odac-runtime5

    Note that on second picture application “build” is using locally installed Oracle.DataAccess.dll (framed in blue) and this is ok. Developers can use whatever Oracle.DataAccess.dll they want, even an older one (one of our application was developed with 10g Oracle.DataAccess.dll, but deployed to runtime env. with ODAC11g R5), because in the next step we’ll override developer “choice” with our network based (latest) ODAC 11g R5. And this can be done with app. config.

  4. Generate and then customize application config xml file (in our case OraDUAL.exe.config. And precisely here is where Oracle documentation is not clear and precise enough. How should application config look like that could be used on workstation without any Oracle client (more precisely on workstation where Oracle OUI or install.bat didn’t run, hence machine.config is untouched).
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
       <!-- configSections was copied here from one of our developer's machine.config 
            where ODAC11g R5 was installed with install.bat. Note that you can not
            blindly copy this section because different ODAC version may have 
            different PublicKeyToken. Always check what Oracle sets up! 
        -->
       <configSections>
        <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="system.data.oracleclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
       </configSections>
       
       <!-- This section needs either properly edited machine.config from Oracle OUI 
            (or install.bat from instant client) or manually added configSections (see above).
            Note that DllPath needs to point to the Instant client directory, 
            not to the Oracle.DataAccess.dll directory!
        -->
       <oracle.dataaccess.client>
        <settings>
          <add name="DllPath" value="N:\ORACLE\ORA11odacR5"/>
          <add name="FetchSize"             value="65536"/>
          <add name="PromotableTransaction" value="promotable"/>
          <add name="StatementCacheSize"    value="0"/>
          <add name="TraceFileName"         value="%TEMP%\odpnet.trc"/>
          <add name="TraceLevel"            value="0"/>
          <add name="TraceOption"           value="0"/>
        </settings>
      </oracle.dataaccess.client>
      
      <!-- Here we're telling .NET framework two things:
           - which version of Oracle.DataAccess.dll we want to be used
           - and from where exactly it should load the assembly.
           Any version of Oracle.DataAccess.dll between 0.0.0.0 and 4.112.3.0
           will be replaced by 4.112.3.0.
           Note that publicKeyToken is "hash" dedicated to Oracle Corp. but might
           change in the future. We checked the token against GAC.
      -->
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <publisherPolicy apply="no" />
            <assemblyIdentity name="Oracle.DataAccess"
                              publicKeyToken="89B483F429C47342"
                              culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.112.3.0"
                             newVersion="4.112.3.0"/>
            <codeBase
                    version="4.112.3.0"
                    href="file:///N:\ORACLE\ORA11odacR5\odp.net4\odp.net\bin\4\Oracle.DataAccess.dll"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    

    In case the application is build with additional libraries that internally depends on Oracle data provider (Oracle.DataAccess.dll) the same kind of config file needs to be prepared for each library (for example if OraDUAL.exe needs OraAcme.dll and OraAcme.dll is referencing Oracle.DataAccess.dll, then OraAcme.dll.config must be present with redirecting directives already shown in app.config).

  5. The final step is to prepare batch routine to launch our application from network drive.
    :: RunOraDUAL.bat
    :: Oracle11g [11.2.0.3] Instant Client with ODAC 11.2.0.3.20
    ::
    :: Batch routine to launch OraDUAL.exe from newtork drive.
    ::
    :: ---------------------------------------------------------
    
    title Oracle11g Instant Client - ODAC 11.2.0.3.20
    SET NLS_LANG=SLOVENIAN_SLOVENIA.EE8MSWIN1250
    SET NLS_DATE_FORMAT=DD.MM.YYYY
    SET ORACLE_HOME=N:\ORACLE\ORA11ODACR5
    SET TNS_ADMIN=N:\ORACLE\ORA11ODACR5
    
    SET PATH=%ORACLE_HOME%;%ORACLE_HOME%\ODP.NET4\BIN;%ORACLE_HOME%\odp.net4\odp.net\bin\4;%PATH%;
    
    start OraDUAL.exe 
    :: End
    

    Make sure that you include both \BIN directories that belongs to ODP.NET4 to the path!
    In our case we put RunOraDUAL.bat in the same directory with OraDUAL.exe and OraDUAL.exe.config.
    Note that you do NOT need to place Oracle.DataAccess.dll to application directory even though VisualStudio will copy
    Oracle.DataAccess.dll in \BUILD directory because we instructed this with “Copy Local = True” (refer to screenshot #2)!
    The only thing we copied to network share N:\APPS\OraDual is exe and config file.

SQL*Developer & fixing missing MSVCR100.DLL error

During SQL Developer 3.2 installation on Windows 7 x64 with Java JDK 7 update 7 I was greeted with the error about missing msvcr100.dll:

sqldeveloper64-error

Copy msvcr100.dll file from JDK bin directory to SQL Developer directory:

sqldeveloper64-error2