How to install and run Sybase Adaptive Server Enterprise 12.5.4 and 15.0x on Ubuntu Linux 8.04 JEOS (Hardy Heron) using chroot environment

ASE, Backup Server, Databases, How To, Linux, OS, Replication Server, Sybase 2 Comments »

Because Sybase has yet to address the GLIBC (LD_POINTER_GUARD) issue with any of their products on Linux, we are forced to find alternative ways of getting Sybase software to run on modern Linux distribution.  In this situation, we will be using the Ubuntu 8.04 Just Enough OS (Ubuntu JEOS) Linux distribution.

After installing Ubuntu 8.04 Server JEOS on the physical or virtual machine, download the Ubuntu 7.04 Server iso image.  Why Ubuntu 7.04?  Ubuntu 7.04 is the last Ubuntu release that has an old enough GLIBC that Sybase software will work with.

% sudo debootstrap feisty /home/sybase file:///media/cdrom0

  • Change the home directory of the sybase user to be /dbms/sybase by editing the /etc/passwd file

% sudo cp /etc/resolv.conf /home/sybase/etc/resolv.conf

% sudo cp /etc/hosts /home/sybase/etc/hosts

% sudo cp /etc/passwd /home/sybase/etc/passwd

% sudo cp /etc/shadow /home/sybase/etc/shadow

% sudo `cat /etc/apt/sources.list | sed -e ’s/hardy/feisty/g’ > /home/sybase/etc/apt/sources.list`

% sudo mount –bind /dev /home/sybase/dev

% sudo mount –bind /proc /home/sybase/proc

% sudo mount -t devpts none /home/sybase/dev/pts

% sudo mount –bind /tmp /home/sybase/tmp

% sudo aptitude update

% sudo aptitude upgrade

% sudo apt-get install locales dialog wget debconf devscripts gnupg

% sudo aptitude install libstdc++5 libstdc++6 libaio

  • If you’re installing v12.5x software, you will need to install an even older copy of libstdc++ (not needed for v15 or higher software):

% aptitude install libstdc++2.10-glibc2.2

  • Install Sybase software into /dbms/sybase (as root in the chroot environment which you should still be in)

% sudo cp /dbms/sybase/SYBASE.sh /dbms/sybase/SYBASE.env

% sudo echo DSQUERY=MYASE >> /dbms/sybase/.SYBASE.env

% sudo echo sa_password > /dbms/sybase/.sapwd

% sudo chmod go-rwx /dbms/sybase/.sapwd

% sudo chmod u-wx /dbms/sybase/.sapwd

% sudo chown -R sybase /dbms/sybase

  • Install the sybase_chroot script into /usr/local/bin and make it executable by root
  • Install the sybase_ase rc script into /etc/init.d and make it executable by root
  • Exit the chroot environment by typing ‘exit’
  • create a symbolic link outside of the chroot environment to make /home/sybase/dbms appear as /dbms.  This will allow you to access the Sybase software, notably OpenClient, as a normal user outside of the chroot environment.

% sudo ln -s /home/sybase/dbms /dbms

You are now able to start Sybase ASE using sudo /etc/init.d/sybase_ase start and stop Sybase ASE using sudo /etc/init.d/sybase_ase stop.  Starting Sybase Replication Server, OpenServer, or similar Sybase software is simply a matter of copying the /etc/init.d/sybase_ase and tweaking the script copy.

If you feel this is way complicated and Sybase should just fix their software, let them know.  Please point them to this page and refer to CR455393.

UPDATE: The GLIBC issue is fixed in v15.0.2 esd 4.  It doesn’t seem to be working for everyone though.  More information is needed about those systems where esd 4 doesn’t resolve the matter.  No fix is available for 12.5x from Sybase.

UPDATE: Keep in mind, that the Sybase ASE 15.0.2 esd 4 patch is available only to Sybase customers with a current maintenance contract with Sybase.

Listen to this podcast Listen to this podcast

Synchronize a Sybase ASE database sysusers with master..syslogins

ASE, Sybase No Comments »

Not sure who was the original author of this short synchronization script but kudos to whomever it is!

isql -Usa -S server -D my_db -i sync_users.sql

