Running Oracle VM Template for DB 12c in XenServer

As many may know Oracle VM Server is based on Xen hypervisor so it’s possible to run VMs prepared for Oracle VM on other Xen based solutions like XenServer or OCP.  Main difference is management of VMs – Oracle VM is using xm, while recent XenServer is using newer xapi stack.  But paravirtualized Linux kernels can run easily on both.

Oracle is providing VM templates with many of it’s key products – like for instance new Oracle 12c database.   In this article we will show how to run Oracle 12c Database VM template on XenServer 6.2. Continue reading Running Oracle VM Template for DB 12c in XenServer

Accesing Oracle from Python (with proper unicode support)

It’s not obvious to set it right, so I’m putting some notes here:

Installation is described here.
Few comments:

  • ORACLE_HOME is needed just for installation
  • If you add client library path to /etc/ld.so.conf.d/oracle.conf   and update ldconfig, you don’t need to export modified LD_LIBRARY_PATH
  • when you install Oracle client library and set environment,  you can install cx_oracle also via pip install cx_Oracle

The crucial step not mentioned in the installation guide is  to set NLS_LANG environment variable – this should be in the environment of your python program using cx_oracle.  So for instance for Flask+SQLAlchemy you can have:

if app.config.get('SQLALCHEMY_DATABASE_URI').startswith("oracle"):
    os.environ['NLS_LANG']= 'AMERICAN_AMERICA.AL32UTF8'

Without this variable oracle client is using 7bits ASCII! So any unicode character will raise “UnicodeEncodeError: ‘ascii’ codec can’t encode character” error.

Ocaml, Ocsigen, I Ching and Web Applications

Reading recently great Philip K Dick novel The Man in the High Castle I learned about I Ching – ancient Chinese philosophical, cosmological, but mainly divination text. I’m no big fan of divination, so in case of I Ching I would generally agree with this critical review.  However the procedure of divination used within I Ching is quite interesting – hexagrams actually represent one of oldest binary codes.  Idea that one’s fortune could be represented by 6 bits (actually it’s 12 bits, because for practical divination purpose we use 6 x 4 states) is quite amusing.   So I decided to create online I Ching application as an exercise to learn bit more about Ocsigen web framework.  You can check result of my effort here. Continue reading Ocaml, Ocsigen, I Ching and Web Applications