THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Using KateSQL to connect to an Oracle database in Kate

Among the features announced with the release of version 4.6 of the KDE Software Compilation is KateSQL, a SQL Query plugin for the Kate text editor providing the basic functionality of a SQL client. It leverages the Qt SQL module, allowing you to make a connection to most types of databases. Out of the box it includes support for MySQL and SQLite, and with this post I’ll show you how to get it to connect to Oracle databases as well.

Since I am an Ubuntu user (Note: you’ll need to be on 11.04 and either be running Kubuntu or have the ‘kate’ package installed) these instructions will be specific to that operating system, though they will likely also apply to other Debian-based distributions with minimal modification. However, if you are using an RPM-based distribution such as openSUSE or Fedora, you’ll need to adapt the instructions somewhat to make sure you have the necessary development packages installed.

The first thing we’ll need to do in order to get this to work is to obtain an Oracle client. This can be downloaded from the Oracle Technology Network and requires that you have a valid Oracle.com Single Sign-On account. For the purposes of this article we’re going to use the Linux x86 Oracle Instant Client and the files we’re going to download are:

oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm
oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm

The first package is the client itself, providing the files required to run OCI applications. The second is the Instant Client SDK which includes header files for developing Oracle applications with Instant Client: in our case an OCI library for the Qt SQL module.

Users of RPM-based distributions can just go ahead and install these packages while others will need to convert them to .deb format first. The best way to do this that I am aware of is with the tool called Alien. Let’s install it, convert the Oracle Instant Client packages, and install them too.

cd /path/to/oracle/instant/client/files
sudo apt-get install alien
sudo alien oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm
sudo alien oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm
sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.2.0-2_i386.deb oracle-instantclient11.2-devel_11.2.0.2.0-2_i386.deb

The next step is to install all of the dependencies necessary to build the Qt SQL OCI library.

sudo apt-get build-dep qt4-x11
sudo apt-get install qt4-qmake libqt4-dev libaio1

Then we will need the actual source code for the qt4-x11 package. This can be obtained with the following command:

apt-get source qt4-x11

To recap, at this point we’ve downloaded and installed the Oracle Instant Client and all of the dependencies required to build the qt4-x11 package, and we’ve downloaded the qt4-x11 source code. Next we’re going to build the Qt SQL OCI library itself.

sudo ln -s /path/to/qt4-x11-4.7.0/src /usr/include/src
sudo cp -r /path/to/qt4-x11-4.7.0/include/QtSql/private /usr/include/qt4/QtSql/
cd /usr/include/src/plugins/sqldrivers/oci/
qmake "INCLUDEPATH+=/usr/include/oracle/11.2/client64" "LIBS+=-L/usr/lib/oracle/11.2/client64/lib -Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz11" oci.pro
make
sudo make install

Now that the libqsqloci.so module has been built and installed, Kate should be able to connect to an Oracle database. Launch Kate (or close and re-open it if it was already running), click Settings -> Configure Kate, expand the Application tree if necessary, click Plugins, check ‘SQL Plugin‘ and click OK. Then click SQL -> Add connection to launch the connection wizard. In addition to the MySQL and SQLite database drivers, you should now also have drivers named QOCI and QOCI8 available. Choose the appropriate one, enter relevant connection details, and complete the connection wizard. You can now execute queries against the database and display result data.

Installing TOra with Oracle Support on Ubuntu 10.10 (Maverick Meercat)

Good afternoon sports fans. I’ve had a couple of requests to update my world famous blog on installing TOra. Frankly I have been wanting to get this out for a while but duties other than blogging have taken precedence. That and I think my blogging ran out of entropy and needed some other IO to get going again. Well it’s now time for you all to let out that breath you have been holding since the ‘perfect 10′ was released (on 10.10.10 no less).
Read the rest of this entry . . .

OVSAGE June Meeting

On June 17th, Pythian hosted the June of meeting of OVSAGE. This month, there was a presentation by Bill Stuart, CEO and VP Engineering , Karoly Molnar of Eseri. Eseri is a local Ottawa company that has integrated a full organization IT solution from the best of the world’s open source, from hosted Intranet to desktops to applications, and host it in the cloud for access on virtual desktops.

Essentially, Eseri provides an “office in a cloud”. Within the organizational cloud, clients have access to a wide range of tools, like wiki, documentation management and e-mail. All of the software used is proven open source products such as Ubuntu for the operating system, Evolution as the e-mail client and Mediawiki for the wiki.

The meeting focused on the technical aspects of Eseri’s offering. Eseri uses Ubuntu Enterprise Cloud as the basis for its architechture. Access is provide using NoMachine client software.

There was much discussion about security, with Eseri emphasizing that each organization is a completely separate entity, with all data being kept with the organizational cloud. Access to the cloud is protected by multiple firewalls. In addition each server/desktop has it’s own firewall enabled.

There was also a great deal of discussion about the tools Eseri applications and how these applications are upgraded. There was much interest in this area since some of the applications that Eseri provides (i.e. Drupal) have complex upgrade paths.