sync_users.sql

EXEC SP_CONFIGURE "allow updates", 1
go

/* delete names not found in master syslogins */
DELETE FROM sysusers
WHERE suid > 1
 and uid < =16383
 and uid > 1
 and name not in
  (SELECT name FROM master..syslogins)
go

/* update sysusers and resync all uids from the existing suids */
IF exists(SELECT 1
   FROM sysobjects
   WHERE name = "sysusers_holding"
    and type = "U")
DROP TABLE sysusers_holding
go

CREATE TABLE sysusers_holding (
 id NUMERIC(6,0) IDENTITY PRIMARY KEY,
 suid INT null,
 uid INT null,
 gid INT null,
 name CHAR(30) null,
 environ VARCHAR(255) null)
go

/* populate the holding table */
INSERT INTO sysusers_holding (suid, gid, name, environ)
SELECT suid, gid, name, environ
 FROM sysusers
 WHERE suid > 1
  and uid < = 16383
  and uid > 1
go

/* update the uids. */
DECLARE syncuser CURSOR FOR
 SELECT name, uid
 FROM sysusers_holding
 FOR UPDATE OF uid, suid
go

DECLARE @name CHAR(30), @uid INT, @suid INT
 SELECT @suid = 9999
  OPEN syncuser
  FETCH syncuser INTO @name, @uid
  WHILE (@@sqlstatus != 2)
  BEGIN
   IF exists(SELECT 1
    FROM master..syslogins
    WHERE name = @name)
    /* got the name - update the uid */
   BEGIN
    SELECT @suid = suid
     FROM master..syslogins
     WHERE name = @name
    UPDATE sysusers_holding SET uid = @suid, suid = @suid WHERE CURRENT OF syncuser

    IF @@ERROR != 0
    BEGIN
     ROLLBACK TRANSACTION
     BREAK
    END

    SELECT @suid = 9999
   END
  FETCH syncuser INTO @name, @uid
  END
 CLOSE syncuser
go

DEALLOCATE CURSOR syncuser
go      

/* now move records over */
DELETE FROM sysusers
 WHERE suid > 1
  and uid < =16383
  and uid > 1
go

INSERT INTO sysusers
 SELECT suid, uid, gid, name, environ
 FROM sysusers_holding
go

/* sp_helpuser will show any mis-matches) */
EXEC SP_HELPUSER
go

EXEC SP_CONFIGURE "allow updates", 0
go

Listen to this podcast Listen to this podcast

Sybase Sysam License Type Codes

Databases, Sybase 2 Comments »

Yuval Malchi over on the ISUG sybase-l mailing list provided the following codes for Sybase’s Sysam (FlexLM):

License Type What the License Type Represents
SS Standalone Seat
DT Development and Testing
MB Mainframe Base
MU Millions of Service Units
CP CPU License
FL Floating License
IC Internet Access License
AP Application License
SR Server License
CL Cluster License
ST Networked Seat
CU Concurrent User License
SF Standby CPU License
SV Standby Server License
SC Standby Concurrent User
OT Other

The following License Types are only available for specific Partner contracts with OEM or embedded license arrangements:

License Type What the License Type Represents
AC Application Deployment CPU
AR Application Deployment Server
AS Application Deployment Seat
AU Application Deployment Concurrent User
AO Application Deployment Other
BC Application Deployment Standby CPU
BR Application Deployment Standby Server
BU Application Deployment Standby Concurrent User

Listen to this podcast Listen to this podcast

tricky: Getting Sybase ASE 12.5.4 to run on Linux PowerPC 64bit

ASE, Databases, Linux, OS, Sybase 1 Comment »

For the past few days, we’ve been struggling with getting Sybase’s ASE DBMS to start on our new Linux PowerPC (a virtual machine running on top of AIX). We were able to install the software with no problems. We weren’t able to get past the __gxx_personality_v0 error:

symbol lookup error: /opt/ibmcmp/lib64/libibmc++.so.1: undefined symbol: __gxx_personality_v0

The error is a linking issue with IBM’s Visual Age runtime (a c/c++ runtime). I was able to confirm with Sybase that ASE will NOT run with Visual Age 8.x or 9.x and that it requires the 7.0 runtime. I downloaded the 7.0 runtime from IBM’s website but still received the same error.

