HOWTO: Install SAP Sybase ASE 15.x and Linux Containers (LXC) – Ubuntu Server 13.04

Requirements:

Host OS:

  • Ubuntu Server 13.04 x86-64 (64bit)
  • At least 4GB RAM
  • 300GB available disk space

Sybase Patches:

  • If you’re going to run 32bit SQL Anywhere (or an embedded RSSD with Replication Server), you need to apply a SQL Anywhere patch: http://search.sybase.com/kbx/changerequests?bug_id=694479

Install LXC and the bridge-utils to support a network bridge:

aptitude install lxc debootstrap bridge-utils

Create the network bridge br0:

cd /etc/network

Edit interfaces:
replace:

  auto eth0
  iface eth0 inet dhcp

with:

  # LXC bridge
  auto br0
  iface br0 inet dhcp
      bridge_ports eth0
      bridge_stp off
      bridge_fd 0
      bridge_maxwait 0

  auto eth0
  iface eth0 inet manual

Restart networking:

service networking restart

Create lxc-default-sybase Apparmor profile:

cd /etc/apparmor.d/lxc
cp lxc-default lxc-default-sybase

Edit lxc-default-sybase:
replace:

  profile lxc-container-default flags=(attach_disconnected,mediate_deleted) {

with:

  profile lxc-container-default-sybase flags=(attach_disconnected,mediate_deleted) {

replace/add only if using you’re using LXC version LOWER than 0.7.5-3ubuntu60 – see LXC bug 1021411:

   deny @{PROC}/sys/kernel/** wklx,

with:

   deny @{PROC}/sys/kernel/(^shm)** wklx,

Update the kernel with the new lxc-default-sybase profile

apparmor_parser -r /etc/apparmor.d/lxc-containers

Replace /etc/lxc/lxc.conf with:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

# cap the memory available to the container
lxc.cgroup.memory.limit_in_bytes = 2G

Assuming that volume group VG02 exists, let’s create the container with the name of “sybase”, and a logical volume of 100G using the xfs file system:

lxc-create -n sybase -t ubuntu -B lvm --lvname sybase --vgname VG02 --fstype xfs --fssize 100G

Before we start the ‘sybase’ container, we need to update the container configuration to use the lxc-container-default-sybase container:

cd /var/lib/lxc/sybase

Edit config:
replace:

  #lxc.aa_profile = unconfined

with:

  lxc.aa_profile = lxc-container-default-sybase

We’re ready to start the container in console mode (to start it as a daemon add -d):

lxc-start -n sybase

The default login credentials are ubuntu / ubuntu

Let’s switch to root so we can install the packages to support Sybase ASE 15.7:

sudo su - root

Enable up to 512MB of shared memory:

echo "kernel.shmmax = 536870912" >> /etc/sysctl.conf
sysctl -p

Install the packages (nmon is a great os monitoring tool but if you don’t want it, don’t include it):

dpkg --add-architecture i386
apt-get update
apt-get install ia32-libs
apt-get install aptitude libaio1 xauth ia32-libs libstdc++5 nmon ncompress

If you want to install PPA repositories:

apt-get install python-software-properties

We need to set up the locale:

locale-gen en_US.UTF-8
echo 'LANG="en_US.UTF-8"' > /etc/default/locale

Copy the sybase software to your new Linux Container and extract it into a temporary directory.

Because Ubuntu seems to think that gzip can uncompress files compressed with the ‘compress’ command (it really can’t btw), you need to alias the uncompress with /usr/bin/uncompress.real:

alias uncompress='/usr/bin/uncompress.real'

From here, you would install and configure Sybase ASE 15.x as you normally would.

Determine ip address for eth0:

ifconfig|grep "inet addr"

In my case, the eth0 ip address is 192.168.0.115. You will either want to reserve this address with your DHCP server or setup a static ip in /etc/interfaces.

Assuming we want to keep the 192.168.0.115 address for this container, we need to modify the /etc/hosts file:
Replace:

  127.0.0.1 localhost sybase

with:

  127.0.0.1 localhost
  192.168.0.115 sybase
Share Button

How to install PostgreSQL 9 on Ubuntu Linux 10.04/10.10

Very easy, just add a repository and run apt-get install postresql-9.0 🙂

Dctr Watson explains how:

Installing PostgreSQL 9.0 on Ubuntu 10.04

Share Button

Get your Sybase ASE 15.5 MDA table posters! Straight from Sybase’s Jeff Tallman

I asked Jeff Tallman if I could redistribute his excellent MDA posters for Sybase’s ASE 15.5 database server.  He said yes so …  here they are in both Adobe PDF and Sybase PowerDesigner PDM formats!

Jeff Tallman also provided us with the MDA posters for Sybase 15.0.3 last year.

Share Button

So you want to tweet to Twitter from *WITHIN* Oracle 11g? Here’s how!

Lewis Cunningham Twitterhas once again given us a gem from the world of Oracle’s relational DBMS!  This time, he has written ORA_Tweet, an API to send/receive Tweets (microblog posts) from within Oracle 11g.  Major kudos to Lewis Cunningham for writing and releasing ORA Tweet to Sourceforge.net 🙂

Call the Twitter API from within an Oracle database. ORA_Tweet uses the UTL_HTTP API within Oracle to call the update_status API. It is written completely in PL/SQL.

So, my question is…  Will someone write a Flickr API for Sybase ASE?

Share Button

Borderline Scamming being done by software companies

The latest craze from software vendors to companies is to charge for each and every core a machine has regardless of whether or not you’re going to use it.

Get this, if you want to buy a production license for your database/middleware/web server, the vendor (starts with an “S”) wants you to send them the hardware specs of the box.  If you tell them it is a Dell superduper server with 8 quad core CPUs and 96GBytes of RAM but you only will be using a single core for the database and devoting the rest to the middleware/webserver, you STILL have to pay the vendor for all 32 cores (8 CPUs X 4 cores).  Your software license costs is now 32 times MORE what you should have to pay IMHO.

Lots of software companies are now doing this anti-customer practice just to beef up their short term revenues.

What makes them think that you won’t go to another vendor?

  1. Their competitors are probably doing the same sales tactic
  2. They have you by the family jewels, vendor lock in, and it will cost you far too much $$$ to migrate
  3. They think that you’re too stupid and/or timid to call their bluff
  4. FUD that is spread by well meaning and well known folk that don’t know jack about the open source alternatives

Who the hell do they think they are?

Share Button

FW (David Wein): Looking for feedback: logical process manager

David Wein is a well known and highly respected engineer at Sybase working on Adaptive Server Enterprise.  I’m reposting his blog article here to help increase the exposure of his request for comments:

I am working on a future version of ASE and am interestedDavid Wein, Sybase Engineering in hearing about your experiences with the logical process manager (LPM).  LPM consists of engine groups and execution classes, as well as the ability to set spid priority in an ad-hoc manner via sp_setpsexe.  This functionality is sometimes referred to as application queues.

If you have used this feature I’d like to know:

  • What was the use case (in other words, why did you use it)?
  • What elements did you use?  How did you use it?
  • Did it meet your needs?  Did you run into problems?
  • Any shortcomings or requirements that weren’t met?
  • What was your overall impression?

If you evaluated the functionality but chose not to use it, please let me know what you were trying to accomplish and why you decided against using LPM.

Finally, if you have use cases or requirements around managing multiple applications in a single ASE server, or managing the priority / resources of specific spids, please pass those along.  Unaddressed use cases are extremely useful to hear about.

Please provide your feedback directly to me at david.wein@sybase.com, and include “logical process manager feedback” in the mail subject (I get a lot of mail and this will help make sure I don’t miss your mail!).  Please be as detailed and specific as you can about your use cases and results.

Thanks a bunch,
Dave

Let’s help Dave, and ourselves, out by giving him our experiences with the logical process manager.  Please be descriptive as “it sucks” or “it’s great” doesn’t really help. 😉

If anyone wants to post their experiences to this blog post, that’s okay too.  I’ll forward any comments to Dave.

Share Button

Multicore processors and Sybase ASE: Jeff Tallman

When T V S Murty asked on the sybase-l mailing list about Sybase ASE, multicores and Sybase licensing, the discussion quickly drilled down to whether or not multicores were beneficial to Sybase ASE and database software in general. Jeff Tallman, of Sybase fame, described in detail how Sybase ASE and multicore processors relate to each other.

From: Jeff Tallman <tallmanATsybaseZeDOTcom>
To: sybase-l@lists.isug.com
Subject: [sybase-l] – RE: Multicore processors and ASE

As always a lot depends on the application profile.   Something to consider for any multicore processor are factors:

  1. The number of FPU units per chip (FPU = Floating Point Unit)
  2. The number and capacity (in IOPS) of IO processors per chip
  3. The type of chip multi-threading

With respect to #1, most DBMS (at least the commercial ones) use statistics for query optimization – so while the actual query processing doesn’t use a lot of FPU instructions (assuming a minimum of float datatypes, etc.).  Each query requires a pretty good smack of the FPU time to do the floating point math on the stats.  The impact of this could be lessened by doing statement caching or fully prepared statements…or other means at reducing the optimizer load.

The second problem is one of capacity vs. bandwidth.   All network and disk IO obviously need to use the IO processor.   With 4 dual core chips, usually, you have 4 IO processors.

With a single chip with 8 cores, it is likely that you will have only a single IO processor.   The single IO processor has 8 cores all making requests.  The number of IO operations per second it can handle becomes a real key factor in the box’s scalability.

The chip multi-threading is an interesting issue as there are ~3 different flavors today:

  1. Intel’s Hyperthreading (no longer implemented on XEON and I don’t think implemented at all anymore)
  2. Sun’s Chip Multi-Threading (CMT)
  3. IBM’s SMT

Some instructions require multiple cycles to complete due to they are waiting on a fetch from main memory or whatever.   The thread/process of execution typically blocks in these cases, resulting in a fairly idle core.   By making use of this idle time, CMT or SMT can increase the throughput overall — ignoring HT as it was fairly ineffective at this – and appears to have been dropped by Intel lately.

The question that comes up is how do you manage the threading?  Do you do a form of timeslicing (i.e. when you suspend on process that is blocked on a call, do you let the one that replaced it run for a certain length of time or until it blocks before returning back to the original) or do you do an interrupt based/preemptive mechanism in which when the blocked call returns, that you suspend the other thread?   Both have advantages and disadvantages, and do allow more engines than cores.

However, it may also mean tuning ASE to be more reactive, such as reducing the ‘runnable process search count’.  You also need to be careful that engines running on CMT’s don’t get woken back up on another core (especially if the L2 cache is split between the cores) as well as other considerations.

A rule of thumb to think about is that if you have a multi-core CPU that supports chip threading, if you have a lengthy list of SPIDs in a ‘runnable’ state, enabling extra engines on the threads will likely help.   If you don’t – i.e. you are IO bound – that it probably won’t help.

Currently, Sun uses a timeslicing mechanism that is more along the lines of ASE’s SPID management – and as a consequence, it shows scalability when the various tasks do a lot of blocking calls such as fetches from main memory.  It does have the detrimental effect of only providing a percentage of cpu time to the ASE engine (i.e. 25% when 4 threads per core).   The more parallelism is used within your application, such as higher numbers of concurrent users in ASE, the more it can be distributed across the engines.

You have to be careful as net engine affinity and short query’s (i.e. DML).  They can have a negative impact, which may be controllable using engine groups.   Overall, a cpu-intensive/cpu bound application can benefit from the Sun CMT implementation.  An IO bound application does not.

Share Button

The first issue of “My Databases” coming next week!

As many of you know, I’ve been working on a free magazine regarding various database systems (dbms) called My Databases.  I hope to have multiple authors in future issues covering all sorts of open source and proprietary databases.

I should have the first issue done Sunday night.  I’m using OpenOffice, Scribus, Gimp, and Inkscape.

Share Button

Sybase ASE 15.0.2 MDA Poster!

Thanks goes to Jeff Tallman for creating the Sybase ASE 15.0.2 MDA poster. Don’t forget to check out the legend for the poster as well!

Share Button

Virtualization and Databases

In Chris Brown‘s Virtualization and ASE blog post, he brings up the question of whether Sybase’s ASE can be used in a virtual environment (VMWare, Xen, etc) but doesn’t answer it. I’ve been using various databases in virtual environments for several years, here is what I found out:

Running ASE, ASIQ, or SQL Anywhere under virtualization software such as Xen, VMWare, Parallels, etc is very useful under a number of situations:

  1. development of new applications – each developer group can have its own “db server” on the same machine
  2. testing new ebfs/releases with your applications
  3. reproducing problems either in the sybase software or in the application code – a ‘virgin’ instance that can be duplicated at will
  4. trying out new operating systems (moving from Windows to Linux or Windows to Solaris x86?) without investing in new hardware

The main caveat is that the performance stinks – databases typically require high disk i/o, memory i/o and cpu responsiveness. The virtualization software currently available, even with hardware help (newer Intel,AMD chips), are not up to the task of running a *production* database.  In a couple years… possibly.

Share Button