Oracle STATSPACK Quick Reference

April 10 2012

Since most of our databases are not licensed with the Oracle Enterprise Manager Diagnostic Pack, we cannot use AWR (Automatic Workload Repository) and ADDM (Automatic Database Diagnostic Monitor). So we have to use the good old Oracle STATSPACK.

The goal of this article is to provide a quick reference for installing and maintaining STATSPACK for an Oracle database. It is based on the excellent “STATSPACK Survival Guide” of Akadia AG. If you need more information on STATSPACK, please refer to the Survival Guide or the Oracle documentation, since this article is only a really quick summary on how to install, configure and use STATSPACK. Read the rest of this entry »

Difference between DBA_TABLES.num_rows and count(*)

February 10 2012

One thing DBAs regularly do is to gather information on the schemas in the database for reporting. So we want to know how many rows there are in the tables of the schema “SIMON”. When doing so, one is tempted to query the DBA_TABLES view:

SQL> SELECT table_name, tablespace_name, num_rows
  2  FROM dba_tables WHERE owner='SIMON' ORDER BY num_rows DESC;

TABLE_NAME                     TABLESPACE_NAME                  NUM_ROWS
------------------------------ ------------------------------ ----------
HUGE_TABLE                     DZ_DATA01                         8227990
[..]

However, if we query the table directly, we get a different result:
SQL> SELECT count(*) FROM simon.HUGE_TABLE;
COUNT(*)
----------
8230310

Why is that so? Read the rest of this entry »

logrotate for the Oracle Listener

July 27 2011

When deploying a new database, one thing I usually do is to set up a logrotate configuration for the Oracle Listener log. The Oracle Listener logs every connection he makes and when using an Application Server to interface the database, this file can grow quite a bit. So we need to make sure that we properly rotate this log and compress the old logs.

Read the rest of this entry »

Linux RAMDISK with tmpfs

May 15 2011

The Linux kernel provides the tmpfs, which basically creates a file system in memory. This temporary file system can be used to store temporary data, such as caches or log files. Read more about tmpfs in the kernel documentation: tmpfs.txt

After reading this excellent article about using tmpfs in Linux, I decided to put it to the test. Even though the Linux kernel already does a good job caching files, I wanted to see the performance of this solution by applying different loads on it. For this, I am using the IOzone tool I already used for my ZFS tests (1) (2) and my Amazon EC2 IO test.

Read the rest of this entry »

Debian with a vanilla kernel

May 8 2011

So one might want to ask why you’d want to sacrifice the fantastic stability and openness of Debian to install a vanilla (= original) kernel (Debian currently has 2.6.32). There are quite a few reasons for doing so. For example, the current kernel (2.6.38) has TRIM support, which is something I am looking for when using SSDs. Also, maybe you want to have a bleeding edge kernel just for the fun of it. So lets get started.

Read the rest of this entry »

New Instance or New Schema?

December 20 2010

So when it comes to deploying a new application there is always the question if you should create a new instance on the database server or use the existing instance and just add a new schema? These both are valid options, but lets have a look at both options.

Read the rest of this entry »

RAID-Z vs. Hardware RAID 5

November 17 2010

Out of curiosity, I decided to run the IOzone tests I performed with a RAID 10 (see this post) on a RAID-Z and compare it to the RAID 5 of the hardware RAID controller. For this test, I am using IOzone and two older HP DL380 G2 servers.

Read the rest of this entry »

ZFS vs. Hardware RAID (RAID 10)

November 4 2010

As I am currently fiddling around with Oracle Solaris and the related technologies, I wanted to see how the ZFS file system compares to a hardware RAID Controller. The ZFS file system allows you to configure different RAID levels such as RAID 0, 1, 10, 5, 6. In this post, I want to test the RAID 10 performance of ZFS against the performance with the HP RAID Controller (also in a RAID 10 configuration) over 4 disks.

Read the rest of this entry »

Clever ToDo List

October 5 2010

Often, I find I have too many open tasks on my todo list. I then looked around for a clever way to organize my daily or weekly task list. Because first, I just kept my work journal up to date with all tasks and crossed off the tasks I completed. The process of crossing one task is extremely pleasant, but my eye immediately catches all these tasks I still have to do. That part of this method is not so great. But I think I found a pretty good way to prioritize my tasks

Read the rest of this entry »