ASE’s linking looked okay however:

[sybase@sybase ASE-12_5]$ ldd -v bin/dataserver
libbtsymbols.so => /sybase/ASE-12_5/lib/libbtsymbols.so (0×0000008000002000)
librt.so.1 => /lib64/tls/librt.so.1 (0×0000008000647000)
libm.so.6 => /lib64/tls/libm.so.6 (0×0000008081560000)
libnsl.so.1 => /lib64/libnsl.so.1 (0×0000008000674000)
libdl.so.2 => /lib64/libdl.so.2 (0×0000008081510000)
libibmc++.so.1 => /opt/ibmcmp/lib64/libibmc++.so.1 (0×00000080006a4000)
libpam.so.0 => /lib64/libpam.so.0 (0×00000080006b7000)
libpthread.so.0 => /lib64/tls/libpthread.so.0 (0×00000080006d3000)
libaio.so.1 => /lib/libaio.so.1 (0×00000080006ff000)
libc.so.6 => /lib64/tls/libc.so.6 (0×00000080812f0000)
/lib64/ld64.so.1 (0×00000080812b0000)
libaudit.so.0 => /lib64/libaudit.so.0 (0×0000008000711000)

I worked with Sybase & IBM to track down the cause but it was IBM’s Brian Shen that was able to identify the culprit. We need to preload the libstdc++.so.5 library:

export LD_PRELOAD=/usr/lib64/libstdc++.so.5

Once we did that, we verified that the library was being picked up:

[sybase@sybase install]$ ldd $SYBASE/$SYBASE_ASE/bin/dataserver
/usr/lib64/libstdc++.so.5 (0×0000008000002000)
libbtsymbols.so => /sybase/ASE-12_5/lib/libbtsymbols.so (0×0000008000146000)
librt.so.1 => /lib64/tls/librt.so.1 (0×000000800078c000)
libm.so.6 => /lib64/tls/libm.so.6 (0×0000008081560000)
libnsl.so.1 => /lib64/libnsl.so.1 (0×00000080ef740000)
libdl.so.2 => /lib64/libdl.so.2 (0×0000008081510000)
libibmc++.so.1 => /opt/ibmcmp/lib64/libibmc++.so.1 (0×00000080007ba000)
libpam.so.0 => /lib64/libpam.so.0 (0×00000080ef6a0000)
libpthread.so.0 => /lib64/tls/libpthread.so.0 (0×00000080007cd000)
libaio.so.1 => /lib/libaio.so.1 (0×00000080007fa000)
libc.so.6 => /lib64/tls/libc.so.6 (0×00000080812f0000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0×000000800080b000)
/lib64/ld64.so.1 (0×00000080812b0000)
libaudit.so.0 => /lib64/libaudit.so.0 (0×00000080ef6c0000)

If you receive the following error, you can safely ignore it:

ERROR: ld.so: object ‘/usr/lib64/libstdc++.so.5′ from LD_PRELOAD cannot be preloaded: ignored

Don’t forget to set up your environment to include the IBM Visual Age runtime:

export LD_LIBRARY_PATH=/opt/ibmcmp/lib64:${LD_LIBRARY_PATH}
export PATH=$PATH:/opt/ibmcmp/lib64

Listen to this podcast Listen to this podcast

Replacing Sybase ASE’s Historical Server: Using OpenSource

ASE, DBI, Databases, Linux, OS, Perl, SQLite, Sybase No Comments »

I’m working on a Historical Server replacement.  I need to check with my employer as to whether I can open source it or not but the guts of it consist of:

  1. Perl POE/DBD::Sybase for the daemon/ASE db connections (using FreeTDS instead of OpenClient)
  2. SQLite for the local storage (way lower overhead than ASE or SQL Anywhere)
  3. Perl Catalyst / Template::Toolkit web front end with REST web services

All of this goes into a VMWare Appliance running Ubuntu 7.10 Server… a drop-in solution that can even be run on a laptop.  I’m hoping that my employer lets me release it as then I can zip it up and put it on sourceforge so everyone can benefit.

