Jason L. Froebe – Tech tips and How Tos for Fellow Techies

Tips & Tricks for Databases (Sybase, Oracle, MySQL, PostgreSQL, SQLite), Windows, Linux, Solaris, Perl, Java, Bash and so much much more

HOWTO: Installing and running SAP / Sybase SQL Server 11.0.3.3 esd 6 on Ubuntu Linux using KVM

by Jason L Froebe on March 10, 2013, 2 comments

You can run KVM on just about any modern Linux distribution provided that your host is capable of providing virtualization. The folks over at HowtoForge go through the steps for Ubuntu 12.10.

What you will need for the KVM virtual machine:

  • Ubuntu Server 6.06.2 for Intel x86
  • Sybase SQL Server 11.0.3.3 esd 6 for Linux 32bit (if anyone knows of a location to legally download these let me know)

I used virt-viewer to create the virtual machine but you can create the xml file yourself if you want to. Make sure you specify:

  • Disk bus: IDE using native threads and no caching
  • 1GB of RAM or more
  • VNC or Spice display

my Sybase_11033.xml file:

<domain type='kvm'>
  <name>Sybase_11033</name>
  <uuid>85ffed98-fd6e-8475-37b0-219359c89c25</uuid>
  <description>Sybase SQL Server 11.0.3.3 on Ubuntu 6.06.02 (Dapper Drake)</description>
  <memory unit='KiB'>1048576</memory>
  <currentmemory unit='KiB'>1048576</currentmemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.2'>hvm</type>
    <boot dev='hd'></boot>
  </os>
  <features>
    <acpi></acpi>
    <apic></apic>
    <pae></pae>
  </features>
  <clock offset='utc'></clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='threads'></driver>
      <source file='/var/lib/libvirt/images/Sybase_11033.img'/>
      <target dev='hda' bus='ide'></target>
      <address type='drive' controller='0' bus='0' target='0' unit='0'></address>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'></driver>
      <source file='/home/jason/iso/ubuntu-6.06.2-server-i386.iso'/>
      <target dev='hdb' bus='ide'></target>
      <readonly></readonly>
      <address type='drive' controller='0' bus='0' target='0' unit='1'></address>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'></address>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'></address>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'></address>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:59:e1:78'></mac>
      <source bridge='br0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'></address>
    </interface>
    <serial type='pty'>
      <target port='0'></target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'></target>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'></target>
      <address type='virtio-serial' controller='0' bus='0' port='1'></address>
    </channel>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' autoport='yes'></graphics>
    <video>
      <model type='qxl' vram='65536' heads='1'></model>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'></address>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'></address>
    </memballoon>
  </devices>
</domain>

Go through the install of Ubuntu Server 6.06.2. After it is completed, you will need to modify a few files:

Replace /etc/apt/sources.list with:

deb http://old-releases.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install alien

Modify /boot/grub/menu.lst adding elevator=deadline:

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
 defoptions=quiet splash elevator=deadline

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title		Ubuntu, kernel 2.6.15-51-server
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.15-51-server root=/dev/hda1 ro quiet splash elevator=deadline
initrd		/boot/initrd.img-2.6.15-51-server
savedefault
boot

Modify /etc/fstab to increase the size of tmpfs and to set noatime,nodiratime:

/dev/hda1       /               ext3    rw,async,noatime,nodiratime,errors=remount-ro 0       1
tmpfs		/dev/shm        tmpfs   size=900M   0 0

Modify /etc/sysctl.conf to set up the shared memory and virtual memory settings:

vm.overcommit_memory=1
vm.swappiness=5
kernel.shmmax=1073741824
kernel.shmall=1073741824

OPTIONAL: Install samba and winbind so you want to connect to your vm by name but don’t want to set up dns:

sudo apt-get install samba winbind

Modify /etc/nsswitch.conf:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns mdns wins
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

OPTIONAL (needed for samba/winbind) Modify /etc/samba/smb.conf:

# add netbios name
netbios name = sybase-11033
# modify name resolve order
   name resolve order = bcast lmhosts host wins

*RESTART* the VM

Convert the Sybase RPMs to debian packages (dpkg):

sudo alien -d *.rpm

Install Sybase SQL Server:

