Sybase Adaptive Server Enterprise / SQL Server HOWTO
Prev |  | Next

# 2. Installation

The different versions of ASE for Linux that are available have slightly different installation and configuration procedures. The installation documents that come with the product are quite detailed so I will instead try to focus on some alternatives in order to avoid common problems. In particular, I will describe how to install without RPM since the RPM utility is a functionality unique to Linux and most Sybase DBAs with background from other types of UNIX prefer to avoid this format and use the traditional installation instead. However, I will also describe how you can play it safer when using RPM.

## 2.1. Super-quick RPM installation for the impatient

If you are just doing a test, simply install the `sybase-common` and `sybase-ase` RPMs using rpm -ihv as root. The installation should then create a sybase user and start the configuration scripts automatically. For version 11.0.3.3, only the `sybase-ase` package is needed.

    bash$ su - root
    Password:
    bash# rpm -ihv sybase-common-12.5-1.rpm sybase-ase-12.5-1.rpm

I strongly recommend that you read through any text files shipped with the software (`README` for instance), and also the documents "Release Bulletin" and "Installation Guide" available on the Sybase documentation website (also known as SyBooks). These will contain lots of important information, and I have attempted to avoid duplication of those efforts as much as possible.

## 2.2. Pre-install Steps For All Installations

1. The first thing to check is whether your Linux installation is able to run the version of ASE you have selected. The RPM utility will attempt to check this during installation, but you can check the dependencies in advance with rpm -qRp <package>. RPM will check against the RPM database of installed products on your machine, if these have lower version numbers than the requirements you will get an error message and it is first necessary to update these packages to be able to install. Note that you will also get an error if the package name is not found in the RPM database. This can happen if you installed software without using RPM (e.g. compiled from source, not SRPMs) or the package has a different name from what the ASE packages list as dependencies (e.g. RedHat places the Linux kernel in a package named "kernel", SuSE uses k_deflt for the default kernel and other names for other supplied kernels such as k_smp). You can then check the kernel version with uname -r and the glibc version will most likely be what is reported by ldd --version, but also do ls -l /lib/ and check the actual filenames that the symlinks `/lib/libc.so`, `/lib/libpthread.so` and `/lib/librt.so` link to.

   | Certified OS levels

   The distribution Sybase has chosen to certify on is RedHat. For installation of 11.0.3.3 or 11.9.2 you can probably use any distribution, for the newer enterprise features of 12.5.0.x you will have to check exactly which distribution is certified and only use that particular Linux distribution and release level. Don't expect anything else than the certified OS level to work. The installation document lists the minimum required kernel and glibc versions.

   | Glibc-specific issues

   There are some known issues with glibc that cause serious problems with ASE. Basically, you will see this as a Segmentation Fault when starting the server (the error log will say something about process infected with signal 11 and then dump out a stack trace.). These problems are seen above version 12.5.0.1 on any uncertified platform, including currently RedHat 9.0. You must use a certified Linux distribution and version (RedHat 7.2, RedHat Advanced Server 2.1) and make sure the proper fixes are in the i686 glibc libraries (update them from RedHat Network). In particular, at the time of this writing the current ASE version (12.5.0.3) does not work on the current RedHat version (9.0) - nor on the beta of the next Enterprise Server (3.0) due to glibc issues! RedHat is working on this, and the release of Enterprise Server should be in order. See RedHat bugs 90002 and 102995 as well as the research done by Sybase under CR 326398. Hopefully this will eventually trickle up to the FSF/GNU distribution point for glibc and then to the various other distributions.

2. Check the available disk space. You will initially need space for installing the binaries and for installing the system databases. This is listed in the Installation Guide, but you will need additional space for the databases you create and you will have to make some estimates of how much you need for this.

   Table 1. Default Installation Directory

   Version | Minimum RAM Dedicated to ASE | Application Disk Space | System Database Devices
   --- | --- | --- | ---
   11.0.3.3 | ˜15 MB | 110 MB | 17 MB master 12 MB sysprocsdev
   11.9.2.x | ˜32 MB | 140 MB | 25 MB master 45 MB sysprocsdev
   12.5.0.x | ˜50 MB | 215 MB | 30 MB master 100 MB sysprocsdev

3. After checking that ASE can be installed, create the sybase user group and then the sybase user as a member of it. This is an ordinary user that will be used mainly for starting the database server, so the user has to own all the ASE-related files. I suggest you keep the home directory of this user together with the home directories of other normal users, instead of using the installation directory of the ASE software as a home directory. Use adduser, useradd or whatever GUI utility your distribution provides you with.

       bash$ su - root
       bash# groupadd sybase
       bash# useradd -g sybase -d /home/sybase -c "Sybase ASE DBA account" -p Hard2Guess sybase

   The installation scripts will not attempt to create the user if you have done so yourself first.

Once these steps are done, we are ready to unload the software onto the base directory that ASE will be installed in. By default, the RPM packages are configured to place this under `/opt/`<sybase-directory>`` where <sybase-directory> is:

Table 2. Default Installation Directory

Version | Directory
--- | ---
11.0.3.3 | /opt/sybase/
11.9.2.x | /opt/sybase-11.9.2/
12.5.0.x | /opt/sybase-12.5/

You can choose a different location if you like, either with the `--relocate` parameter to rpm, or by unpacking to a different directory if you are converting to .tgz file first. Again, I recommend keeping a normal home directory for the sybase user, a directory for the ASE software and a third location for the database storage.

## 2.3. Unloading the Software to Disk, Part 1: Making Some Considered Decisions

After preparing the environment, it is time to write the software to disk. You can either install with RPM or convert the RPM packages to another format first. These options will be covered here, and why you would want to choose one or the other.