Listen to this podcast Listen to this podcast

ASE 15.0.2 esd 4 is out!

ASE, Databases, Sybase No Comments »

Andrew Sigmund over on the ISUG sybase-l mailing list, let us know that Sybase released ASE 15.0.2 esd 4 today. Go and get them! :)

Listen to this podcast Listen to this podcast

ASE 15 stored procedure “sp_tables” doesn’t work with SQL UDFs

ASE, Sybase 2 Comments »

The ASE 15 stored procedure sp_tables doesn’t work with SQL UDFs. sp_tables has the udfs coming back as system tables.

repro:
1) create a sql udf in a db
2) run sp_tables, you will see the UDF as a “SYSTEM TABLE”

DBADEV1.sybase_dba.1> sp_tables;
table_qualifier table_owner table_name table_type remarks
--------------- ----------- ---------- ---------- -------
sybase_dba dbo DATE_FORMAT SYSTEM TABLE NULL

In the above example, the DATE_FORMAT UDF is the one at Porting MySQL’s date_format function to Sybase ASE 15.0.2

I’ve opened a case with Sybase to get this fixed - I’ll post the CR # when I get it.

UPDATE:  Sybase assigned CR 497173 to this :)

Listen to this podcast Listen to this podcast

ISUG: Just sent off the outstanding ASE enhancements list to Sybase Product Manager

ASE, Databases, ISUG, Sybase No Comments »

As you may remember, I’m a board director in the International Sybase Users’ Group (ISUG).  I’ve recently been appointed the ‘chair’ of the Enhancements Committee.  The committee currently has two people: Chris Pollach and me.  We are responsible for maintaining the enhancements list on the ISUG website and ensuring that the enhancements are reviewed/commented upon by Sybase Product Management.

I’ve just sent off the current list of Enhancements (for ASE) to the PM.  Other products will follow shortly — this was just the first product I emailed off so don’t worry :)

Listen to this podcast Listen to this podcast

ASE 15 Cluster Edition Webcast

ASE, Databases, Events, News, Sybase No Comments »

INTRODUCING: ASE 15 Cluster Edition

January 29, 2008
1 p.m. ET / 10 a.m. PT

Please join us on Tuesday, January 29th to learn how ASE 15 Cluster Edition:

· Maximizes resource utilization and reduces infrastructure costs
· Ensures continuous application availability with shared-disk clusters
· Improves performance through transparent load balancing
· Simplifies administration tasks with automatic workload management

PRESENTER BIOS:

David Jonker
Sr. Product Marketing Manager; Sybase, Inc.

As a Senior Product Marketing Manager at Sybase, David Jonker is focused on marketing strategy for the Sybase ASE and Mirror Activator product lines. His career includes more than 10 years as a software developer and product manager before joining the Sybase ASE and Mirror Activator marketing team.

Mr. Jonker is an active speaker and writer about Sybase products and technologies. Some of his recent speaking engagements include CTIA Wireless IT & Entertainment, Gartner Wireless & Mobile, and Best Practices for Building Frontline Applications seminar series. He holds a Bachelor of Applied Science degree in Systems Design Engineering from the University of Waterloo.

Peter Thawley
Senior Director/Architect; Sybase, Inc.

Peter brings over 22 years of experience in software architecture and engineering, product management, and worldwide product & technology sales & services spanning both systems software products and business applications. He recently rejoined Sybase as a Senior Director and Architect in the Technology Evangelist team for Data Management products where he leads a group of engineers who help customers understand and implement Sybase’s technology stack.

Peter’s experience with Sybase products dates to 1990 when, working for a Sybase customer, he led projects to replace a back office brokerage trading system that accounted for 4% of the NYSE daily share volume using Sybase ASE on OS/2 & AIX, Open Server, and PowerBuilder. Peter is a household name with Sybase customers seen by his reputation for standing-room-only presentations at conferences around the world.

Don’t forget to sign up for the webcast!

Listen to this podcast Listen to this podcast

Having trouble locking shared memory in physical RAM? (Sybase ASE & Linux)

ASE, Databases, Linux, OS, Sybase No Comments »

