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

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

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;[/c] to [c num=1 highlight_lines = "2,3"]for (i = 0; i < foundOutput; i++) { CS_DATAFMT datafmt; phs = params[i].phs;[/c] If you don't we will get the following errors: [text]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.[/text] 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" [text]nmake ppd[/text] Now, you will have a file called DBD-Sybase.ppd consisting of: [xml num=1]
DBI driver for Sybase datasources
Michael Peppler (mpeppler@peppler.org)




[/xml]

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

Commodore 64 Emulator
Commodore 64 Emulator
See the "About VICE" command for more info.

XRandR: XRandR reports current display: 1600x900@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

Get it here! Perl DBD::Sybase 1.14.01 for Active State Perl 5.16 Windows XP/Vista/7/8 32bit AND 64bit

Assuming that you installed Sybase SDK OpenClient 15.7.

Sybase Openclient is included in the Sybase Developer’s Kit, and ASE PC Client. If you don’t have a license, you can download the ASE 15.7 Developer Edition for Windows which will include it.

Install ActiveState Perl from http://www.activestate.com (free) and install DBI if it isn’t already installed.  It should be but you never know…

  1. Start -> ActiveState Perl -> Perl Package Manager
  2. install DBI
  3. exit

Now, the easy part.  Install the DBD-Sybase-1.14 1.14 PPM:

  1. download DBD-Sybase-1.14
  2. extract zip file to temporary directory (e.g. c:\test)
  3. Start -> Run -> cmd.exe (as Administrator if Vista or Windows 7)
  4. cd \test
  5. ppm install DBD-Sybase.ppd
  6. exit

That’s it :)

It should automatically install the DBD::Sybase for Perl 5.16 32bit or 64bit depending on which version of Active State Perl you have installed.

UPDATE (March 6th, 2013):

The PPM is fixed now. Please let me know of any issues.

Share Button

Sybase’s Openclient SDK 15.7

It doesn’t work with Microsoft Visual Studio 6. It requires Visual Studio 2005 (minimum). Digging out my 2005 disc. Starting to build the DBD::Sybase ActiveState PPMs for Windows 32bit and 64bit. Should have at least one version out tomorrow

Share Button

HowTo: Comparing two tables and returning the # of rows that match FAST

The most intuitive way to write a comparison of two tables and spit out the # of rows that are the same involves a left join:

select 'Investment' as TableName, count(*) as RowCount
from Investment_A a, Investment_B b
where
  a.col1 = b.col1
  AND a.col2 = b.col2
  AND a.col3 = b.col3
  AND a.col4 = b.col4

This returns the correct answer but is very slow. Is there a better way? Of course!

select 'Investment' as TableName, count(*) as RowCount
from
(
   select 1 as num
   FROM (
      select * from Investment_A
      UNION ALL
      select * from Investment_B
   ) tmp
   GROUP BY col1, col2, col3, col4
   HAVING COUNT(*) > 1
) tmp2

By pushing the comparison off into the GROUP BY, we leverage the DBMS engine far more efficiently. There are two drawbacks:

  1. Readability of the SQL code
  2. Far more temporary storage is used for the GROUP BY. There is a real risk of running out of temporary storage if the tables are large.
Share Button

HowTo: Windows 7 32bit AND 64bit Sound with KVM / libvirt and the Spice client

UPDATE: Fixed and signed qxl video drivers

Hi all,

Yesterday I promised to post how I was able to get sound working with KVM / libvirt and the Spice client with Windows 7 32bit and 64bit. Here you go 🙂

First, get your spice client set up wherever you are going to run virt-manager.

On the server, I’m going to assume you set up kvm / libvirt already.

Install the spice server packages:

sudo apt-get update
sudo apt-get install qemu-kvm-extras qemu-kvm-spice kvm kvm-ipxe qemu-user

Modify /etc/libvirtd/qemu.conf to run the QEMU processes under the libvirtd group. You did add your user to the libvirtd group right? 😉

# The group ID for QEMU processes run by the system instance.
group = "libvirtd"

Reboot your server.

Create a new Windows 7 virtual machine but we will need to customize the settings:
Screenshot from 2013-02-10 14:19:07

Choose Spice as the Display adaptor:
Screenshot from 2013-02-10 14:21:04

Change Video hardware to QXL:
Screenshot from 2013-02-10 14:22:51

For sound, choose the appropriate hardware:

  • Windows 7 (32bit): ac97
  • Windows 7 (64bit): ich6
  • Windows Server 2008: ich6
  • Windows Vista (64bit): ich6
  • Windows Vista (32bit): ac97
  • Windows XP (32bit) ac97

For the hard disk and network cards, choose libvirt. You will need to download the libvirt iso image from Fedora. When you get to the point of choosing a drive to install Windows 7 onto, you will need to insert the image using virt-manager
Screenshot from 2013-02-10 14:34:06
Screenshot from 2013-02-10 14:36:00
When it finds the libvirt drivers, choose the one for Windows 7 32bit or 64bit as appropriate. Reinsert the Windows 7 image into virt-manager.

Log into your server and change the xml for your virtual machine replacing the graphics and video sections.

$ virsh
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit
virsh # edit Win7-test
<graphics type='spice' autoport='yes'>
      <image compression='auto_glz'></image>
      <streaming mode='filter'></streaming>
      <mouse mode='client'></mouse>
      <clipboard copypaste='yes'></clipboard>
    </graphics>
    <video>
      <model type='qxl' vram='65536' heads='1'>
        <acceleration accel3d='yes' accel2d='yes'></acceleration>
      </model>
    </video>

