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

PostgreSQL Administrator’s Cheatsheet

Most people start with free databases and eventually get to know the enterprise products. I started the other way around.

After being trapped for eight years in the Oracle world, I felt like exploring another database platform. For some reason I can’t get myself to fiddle around with MySQL. There’s nothing rational about this–no benchmarks, reviews, or co-worker horror stories. I feel it’s just not my type.

So when looking for free database, I reached out for PostgreSQL, again for no objective reason–only the gut feeling that this could be what I’m looking for.

Read the rest of this entry . . .

How to Recover Data from a Dead MacBook

This post might seem outside of our focus, but life brings all kinds of challenges. A friend of mine bought a MacBook when she was on vacation in the USA. For obvious reasons, Macs are more common on the other side of the Atlantic. In Europe it’s still rare to see a person using Mac as a personal computer (no flame intended, just stating a fact).

Her Mac completely broke down. The service guys told her she’d need to replace the motherboard, which would cost almost the same as a new computer. The problem was her Mac wouldn’t even start, and all the data she had on a hard-drive was stuck in the neat white box without any signs of life.

Sure, I said, I’m a computer guy I can recover it, can’t I?

I had never worked with Mac before, so I started with initial research to find out what options I have with hardware available in my home computer den.

I came to know that Mac uses filesystem called HFS+, and it can’t be read from Windows 32bit. Great, I thought, I’ve two options—find someone else with a Mac or get it mounted on Linux.

Fortunately, I have a Linux box at home, so it should be easy. I unscrewed the MacBook, and behind the battery there was 2.5 SATA drive. To be able to connect it, I need the interface between 2.5″ SATA drive and USB. For this purpose I’m using a QCP converter cable, which allows you to connect internal 2.5″/3.5″ ATA/SATA drives directly to USB port. (http://www.youtube.com/watch?v=NMtAPgcMtLQ) I really like this piece of hardware—it’s exactly the kind of gadget you want to have around for saving notebook drives.

After connecting the disk, I found that my OEL5.1 wouldn’t be friends with it. I simply couldn’t find the right hfsplus module for this distribution. Fortunately, there were many references about mounting hfsplus disks on Ubuntu Linux, which is my second system.

I downloaded the required package and dependency libraries for Ubuntu from here:

http://packages.ubuntu.com/dapper/hfsplus

The packages installation is straight forward:

root@silverbox:~# dpkg -i libhfsp0_1.0.4-10ubuntu1_i386.deb libc6_2.3.6-0ubuntu20_i386.deb hfsplus_1.0.4-10ubuntu1_i386.deb

After that, I needed to load the hfsplus module:

root@silverbox:~# modprobe hfsplus
root@silverbox:~# cat /proc/filesystems | grep hfs
        hfsplus

Next, I had to check which partition is the one I need to mount. For this purpose, I used parted:

root@silverbox:~# parted /dev/sdd
GNU Parted 1.7.1
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print

Disk /dev/sdd: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End    Size   File system  Name                  Flags
 1      20.5kB  210MB  210MB  fat32        EFI System Partition  boot
 2      210MB   160GB  160GB  hfs+         Untitled

Knowing the partition containing the data was /dev/sdd2, and I could mount it.

root@silverbox:~# mount -t hfsplus /dev/sdd2 /mnt/macosx
root@silverbox:~#

The next problem I faced was privileges. The directories I needed to save were owned by a non-existent user, and so I wasn’t able to access that path.

To work around this, I created a new user and assigned the directory owner UID.

root@silverbox:~# useradd macuser
root@silverbox:~# usermod -u 501 macuser

This allowed me to access the directory I needed to recover, and copy files to another ntfs disk which will be readable by regular Windows machine.

Oracle E-Business Suite: Querying Patches, Part 2

In the first part of this blog I tried to shed some light on EBS patch terminology and naming conventions. In this post, I’ll show you how to check your patchset levels and query applied patches.

The very first question is, how do I find out if patch “1234567″ for example, was applied?

Of course you can use OAM, as the current release has made a huge step in enhancing OAM to show all necessary information about applied patches. If, however, you don’t like to rely on the GUI, you have a number of other options, which I’ll show you here.

Essentially there are two tables one can use to check for applied patches: AD_BUGS and AD_APPLIED_PATCHES.

It is important to understand the difference between these two. AD_BUGS contains all bug numbers fixed on your system, while AD_APPLIED_PATCHES contains all patch numbers which were applied to your system only.

For example: if you apply 11.5.10 CU2, it will add a row with patch_name=3480000 to AD_APPLIED_PATCHES and it will insert thousands of entries in AD_BUGS (including 3480000).

Caveat: if you use merged patches, always check AD_BUGS.

So how do you query the above two tables? Read the rest of this entry . . .

Oracle E-Business Suite Patch Taxonomy, Part 1

E-Business Suite patching is very broad topic. I’m going to cover just a fraction of this vast theme, one that I believe is often overlooked. I decided to split it into two logical parts.

Part 1) Oracle E-Business Suite patch terminology

  • patch type hierarchy
  • patch naming convention
  • naming differences between 11i and R12