sudo dpkg -i *.deb

This will install the software into /opt/sybase.

Add a sybase os user and change the owner of /opt/sybase to the sybase user:

sudo adduser --home /opt/sybase --shell /bin/bash --no-create-home sybase
sudo chown -R sybase:sybase /opt/sybase

I created a /opt/sybase/.bash_profile script but you can also put this in /etc/profile if you wish:

export SYBASE=/opt/sybase

export SYBPLATFORM=linux
export LD_LIBRARY_PATH=$SYBASE/lib
export LC_ALL=default
unset LANG

export PATH=$SYBASE/bin:$PATH

Start the Sybase configuration by running as the sybase user:

$SYBASE/install/sybinit

I would recommend a 100MB or larger master device and sybsystemprocs device for 11.0.3.3. It will install just fine but if you try to start Sybase with more the 32MB of memory, it will fail. If you want to increase it you need to do two things:

  1. Increase max shared memory (kernel.shmmax and kernel.shmall) in /etc/sysctl.conf – which we already did
  2. Set the stack size to unlimited

Setting the stack size to unlimited is easy so in your RUN_server file:

#!/bin/sh
#
# Adaptive Server Information:
#  name:                          SYBASE_11033
#  master device:                 /opt/sybase/master.dat
#  master device size:            76800
#  errorlog:                      /opt/sybase/install/errorlog
#  interfaces:                    /opt/sybase
#

ulimit -s unlimited

/opt/sybase/bin/dataserver -d/opt/sybase/master.dat -sSYBASE_11033 \
-e/opt/sybase/install/errorlog -i/opt/sybase -c/opt/sybase/SYBASE_11033.cfg 

Since this is SQL Server 11.0.3.3, we don’t have to mess with LD_POINTER_GUARD.

Screenshot from 2013-03-10 16:05:31

Why you would use such an old DBMS version? You might have software that requires this version and the software vendor went out of business or discontinued the software with no upgrade path. In any case, Sybase’s SQL Server 11.0.3.3 is still useful.

Share Button

GIMP Magazine Issue 3 has been released!

by Jason L Froebe on March 8, 2013, no comments

GIMP Magazine Issue 3

 

ISSUE 3 HIGHLIGHTS

  • We are featuring the cover story on Andrea Zanovello, a highly talented photographer with some stunning shots to gaze at.  In an exclusive interview Andrea tells us all about his photography and what he hopes for in the next version of GIMP
  • We have the first ever Issue of “The Hunt for Wilber” a graphic novel by Dave Lepek, illustrated by Yeshua Nel, who you may know from the Master Class featured in Issue 2 of GIMP Magazine.  Yeshua has joined our team as a regular contributor / illustrator
  • We completed a 70+ point comparison between GIMP 2.8.0 and Adobe Photoshop CS5.5 Extended
  • We have a full length article on motion photography from Ian Muttoo who you may know from the cover story of Issue #1.  Ian has joined our team as a regular contributor
  • A whole lotta G’MIC coming your way.  We have a collection of G’MIC articles.  Debi Dalio who joined our team recently has given us three articles: a full length feature article about G’MIC and how it works, a super groovy tutorial on how to create a rotoidoscope pattern, and finally a product review of G’MIC.
  • Oma Dial has delivered a book review of, “The Night Parade of One Hundred Demons: a Field Guide to Japanese Yokai”.  The interesting twist is that this full length book is not a training guide, but rather was created using GIMP and other open source tools
  • We have a few short features on other talented photographers
  • We have an incredible photography gallery that we are positive will inspire you
  • We have continued our Tips and Tricks feature
  • And we wrapped all of this is in a very cool looking magazine
  • Oh yeah, did I mention that GIMP Magazine is FREE?

GIMP Magazine

 

Share Button

Installing OpenClient with Sybase’s ASE 15.7+ installer (setup.bin -i console)

by Jason L Froebe on February 21, 2013, no comments

Installing Sybase OpenClient 15.7 or higher on *nix with setup.bin and don’t have X-Windows available, you will need to start the setup.bin with:

./setup.bin -i console

If you want to install just OpenClient or some other thing, the problem comes with the poorly worded “Choose Product Features”:

ENTER A COMMA_SEPARATED LIST OF NUMBERS REPRESENTING THE FEATURES YOU WOULD
LIKE TO SELECT, OR DESELECT. TO VIEW A FEATURE’S DESCRIPTION, ENTER
‘?<NUMBER>’. PRESS <RETURN> WHEN YOU ARE DONE:

Read that twice.  So, does what exactly does that mean?  Well, unless you work with people that write proposals to be voted on in your local government, it is rather confusing.  It basically means:  Each item is a boolean.

  • You want to install item and it is marked?  Do nothing
  • You want to install item and it is NOT marked?  Add the number to your answer
  • You don’t want to install an item and it is marked?  Add the number to your answer
  • You don’t want to install an item and it is not marked?  Do nothing

For example, if I wanted to install just:

  • Open Client
  • DB-Library
  • Embedded SQL/C
  • Embedded SQL/Cobol
  • XA Interface Library for ASE Distributed Transaction Manager
  • Additional Connectivity Language Modules
  • ASE Extension Module for Python
  • ASE Extension Module for PHP
  • jConnect 7.0 for JDBC
  • ASE ODBC Driver
  • Interactive SQL
  • QPTune
  • Sybase Central
  • Adaptive Server Plug-in for Sybase Central
  • SySAM License Utilities

Choose Product Features
———————–

ENTER A COMMA_SEPARATED LIST OF NUMBERS REPRESENTING THE FEATURES YOU WOULD
LIKE TO SELECT, OR DESELECT. TO VIEW A FEATURE’S DESCRIPTION, ENTER
‘?’. PRESS WHEN YOU ARE DONE:

1- [-] Adaptive Server Enterprise
2- |-[ ] Additional ASE Language Modules
3- |-[X] Sybase Control Center Agent for ASE
4- |-[ ] Sybase Control Center SNMP Agent for ASE
5- [-] Open Client
6- |-[X] DB-Library
7- |-[ ] Embedded SQL/C
8- |-[ ] Embedded SQL/Cobol
9- |-[ ] XA Interface Library for ASE Distributed Transaction Manager
10- |-[ ] Additional Connectivity Language Modules
11- |-[X] ASE Extension Module for Python
12- |-[X] ASE Extension Module for PHP
13- [X] jConnect 7.0 for JDBC
14- [X] ASE ODBC Driver
15- [X] Interactive SQL
16- [X] QPTune
17- [X] Sybase Central
18- |-[X] Adaptive Server Plug-in
19- [-] SySAM License Utilities
20- |-[ ] SySAM License Server

Please choose the Features to be installed by this installer.: 1,7,8,9,10

You get one shot at choosing what you want installed.  Seriously Sybase?

After agreeing to the User License Agreement, why am I agreeing to it here instead of at the start of the installation or right before the files are copied???, the installer will list what you’re about to install.  Review it carefully, if something is wrong, ctrl-c out of  the installer and try again.

Pre-Installation Summary

————————

Please Review the Following Before Continuing:

Product Name:
Sybase Adaptive Server Enterprise Suite

Install Folder:
/home/homer.simpson

Product Features:
Open Client,
DB-Library,
Embedded SQL/C,
Embedded SQL/Cobol,
XA Interface Library for ASE Distributed Transaction Manager,
Additional Connectivity Language Modules,
ASE Extension Module for Python,
ASE Extension Module for PHP,
jConnect 7.0 for JDBC,
ASE ODBC Driver,
Interactive SQL,
QPTune,
Sybase Central,
Adaptive Server Plug-in,
SySAM License Utilities

Disk Space Information (for Installation Target):

 

Share Button

HOWTO: Building Perl module DBD::Sybase 1.14 on Windows (32bit or 64bit) with ActiveState Perl 5.16, Microsoft Visual Studio and Sybase OpenClient 15.7

by Jason L Froebe on February 20, 2013, 2 comments

Compiling the DBD::Sybase Perl module really requires Microsoft Visual C++ 2005 or higher. To get started open the “Visual Studio 2005 Command Prompt”.Visual Studio 2005 Command Prompt

You will need to fix the Makefile.PL file:

if ( $^O eq 'MSWin32' ) {
  $lib_string = "-L$SYBASE/lib -llibct.lib -llibcs.lib -llibtcl.lib -llibcomn.lib -llibintl.lib -llibblk.lib $attr{EXTRA_LIBS} -lm";

to

if ( $^O eq 'MSWin32' ) {
  $lib_string = "-L$SYBASE/lib -llibsybct.lib -llibsybcs.lib -llibsybblk.lib $attr{EXTRA_LIBS}";

If you don’t, nmake won’t be able to link against the Sybase libraries. Note that we’re adding “syb” after “lib”.

Warning (mostly harmless): No library found for -llibct.lib
Warning (mostly harmless): No library found for -llibcs.lib
Warning (mostly harmless): No library found for -llibtcl.lib
Warning (mostly harmless): No library found for -llibcomn.lib
Warning (mostly harmless): No library found for -llibintl.lib
Warning (mostly harmless): No library found for -llibblk.lib
Warning (mostly harmless): No library found for -lm

When you run perl Makefile.PL, choose the defaults because the nmake test will NOT work with Visual Studio.
Next we need to change lines 3915 and 3916 in dbdimp.c because C89 requires that declarations of variables must occur at the beginning of a code block. This is part of the C89 specification.

for (i = 0; i < foundOutput; i++) {
phs = params[i].phs;
CS_DATAFMT datafmt;

to

for (i = 0; i < foundOutput; i++) {
CS_DATAFMT datafmt;
phs = params[i].phs;

If you don't we will get the following errors:

dbdimp.c(3916) : error C2275: 'CS_DATAFMT' : illegal use of this type as an expression
        C:\Sybase\OCS-15_0\include\cstypes.h(864) : see declaration of 'CS_DATAFMT'
dbdimp.c(3916) : error C2146: syntax error : missing ';' before identifier 'datafmt'
dbdimp.c(3916) : error C2065: 'datafmt' : undeclared identifier
dbdimp.c(3918) : warning C4133: 'function' : incompatible types - from 'int *' to 'CS_DATAFMT *'
dbdimp.c(3921) : error C2224: left of '.maxlength' must have struct/union type
dbdimp.c(3926) : warning C4018: '< ' : signed/unsigned mismatch
dbdimp.c(4146) : warning C4244: 'function' : conversion from 'CS_BIGINT' to 'const NV', possible loss of data
dbdimp.c(4151) : warning C4244: 'function' : conversion from 'CS_UBIGINT' to 'const NV', possible loss of data
dbdimp.c(5124) : warning C4244: '=' : conversion from 'long' to 'CS_BINARY', possible loss of data
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

The nmake will now complete with many warnings. I've started on working up a patch for the DBD::Sybase maintainer, Michael Peppler. Tar and gzip the blib directory and call it DBD-Sybase-1.14.tar.gz. Put it in a directory like so: "MSWin32-x64-multi-thread-5.16\DBD-Sybase-1.14.tar.gz"

nmake ppd

Now, you will have a file called DBD-Sybase.ppd consisting of:

<softpkg NAME="DBD-Sybase" VERSION="1.14">
    <abstract>DBI driver for Sybase datasources</abstract>
    <author>Michael Peppler (mpeppler@peppler.org)</author>
    <implementation>
        <architecture NAME="MSWin32-x86-multi-thread-5.16"></architecture>
        <codebase HREF="MSWin32-x86-multi-thread-5.16\DBD-Sybase-1.14.tar.gz"></codebase>
    </implementation>

If you want to build multiple architectures, you will need to build the Module on the appropriate platform. e.g. Windows 7 64bit. I haven't had much luck with cross-compilers with ActiveState Perl. YMMV. Once you have the second tar ball, simply add it to your PPD file:

<softpkg NAME="DBD-Sybase" VERSION="1.14">
    <abstract>DBI driver for Sybase datasources</abstract>
    <author>Michael Peppler (mpeppler@peppler.org)</author>
    <implementation>
        <architecture NAME="MSWin32-x64-multi-thread-5.16"></architecture>
        <codebase HREF="MSWin32-x64-multi-thread-5.16\DBD-Sybase-1.14.tar.gz"></codebase>
    </implementation>
    <implementation>
        <architecture NAME="MSWin32-x86-multi-thread-5.16"></architecture>
        <codebase HREF="MSWin32-x86-multi-thread-5.16\DBD-Sybase-1.14.tar.gz"></codebase>
    </implementation>
</softpkg>

I typically zip up the PPD file and the two directories listed in the PPD and distribute that. How you do it is entirely up to you.

Oh, if you want DBD::Sybase on Windows to connect to Microsoft SQL Server, build with FreeTDS.

Share Button

You installed Commodore 64 Emulator Vice (x64) and you can’t type in it? Fixing the “Cannot load keymap ‘x11_sym.vkm’” error

by Jason L Froebe on February 19, 2013, no comments

Commodore 64 Emulator

Commodore 64 Emulator

See the "About VICE" command for more info.

XRandR: XRandR reports current display: 1600×900@60
Loading system file `/home/jason/.vice/C64/kernal‘.
C64MEM: Kernal rev #3.
Loading system file `/home/jason/.vice/C64/basic’
.
Loading system file `/home/jason/.vice/C64/chargen‘.
Loading system file `/home/jason/.vice/PRINTER/mps803′
.
Error – ROM /home/jason/.vice/PRINTER/mps803: short file.
MPS-803: Error – Could not load MPS-803 charset ‘mps803′.
MPS-803: Error – Cannot load palette file `mps803.vpl‘.
NL10: Error – Could not load NL-10 ROM file ‘
nl10-cbm‘.
Loading system file `/home/jason/.vice/DRIVES/dos1541′
.
IECDriveROM: Warning – Unknown 1541 ROM image.  Sum: 1988651.
Loading system file `/home/jason/.vice/DRIVES/d1541II‘.
IECDriveROM: Error – 1570 ROM image not found.  Hardware-level 1570 emulation is not available.
Loading system file `/home/jason/.vice/DRIVES/dos1571′
.
Loading system file `/home/jason/.vice/DRIVES/dos1581‘.
IECDriveROM: Error – 2000 ROM image not found.  Hardware-level 2000 emulation is not available.
IECDriveROM: Error – 4000 ROM image not found.  Hardware-level 4000 emulation is not available.
Loading system file `/home/jason/.vice/DRIVES/dos2031′
.
Loading system file `/home/jason/.vice/DRIVES/dos2040‘.
Loading system file `/home/jason/.vice/DRIVES/dos3040′
.
Loading system file `/home/jason/.vice/DRIVES/dos4040‘.
Loading system file `/home/jason/.vice/DRIVES/dos1001′
.
Drive: Finished loading ROM images.
Sound: Available sound devices: pulse alsa uss dummy fs dump wav voc iff aiff soundmovie
Keyboard: Error – Cannot load keymap `x11_sym.vkm‘.
Joystick: Linux joystick interface initialization…
Joystick: /dev/input/js0 is Logitech Logitech Dual Action
Joystick: Built in driver version: 2.1.0
Joystick: Kernel driver version  : 2.1.0
Joystick: Warning – Cannot open joystick device `/dev/input/js1′
.
Joystick: Warning – Cannot open joystick device `/dev/input/js2‘.
Joystick: Warning – Cannot open joystick device `/dev/input/js3′
.
Joystick: Warning – Cannot open joystick device `/dev/input/js4‘.
Joystick: Warning – Cannot open joystick device `/dev/input/js5′
.
Main CPU: starting at ($FFFC).
Main CPU: RESET.
Sound: Opened device `pulse‘, speed 44100Hz, fragment size 11ms, buffer size 104ms
reSID: MOS6581, filter on, sampling rate 44100Hz – fast
Drive 8: RESET.

Vice
From the user’s perspective, this appears to be a variant of Vice bug #223410 where the Vice system files aren’t being located correctly. In that particular bug, the files were not being copied into the $PREFIX/lib/vice directory (typically /usr/lib/vice). So it is only partially related. With the issue of building Vice 64bit, the files ARE being installed and correctly into $PREFIX/lib64/vice but the application is still looking in $PREFIX/lib/vice. This is easily worked around though:

sudo ln -s /usr/lib64/vice /usr/lib/vice
Share Button
Facebook login by WP-FB-AutoConnect