After installing Windows, open up device manager (right click on my computer -> Properties -> Hardware -> Device Manager). Right click on any devices that are found and don’t have device drivers installed (yellow exclamation mark on them) and update the drivers. Choose the drivers on the libvirt iso image.

Okay. Almost done. If you try to play any audio, it will play but you won’t hear anything. Why? It seems that the QXL video driver is needed for sound to play remotely on the Spice client.

I’ve had trouble with the WIN32 QXL driver qxl_unstable.zip starting correctly in Windows XP and Vista although I haven’t had a problem with Windows 7 (32bit). With Windows 7 64bit, no binary drivers are provided. I can only suspect that because Windows 7 64bit requires properly signed drivers, the developers opted not to manage the signing themselves. So, I built the drivers for Windows XP (32bit), Windows 2008 (64bit), Windows 7 (32bit) and Windows 7 (64bit) yesterday.

QXL Drivers for Windows XP (32bit), Windows 2008 (64bit), Windows 7 (32bit) and Windows 7 (64bit)qxl video drivers

Right click on “SpiceTestCert.cer” and install it to accept the driver. Next update the VGA driver with the corresponding driver.

Note that since these were signed by me and not an actual company, you may need to force Windows 7 (64bit) to allow the driver to be loaded. See Installing Unsigned Drivers in Windows 7 by Trish Perry for three different methods. When you restart the vm, you should now hear sound if you’re using Spice.

The same method will work for Windows XP, Windows Vista and Windows Server 2008. I haven’t tried with Windows 8 yet.

Share Button

HowTo: Getting the Spice client up and working on Ubuntu 12.10 with libvirt / virt-manager

Unfortunately, when you install the Spice client on Ubuntu 12.x, it doesn’t include everything you need to get it to workUbuntu

sudo apt-get update
sudo apt-get install spice-client-gtk qemu-kvm-spice python-spice-client-gtk

If you’re up to date on your 12.10 patches, you shouldn’t need to modify the libvirt-qemu file for Apparmor but if you have troubles, add it in to /etc/apparmor.d/abstractions/libvirt-qemu:

/usr/bin/qemu-system-i386-spice rmix,
/usr/bin/qemu-system-x86_64-spice rmix,
/run/shm/spice.* rwixm,
/run/shm rw,

As I’m running virt-manager on my laptop and connecting to a server, I created an ssh key so I don’t have to add my password over and over again. See ssh-keygen.

Adding a remote server to virt-manager is very easy. File -> Add Connection
Screenshot from 2013-02-10 13:56:27

Share Button

Tomorrow: Howto Windows 7 32bit AND 64bit Sound with KVM / libvirt and the Spice client

Finally got sound working in a Windows 7 64bit KVM virtual machine with Spice. There are a few conditions for it to work:

  1. ICH6 audio
  2. Spice guest drivers installed NOT VNC
  3. QXL video
  4. QXL driver (64bit)

Since I’m using Windows 7 Enterprise 64bit, I had to build and digitally sign the driver. Not difficult at all but PITA. I’ll write a howto blog post tomorrow.

Share Button

Howto: Compile VIM 7.3 on AIX 6.x (error: conflicting types for `lseek64′)

If you’ve tried building VIM on AIX 6.x, you’ve probably run into:

In file included from os_unix.h:56,
                 from vim.h:265,
                 from gui_motif.c:36:
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:178: error: conflicting types for `lseek64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:176: error: previous declaration of `lseek64'
In file included from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:739,
                 from os_unix.h:56,
                 from vim.h:265,
                 from gui_motif.c:36:
/usr/include/sys/lockf.h:64: error: conflicting types for `lockf64'
/usr/include/sys/lockf.h:62: error: previous declaration of `lockf64'
In file included from os_unix.h:56,
                 from vim.h:265,
                 from gui_motif.c:36:
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:802: error: conflicting types for `ftruncate64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:800: error: previous declaration of `ftruncate64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:838: error: conflicting types for `truncate64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:836: error: previous declaration of `truncate64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:855: error: conflicting types for `pread64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:852: error: previous declaration of `pread64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:856: error: conflicting types for `pwrite64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:853: error: previous declaration of `pwrite64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:923: error: conflicting types for `fclear64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:920: error: previous declaration of `fclear64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:924: error: conflicting types for `fsync_range64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:921: error: previous declaration of `fsync_range64'
In file included from vim.h:302,
                 from gui_motif.c:36:
auto/osdef.h:120: error: conflicting types for `lseek64'
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.3.0.0/3.3.2/include/unistd.h:178: error: previous declaration of `lseek64'
make: The error code from the last command is 1.

Stop.
make: The error code from the last command is 2.

The problem is really an AIX specific change (see http://sourceware.org/bugzilla/show_bug.cgi?id=13558):

Since AIX 6.1, mkdtemp() is declared upon _XOPEN_SOURCE >= 700, and
thus the symbol is available in libc.

The difference is: Upon _ALL_SOURCE (defined in config.h),
AIX 6.1 defines (overrides!) _XOPEN_SOURCE=600, while
AIX 7.1 defines (overrides!) _XOPEN_SOURCE=700,

This particularly isn’t a problem on AIX 7.1, but still the check for mkdtemp()
should be extended to if the declaration is available too.

For the case of VIM, the problem is triggered only when building with Motif support. Since most AIX users are on a server and not a desktop environment, let’s build without it and any other GUI support:

./configure --prefix=/somewhere --without-x --without-gnome --disable-gnome-check --disable-motif-check --disable-athena-check --disable-gui

It should now build and run 🙂

Share Button