### 2.3.1. The issues with RPM and how to avoid them

So, why is RPM bad? Well, as long as you install the latest ASE patches on the latest working RedHat version with the latest patches you may not have a lot of problems. However, you may also find that the RPM installations will cause the following problems depending on exactly which version of ASE (or EBFs) you are installing on which RedHat version (or other distribution).

Known Problems with RPM and Their Workarounds

Problem: RPM installation of ASE or applying EBFs will truncate the `/etc/ld.so.conf` file.

  Symptom: After RPM installation of ASE if will truncate your `/etc/ld.so.conf` file to 0 bytes, making your OS installation forget where shared libraries are found. This may affect X, sshd and several others.

  Caused by: the post-install scripts. You can view them with rpm -qp -scripts `<package>`. They try to use a varaible named `$RPM_INSTALL_PREFIX` which is apparently not set by newer versions of the RPM utility.

  Kludge 1: first copy all the files that will be destroyed by the installation. `/etc/ld.so.conf`, `.profile` and `.cshrc` for the sybase user should be copied to a safe place before installing. Then install as per the Sybase instructions and copy the files back when you are done. When the correct `/etc/ld.so.conf` is in place, run ldconfig as root.

  Kludge 2: First set the `$RPM_INSTALL_PREFIX` to the top-level directory where the ASE files are to be installed (what will become `$SYBASE`).

  Kludge 3: Make RPM install without running the scripts; rpm -ihv --noscripts

Problem: .profile and .cshrc overwritten

  Symptom: RPM installation will overwrite the `.profile` and `.cshrc` files in the $SYBASE directory. If this is the home directory of the sybase user and you have personalized these to include preferred settings you will have to rewrite them afterwards.

  Caused by: The files are located in the $SYBASE/install/ directory in ASE 12.5. The script $SYBASE/install/sybinstall.sh which is called during RPM installation will copy these to $SYBASE.

  Kludge 1: Backup these files before installation, copy back after installation is done.

  Kludge 2: Make RPM install without the scripts; rpm -ihv --noscripts

  Kludge 3: Create a home directory ($HOME) for the sybase user separate from the installation directory ($SYBASE).

Problem: RPM claims that installed libraries or even the kernel are not of the approved version or not installed.

  Problem: RPM installation reports that certain versions of OS rpms such as kernel or glibc must be installed, but you verify they are OK.

  Caused by: RPM installations may fail if it is unable to determine whether you have the proper versions of kernel and glibc installed. For instance, SuSE calls its default kernel rpm package "k_deflt", other kernels are named after their main functionality (smp, athlon etc.). The Sybase RPMs search for "kernel" since that is what RedHat uses.

  Kludge:Make absolutely sure you do actually have the required level of these packages. Then force-install with rpm -ihv --nodeps --force.

## 2.4. Unloading the Software to Disk, Part 2: Getting the Job Done

Unless the above problem descriptions scared you, you may want to use RPM with a few extra modifications. Instead of letting RPM try to be helpful but end up causing trouble, we will disable the friendly attempts and have to do some manual corrections ourselves afterwards.

### 2.4.1. The Manual RPM Installation

Just to be on the safe side, we first copy out the files that are at risk; `/etc/ld.so.conf`, `<sybase user home>/.profile` and `<sybase user home>/.cshrc`. The switches I have chosen to add are:

--relocate
--nodeps
--noscripts

Now, mount the CD or download the files with FTP and cd to this directory. As root, install the files with:

    rpm -ihv --relocate /opt/sybase-12.5=/opt/sybase --nodeps --noscripts sybase-common* sybase-ase*

As part of the server configuration we now need to make the changes we disabled when we stopped the RPM scrips from excuting using the `--noscripts`.

### 2.4.2. Using the RPM Alternatives

A couple of common utilities for installing without RPM are rpm2tgz and alien. You can use any of these to first convert into a tgz package and then unpack the files without running any of the RPM scripts. The distribuiton of the RPM utility also ships with a program called rpm2cpio which will convert to a cpio archive.

- alien: http://www.kitenet.net/programs/alien/

- rpm2tgz: This is apparently the name of a utility shipped with Slackware and TurboLinux. The TurboLinux files indicate that it is simply a wrapper for rpm2cpio and cpio2tgz, the latter of these will actually unpack the cpio archive into a temporary directory and repack it as tgz.

- rpm2cpio: This is part of the RedHat Package Manager (RPM) distribution so it should be installed if you have rpm installed. You will need cpio together with it.

The alien utility can either unpack the rpm using alien -g, or you can create a tgz archive with alien -t.

    bash$ su -
    Password:
    bash# alien -t sybase-ase*.rpm sybas-common*.rpm
    sybase-common-12.5.tgz generated
    sybase-ase-12.5.tgz generated

The rpm2tgz utility does the same thing, converts the rpm into a tgz archive.

    rpm2tgz sybase-ase*.rpm
    rpm2tgz sybase-common*.rpm

The distribution of RPM contains the rpm2cpio utility, it reads an rpm from a file or STDIN and outputs a cpio archive on STDOUT.

    rpm2cpio sybase-ase-12.5-3.i386.rpm > sybase-ase-12.5-3.i386.cpio
    rpm2cpio sybase-common-12.5-3.i386.rpm > sybase-common-12.5-3.i386.cpio

Once you have created a .tgz archive from the RPM, you can unpack it. Since the path in the archive is relative to /, you need to do this as root.

    bash$ su -
    Password:
    bash# tar -xvzf sybase-ase*.tgz
    bash# tar -xvzf sybase-common*.tgz

For a cpio archive, unpack it with the cpio command:

    cpio --extract --make-directories --verbose

Prev | Home | Next
Introduction |  | Configuring an ASE Server