OVSAGE’s next meeting is scheduled for July 17th.

Installing Oracle 11gR2 Enterprise Edition on Ubuntu 10.04 (Lucid Lynx)

I recently reformatted my laptop with the latest Ubuntu LTS release, 10.04, aka Lucid Lynx. Since I like to have a native client installation as well as a portable sandbox server, I decided to install the latest version of Oracle EE, 11.2.0.1.

Rather than re-invent the wheel, I’m going to direct you to the previous Oracle-on-Ubuntu post by my colleague Augusto Bott. Many of the directions there hold true here (even with 32-bit vs 64-bit), with a few exceptions.
Read the rest of this entry . . .

Blogrotate #25: The Weekly Roundup of News for System Administrators

Good evening and welcome to this weeks edition of Blogrotate. It’s a bit later than usual this week due to client concerns but I could not let this week go by without something. This week, after all, is the release of Ubuntu 10.04LTS (Lucid Lynx) so I get to leverage my supreme blogging power to promote the product since I use it pretty much everywhere now.

Operating Systems

So as I was saying, the release of Lucid Lynx has the world abuzz. We had a mini install fest here in the SA cluster at Pythian and 2/3 of it went well. It seems that video is the main source of install pain for us in this new version. Read the rest of this entry . . .

Blogrotate #24: The Weekly Roundup of News for System Administrators

Good afternoon and welcome to another edition of Blogrotate. Though I have been contributing to Blogrotate since its inception, this is the first time I have had the honour of posting it myself. Go me!

Operating Systems

Red Hat has announced the availability of a public beta for Red Hat Enterprise Linux 6 (RHEL 6). There are a number of changes, for which Dave Courbanou at The VAR Guy does a pretty good job of providing an overview. Read the rest of this entry . . .

Installing TOra with Oracle Support on Ubuntu 10.04 (Lucid Lynx)

Once again into the breach. The release of Ubuntu 10.04 is at hand. I’ve been playing with “Lucid” for a couple of months now but since we’re in beta2 with the release candidate soon to follow, I thought I would really sit down and get my normal app stack working including TOra. All in all the instructions are mostly the same as last time around, with a couple of new improvements, caveats and quid pro quo.
Read the rest of this entry . . .

Blogrotate #16: The Weekly Roundup of News for System Administrators

Welcome to another edition of Blogrotate. This has been an interesting week in the IT world, with Microsoft security issues being the major focus of attention.

Security

Once again, security flaws in Microsoft Operating Systems caused major problems for system administrators this past week. It began with Microsoft’s Security Response Center’s posting of February’s security bulletin.

Microsoft’s attempt’s to fix a 17-year-old bug resulted in a large number of computers having problems restarting. More information can be found here Restart issues after installing MS10-015 and Security patch results in BSOD, stops Windows from booting. It appear that this issue may have been caused by machines being previously infected by a rootkit

Another patch from Microsoft, the reliability update for Windows 7 and Windows Server 2008 R2, turned out to be not so… reliable.

But what was of most concern to many system administrators was Microsoft’s security advisory concerning a vulnerability in the TLS and SSL protocols, since this affects not only the Microsoft Windows operating system but as TLS/SSL are an Internet standard, multiple vendors. Emil Protalinski at Ars Technica provides full coverage of the TLS/SSL flaw in Windows.

Read the rest of this entry . . .

MySQL on Debian and Ubuntu

Debian Linux (the underlying foundation of Ubuntu) manages the startup/shutdown of MySQL quite differently from the ways I am used to. I am a long-time user of both the MySQL binary provided by Red Hat/SuSE (along with Fedora and clones like CentOS and Oracle Enterprise Linux) and the official binary from mysql.com. After the successful restore of a cold backup, I started mysqld using the Debian provided init script. The script said that mysqld failed to start up, but in reality it did start up. Similarly, stopping mysqld fails.

The output below demonstrates the outputs and the behavior seen on a Ubuntu 8.04 LTS Server: Read the rest of this entry . . .

Blogrotate #4: The Weekly Roundup of News for System Administrators

Welcome to the all hallowed eve eve edition of Blogrotate. It was a relatively quiet week this week but the 2 standouts are from the OS department with more reviews of the just released Windows 7 and the release of Ubuntu 9.10. Here’s some of the stories that we took note of this week.

Operating Systems

Ubuntu 9.10 is released. Anyone who reads my blogs knows by now that I am a Kubuntu user and I think that it’s the best desktop Linux available right now. They’ve put a lot of work into this one and it’s the best version of Ubuntu yet, easy to install and use with all the features you could ask for. Ryan Paul at Ars Technica has his own review called Ubuntu 9.10 brings web sync, faster bootup, GNOME 2.28, check it out.

Read the rest of this entry . . .

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @FN_Press2: Schooner Information Technology Teams with Pythian to Deliver Advanced Support and High... http://finanznachrichten.de/20
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more