Depending on which distribution of Linux you’re running, it seems that locking Sybase ASE’s shared memory into physical RAM can be a bit tricky.  Simply specifying “lock shared memory” in ASE (sp_configure) isn’t enough.

In many distributions, you can simply add the line into /etc/security/limits.conf to enable locking of shared memory up to 2GB for the sybase user:

sybase  -    memlock 2147483648

Unfortunately this doesn’t always work so you need to specify the memlock limit in the $SYBASE/$SYBASE_ASE/install/RUN_server file by adding the following above the dataserver line:

ulimit -l  2147483648

Whether you are able to lock the memory or not will depend on your environment (you do have enough free memory right?).   You can check if the memory is locked by simply checking the /proc/<pid of a dataserver process>/status:

grep VmLck /proc/<pid>/status

VmLck:   1140000 kB

Keep in mind that you won’t have a 1 to 1 memory size match between the locked memory (VmLck) and the total memory VmSize allocated simply because Sybase ASE only locks the shared memory and not the process:

VmPeak:  1182520 kB
VmSize:  1182516 kB
VmLck:   1140000 kB
VmHWM:   1155340 kB
VmRSS:   1155340 kB
VmData:    11488 kB
VmStk:        84 kB
VmExe:     23364 kB
VmLib:      3944 kB
VmPTE:      1168 kB

If all else fails, your distribution may need to run ASE as root to lock the shared memory.

Listen to this podcast Listen to this podcast

Sybase ASE 15.0.2 MDA Poster!

ASE, Databases, Sybase No Comments »

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!

Listen to this podcast Listen to this podcast

Duplicate rows in sysusers??

ASE, Databases, Sybase No Comments »

If you’re like me, you’ve run into lots of different issues with the Sybase ASE DBMS over the years. Today, Drew Montgomery looked at what happens when the 12.5.x -> 12.5.4 upgrade goes bad:

If you receive the 8419 error on sysusers after applying ASE 12.5.4 (or any other upgrade for that matter) such as the following:

01:00000:00472:2007/12/10 14:46:03.86 server Error: 8419, Severity: 20, State: 3
01:00000:00472:2007/12/10 14:46:03.86 server Could not find index descriptor for objid 10, indid 3 in dbid 13.
01:00000:00472:2007/12/10 14:46:03.88 kernel ************************************
01:00000:00472:2007/12/10 14:46:03.88 kernel SQL causing error : select * from sysusers
01:00000:00472:2007/12/10 14:46:03.88 kernel ************************************
01:00000:00472:2007/12/10 14:46:03.88 server SQL Text: select * from sysusers
01:00000:00472:2007/12/10 14:46:03.89 kernel curdb = 13 tempdb = 9 pstat = 0×10000
01:00000:00472:2007/12/10 14:46:03.89 kernel lasterror = 8419 preverror = 0 transtate = 1

Fear not because Drew has you covered with a simple script that will fix the problem. Note that it involves a dump and load of the affected database but you could just restart the ASE server if you don’t mind the down time:

SP_CONFIGURE "allow updates", 1
go
USE db_with_8419
go

SELECT * INTO tempdb..temp_sysusers FROM sysusers
go

SELECT uid, cnt= COUNT(*)
  INTO tempdb..temp_uid
  FROM tempdb..temp_sysusers
 GROUP BY uid
 HAVING COUNT(*) > 1
go

SELECT s.uid, s.suid
  INTO tempdb..temp_fixuid
  FROM tempdb..temp_sysusers s, tempdb..temp_uid t
 WHERE s.uid = t.uid
go

SELECT uid, MIN(suid) suid
  INTO tempdb..temp_rmuid
  FROM tempdb..temp_fixuid
 GROUP BY uid
go

DELETE tempdb..temp_fixuid
  FROM tempdb..temp_fixuid f, tempdb..temp_rmuid r
 WHERE f.uid = r.uid
   and f.suid = r.suid
go

ALTER TABLE tempdb..temp_fixuid ADD cntr INT IDENTITY
go

DECLARE @max_uid INT
SELECT @max_uid = MAX(uid)
  FROM tempdb..temp_sysusers
 WHERE suid > 16300

