Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Wednesday, September 23, 2009

PostgreSQL as in-memory database

I was reading a specifications of few in-memory databases (here and here). So I started to think how can I and can I use PostgreSQL as in-memory DB ...

Yes! This is possible!

There is one feature in PostgreSQL called "table space". You can register a folder from the file system as data storage. This is the basic procedure.

1. In this article Linux Memory/Temporary File System (FS) you can read how to mount a portion of the memory to a folder.
2. Using the "table space" feature of PostgreSQL to link this virtual folder in the server.
3. Create/Delete/Update tables!

This is it, sounds easy right ;)

But what is the practical aplication for this?
This table space can be used for cache or temporary data of any kind. This in my opinion will increase the speed of your applications.

In my next post I'll publish some speed tests.

Wednesday, May 27, 2009

Oracle XE + Ubuntu 9.04

The installation of Oracle XE on Ubuntu 9.04 was very easy. There is also very well done web based administration.
After installation I tried to connect with PHP to the server. And here is the first problem. There is no OCI8 or PDO_OCI extensions in the Ubuntu's repository.
I tried to compile both of this, but I was able to do this with OCI8 extension and not with PDO extension.
There is a problem with PDO dev files, for some reason configuration always ends with this error: "configure: error: Cannot find php_pdo_driver.h", searched google but with no success ... the file is there but configure is able to locate it.

After OCI8 extension I tried to to connect by sqlplus program: /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/scripts/sqlplus.sh
First try ended with this error: "TNS:net service name is incorrectly specified" the solution I found was to add two rows to /etc/profile:
export ORACLE_SID=PROD1
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

Now everything works!