Part 2) Querying patches, patchsets, family packs

  • how to check if a patch was applied
  • what patchset am I on?
  • what family pack am I on?
  • is there a newer patchset/family pack?

This blog could also be called “Oracle EBS patch evolution theory.” Like any other theory, it can be challenged and proven wrong. I tried to make it unbiased based purely on my experience and to present it in the way that makes sense in context of general patching activities.

Patch hierarchy in 11i

EBS patch taxonomy consists of a number of species. Here is a list of those which I recognize to be valid in the long-term. The exact naming may vary over the years, but the names used here are as they are commonly understood by Apps DBAs.

Read the rest of this entry . . .

Killing an Oracle Job Dead

If you ever thought it was easy to kill an oracle job, let me show you something that gave me a headache today.

We’re testing an application that uses custom code to de-queue and propagate AQ messages between databases. There are nine processes in total, and all of them are submitted as jobs using DBMS_JOB. They are supposed to run all the time, waiting for messages to de-queue. Once in a while, I need to kill them in order to recompile the objects they are executing.

The steps are simple enough: remove/break all jobs in question, kill the jobs that are running, recompile the packages with new the version, and submit/un-break the jobs again. This time, however, things were not going as smoothly as I expected. Let’s have a look.

First I remove all the currently running jobs:
Read the rest of this entry . . .

Hitting Oracle with a Hammer

Recently, I had an opportunity to participate in a stress-testing exercise. By stress-testing, I mean simulating an expected peak load on the database and observing how the database performs. The objective is to make sure the particular hardware can handle the expected load and also to test where the physical limit of the machine lies if we keep increasing the number of concurrent users.

I searched for tools available out there. On forums, most people were talking about Hammerora, and although some people recommended high end tools for big bucks, I decided to try this free tool that promised to do exactly what I needed it to do. The open source Hammerora turned out to be excellent tool for the purpose of simulating a typical transactions load in any number of threads. It’s built with the Tcl scripting language and it can simulate a real workload with as many client user sessions as your system can handle.

So if you’re looking for an easy way to measure throughput performance of your database, keep reading.

Read the rest of this entry . . .

UKOUG 2008 highlights

Tonight I returned from my first UKOUG conference. I’ve been to smaller conferences like Microsoft Technet and big ones like European Oracle Open World before, but this was without a doubt best one so far (measured by the value of content and amount of fun).

I couldn’t attend all the sessions that aroused my interest, there were simply too many of them. From those I attended, there are few I’d like to mention as highlights of the conference.

Tom Kyte and his “Best way…” was one of the most entertaining sessions and at the same time, one of the most educational. James Morle and his view of the current state of storage devices was also one of the very strong ones in both perspectives.

Read the rest of this entry . . .

Installing Oracle R12 EBS in my Living Room

I decided to build my first sand box ever. I always wanted one, but there was no time or reason until now. Fortunately, hardware is ridiculously cheap these days compared to the past, so you can actually run full-blown Oracle Applications on your home PC without compromises.

I built a Dual Core box with 8G of RAM for an install of E-Business Suite R12. For OS I chose Oracle EL5U2, mainly because I’m used to the RH/OEL clones, and also because I expected it to be less painful than other distributions.

I started slowly, as time allowed, spending some time chasing various libraries and packages on the Net. Eventually it took me a week to realize how tedious it is to go the manual way. I got so frustrated by the dependencies that I gave up and purchased access to the ULN network.

Just to illustrate the type of struggle I went through, I found four distinct lists of required packages for 10g installation (in Oracle documentation and metalink combined). I’d recommend Note 421308.1 – Requirements For Installing Oracle10gR2 On RHEL/OEL 5 (x86_64), which summarizes the database part in a neat way. I also encourage you not to underestimate requirements of related Note 376183.1 – Defining a “default RPMs” installation of the RHEL OS.

Nevertheless, it’s just way more easy to use the oracle-validated package, which will download all dependencies for you. Well, almost all.

The next step was to prepare the machine. The only tricky part (from the DBA point of view) is to setup a DNS server, but even that went well. There are plenty of nice howtos on the web — search for keyword “rndc”.

Once I had all the required packages installed, users created, kernel parameters set, domain name resolution working, and Xvnc started, it was time to call a wizard.

Read the rest of this entry . . .

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

Live Updates

pythian: RT @sheeri: #confoo talk "Bending Queries to your Will with EXPLAIN" slides http://bit.ly/explainslides & handout
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