UPDATE sysusers
   SET uid = @max_uid + cntr
  FROM sysusers s, tempdb..temp_fixuid f
 WHERE s.uid = f.uid
   and s.suid = f.suid
go

USE master
go

DUMP DATABASE db_with_8419 TO "compress::N::/DumpLocation/dumpfilename.dmp"
go
LOAD DATABASE db_with_8419 FROM "compress::/DumpLocation/dumpfilename.dmp"
go
online DATABASE db_with_8419
go

SP_CONFIGURE "allow updates", 0
go

Bau-jen Liu over at Sybase came up with the following method but it does require rebooting ASE twice:

SP_CONFIGURE "allow updates", 1
go
UPDATE ..sysobjects
SET sysstat = 115, type = "U"
WHERE name = "sysusers"
go

Shutdown ASE, reboot, and log back in as a user with sa_role.

USE dbname
go

CREATE UNIQUE INDEX ncsysusers2 ON sysusers(uid)
go

The above CREATE INDEX command may fail due to the presence of duplicate key rows in sysusers. If this occurs, recreate the index as non-unique first:

CREATE INDEX ncsysusers2 ON sysusers(uid)
go

Now identify any duplicates that may exist in sysusers:

SELECT uid, name, COUNT(*)
FROM sysusers
GROUP BY uid
HAVING COUNT(*) > 1
go

Remove any duplicates found using the DELETE command and try the CREATE INDEX again:

CREATE UNIQUE INDEX ncsysusers2 ON sysusers(uid)
go

Now, clean up after yourself:

UPDATE ..sysobjects
SET sysstat = 113, type = "S"
WHERE name = "sysusers"
go

SP_CONFIGURE "allow updates", 0
go

Sybase has created bug # 298620 for this issue.

Listen to this podcast Listen to this podcast

Knowing the internals of Sybase ASE not always helpful

ASE, Databases, Sybase No Comments »

There are many former Sybase employees that retain the knowledge of the Sybase ASE internals.  No, not the internals from the Data Internals class but the source code and design documents.  While we gave up the physical materials when we left Sybase, we still retain much of it in our brains.  Technically, we aren’t supposed to use that knowledge but it is very very difficult not to.

Think about this scenerio:

Corruption on a single page in a table.  Sounds easy, just bcp the data out, truncate the table, bcp the data back in.  Normally that is the way to fix it.

What if the system is a mission critical 24×7x365 system that might be used for international trading or even to provide medical information to medical surgeons?  BCPing the data or going to backups may not be possible.  If you had the information on how to fix the corrupted page by patching it (something that Sybase strongly frowns upon)?

As you can see, using the internal/proprietary information inside your head is hard to avoid.  Granted, ProActive DBA allows you to patch the individual pages, but they apparently have permission to do so — or at least Sybase is looking the other way.

If you know about SybMon and know how to use it, it is nearly impossible not to use it if your Sybase ASE server is hung and you can’t log into it.

If you fix a server using an unsupported method and report it to Sybase, there is a chance that they will not look favorably on your solution.  So, do you report the problem to them and your solution in the hope that they fix the problem or do you just keep it to yourself?

Harder yet, is how to explain to your boss that you can’t tell them how you fixed the problem because you’re still under a non-disclosure agreement with Sybase.  You might be able to explain the situation to your boss but if he pushes for the information and you refuse, you might be out of a job.  Luckily my boss is happy to have me and doesn’t push the issue. :)

Listen to this podcast Listen to this podcast

Looking for a bug fix release schedule for ASE?

ASE, Backup Server, Databases, Sybase No Comments »

Many of you may not know that Sybase openly lists the release schedules for ASE 12.5 and 15.0. The release schedules list not only when the estimated release date of the patches, but the list of bug fixes that are expected to be in each patch.

Targeted ASE 12.5.x Release Schedule and CR list Information

Targeted ASE 15.0 Release Schedule and CR list Information

How cool is that? Sybase has been providing this information for a number of years as you can still see the release schedule for the old 12.0 releases!

A word of caution: The release schedule and the bugs listed to be fixed in the patches are tentative and are not ’set in stone’. Sometimes during testing issues are found with bug fixes (it might cause other issues) or some other thing might come up that might delay the bug fix or release of the patch.

Listen to this podcast Listen to this podcast

Sybase ASE: 17283 error when trying to extend a database segment?

ASE, Databases, Sybase 1 Comment »

Did you ever receive the error 17283 “Procedure ’sp_extendsegment’, Line 182 ‘tempdev1′ is reserved exclusively as a log device.” error? You can get the 17283 error when there is a device fragment that contains only the log segment. Part of the problem is when you extend the log segment onto a device, it will usually drop all other segments so it becomes ‘log only’.

 device_fragments               size          usage                created             free kbytes
 —————————— ————- ——————– ——————- —————-
 master                                8.0 MB data and log         Dec 16 2004  4:09AM             3376
 tempdev1                           1024.0 MB data and log         Dec 16 2004  7:02AM          1044480
 tempdev1                            256.0 MB data and log         Mar  9 2005 10:49AM           261120
 tempdev1                            256.0 MB log only             Mar  9 2005 10:54AM not applicable
 tempdev1                            488.0 MB data and log         Mar  9 2005 12:10PM           497760
 tempdev1                            256.0 MB data and log         Mar 11 2005  2:03PM           261120
 tempdev1                            244.0 MB data and log         Mar 11 2005  3:09PM           248880
 tempdev1                            200.0 MB data and log         Jun  1 2005 12:33PM           204000
 tempdev1                            200.0 MB data and log         Jul  8 2005  2:55PM           203808
 tempdev1                            200.0 MB data and log         Jul 21 2005  2:54PM           204000
 tempdev1                           1000.0 MB data and log         Feb  6 2006  1:11PM          1020000

So, how to fix this? Well, Sybase doesn’t provide any way to do so without modifying the system tables.

USE master
EXEC SP_CONFIGURE "allow updates", 1
go
BEGIN TRAN
go
– since we are dealing with tempdb and we want data and log on all the device fragments, we can make a blanket update.  We would make the update more selective if we had other requirements (update only one row or something)
UPDATE sysusages SET segmap = 7 WHERE dbid = DB_ID("tempdb")
go
– if the number of rows updated exceed the number of rows for the database, issue a ‘rollback’
SELECT segmap FROM sysusages WHERE dbid = DB_ID("tempdb")
go
– all good?  if so, issue a ‘commit’
COMMIT TRAN
go
EXEC SP_CONFIGURE "allow updates", 0
go
– Now that the system table is updated, we need to refresh the dbtable memory structure so that the changes we made become ‘live’
DBCC dbrepair(tempdb, remap)
go

That’s it! It’s fixed and running with the segmaps without having to restart ASE. Wasn’t that easy?

Listen to this podcast Listen to this podcast

ASE 12.5.x (64bit) and ASE 15 fail to start using GLIBC

ASE, Linux, OS, Sybase 7 Comments »

If you are going to be using ASE 12.5 or ASE 15 with the upcoming Red Hat Enterprise Linux 5.0, there are two CRs that you need to know about:

  1. CR 450004 - XP Server and Backupserver (64bit)
  2. CR 432482 - ASE 15

The problem is the result of using the jmp() and longjmp() functions in the GNU C Library version 2.4 (glibc 2.4).

setjmp() and longjmp() are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. setjmp() saves the stack context/environment in env for later use by longjmp(). The stack context will be invalidated if the function which called setjmp() returns.

Starting in glibc 2.4, the jmpbuf is unavailable due to a security exploit known for several years.  Restricting access to the jmpbuf was an effort by the glibc maintainers to ‘close this hole’ by forcing the application writers to use the sigsetjmp() and siglongjmp() instead.

The problem with using sigsetjmp() and siglongjmp() is that they aren’t thread safe.  This is supposed to be fixed in glibc 2.6 according to a contact at Sybase but Sybase *does* have a workaround for this issue and will be putting it into the ASE v15 codeline when they perform the RHEL 5 certification sometime next year.

I wasn’t able to find much information the supposed exploit.  I only found a few newsgroup posts that didn’t provide any details.

Read the rest of this entry »

Listen to this podcast Listen to this podcast