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

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.

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

This the story of the future empress of the known universe, Miriam:

No c-section.
from the point of the view of the hubby of the Becca

Sunday morning:

4am – Becca wakes up with cramping that squishes the munchkin’s noggin
5am – Becca gives up on sleep and starts wandering to the basement to watch her bad tv shows (Travel Channel and Discovery’s Planet Earth – no nooky or t&a = bad tv 😉
8am – Mom of the Becca wakes up and they start watching tv together
9am – Dad of the Becca wakes up and wonders where his fried eggs are. Tries to convince the mom of the Becca to make fried eggs. Becca tells story of Becca’s hubby’s childhood Christmas breakfast of waffles. Mom of the Becca offers to make waffles. Becca is overjoyed and dad of the Becca reluctantly gives in because else his life would very very short
10am – Waffles!!
NOON – Hubby of the Becca opens one eye.
12:01pm – Hubby of the Becca closes one eye
12:15pm – Dad of the Becca pokes head into the bedroom and grumbles about the waffles to the hubby of the Becca
12:20pm – Dad of the Becca, when getting absolutely no response from the hubby of the Becca, wanders away and toots on the way downstairs
12:30pm – Hubby of the Becca wakes up stumbles downstairs
1pm – Megan arrives
5pm – Nate arrives
6pm – we eat
7pm – the Becca is very uncomfortable but doesn’t want to call the doc
9:15pm – the Becca’s contractions are pretty close (3 minutes or so). We convince the Becca to call the doc
9:16pm – the Doc says, “She needs to go to the hospital!”
9:20pm – hubby of the Becca starts the car and tries to leave for the hospital without the Becca. Mother of the Becca and Becca jump in the car before the hubby of the Becca leaves without them
9:40pm – caught by train
9:45pm – Father of the Becca saves the day by providing an alternate route (he drove the other car and the roads were still covered in snow and ice)
10pm – Arrive at the hospital
10:15pm – The Becca is 5cm dilated and dehydrated.
10:20pm – The Becca receives an IV and some staydall
MIDNIGHT – The Becca is at 8cm – nurse calls for 2nd opinion (to be on the safe side)
12:05am – The Becca is at 9cm – Doc is called in
12:10am – The Becca is at 10cm and ready to push
12:15am – 1:00am – The Becca is pushing
1:01am – The munchkin is born

Share Button

I’m taking a daddy break: Duke Nukem Forever Trailer


Share Button

Miriam Nicole Froebe

Miriam Nicole Froebe
7lb 12 ounces
19.5 inches
born December 17th, 2007 at 1:01 am CST

She’s at St. Francis hospital in Blue Island

First set of photos at the hospital 🙂

For those of you that don’t know, you can see the original size photo by clicking on a photo, click on “All Sizes”, click on “Original”. Why would you want the original size? To print out the photos of course!

Flickr also will print out the photos and mail them to you if you click on “Prints & More”.

Share Button

Morgan Webb: Back to School edition of Webbalert

I’ve been watching the Webbalert podcast starring Morgan Webb lately. This back to school episode is hilarious! First the full episode followed by the full lecture video.The full Teacher’s Melody video:

Share Button

I’ve been nabbed!

Those dastardly fiends at work 🙂 threw a baby shower for Rod (a coworker) and me. Here are some photos. More to follow.

Share Button

Duplicate rows in sysusers??

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 = 0x10000
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
use db_with_8419

select * into tempdb..temp_sysusers from sysusers

select uid, cnt= count(*) 
  into tempdb..temp_uid 
  from tempdb..temp_sysusers 
 group by uid 
 having count(*) > 1

select s.uid, s.suid
  into tempdb..temp_fixuid 
  from tempdb..temp_sysusers s, tempdb..temp_uid t
 where s.uid = t.uid

select uid, min(suid) suid
  into tempdb..temp_rmuid
  from tempdb..temp_fixuid
 group by uid

delete tempdb..temp_fixuid
  from tempdb..temp_fixuid f, tempdb..temp_rmuid r
 where f.uid = r.uid
   and f.suid = r.suid

alter table tempdb..temp_fixuid add cntr int identity

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

use master

dump database db_with_8419 to "compress::N::/DumpLocation/dumpfilename.dmp"
load database db_with_8419 from "compress::/DumpLocation/dumpfilename.dmp"
online database db_with_8419

sp_configure "allow updates", 0

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

sp_configure "allow updates", 1 
update ..sysobjects 
set sysstat = 115, type = "U" 
where name = "sysusers" 

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

use dbname

create unique index ncsysusers2 on sysusers(uid) 

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) 

Now identify any duplicates that may exist in sysusers:

select uid, name, count(*) 
from sysusers 
group by uid 
having count(*) > 1 

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

create unique index ncsysusers2 on sysusers(uid) 

Now, clean up after yourself:

update ..sysobjects 
set sysstat = 113, type = "S" 
where name = "sysusers" 

sp_configure "allow updates", 0 

Sybase has created bug # 298620 for this issue.

Share Button

Sybase Replication Server: Out of Mutexes? wtf?

For those of us that use Sybase’s Replication Server, we have long ago been pacified into believing that there really isn’t much that can be done with Replication Server’s quirks but to endure them.

In today’s edition of the Sybase RepServer Quirks we take a look at the “out of mutexes” error.  A mutex is an exclusive lock on a resource.  If you receive an error about RepServer running out of mutexes, you just don’t have enough defined through RepServer.  Simple huh?

Of course it is.  Ahh..  but then how do how many mutexes your particular Sybase RepServer needs?  How many grains of sand are on the moon?  According to Sybase you should know this already but since you can’t read minds (I hope you can’t because I’m thinking of donuts and not RepServer), I’ll pass on what Sybase is saying when pressed about it (Greg Carter @ Sybase):

> Just to elaborate a bit more on this question of the number of mutexes; as
> you probably know the mutex requirements for RepServer increased
> dramatically with the SMP feature. I have since struggled to come up with a
> formula for estimating mutex requirements so that you may properly set the
> “num_mutexes” configuration. While in the latest iteration of this formula
> I have satisfied myself that all mutexes have been accounted for, still the
> estimate it provides seems to fall short in some cases.
> Recent investigations by Connectivity seem to indicate that the problem may
> not be with sizing mutex requirements, but rather with sizing message queue
> (“num_msgqueues”) requirements. It appears that Open Server may be using
> the total of the settings for “num_mutexes” and “num_msgqueues” as the
> upper bound for the creation of these two objects together. So it may be
> that even though “num_mutexes” has been sized properly, if “num_msgqueues”
> is too low then you may see a message regarding the failure to create a
> mutex or the failure to create a message queue depending on which one was
> being created at the time that upper bound was surpassed.
> The moral here is that until Open Server resolves this issue you need to
> verify the sizing of both “num_mutexes” and “num_msgqueues” in the event
> that either error message appears since you can not rely on the message to
> indicate which one is low.
> For your convenience I’ll include here the latest formulas for estimating
> mutex and message queue requirements. Note that the one for mutexes may not
> agree completely with the one that is given in the 12.6 SMP White Paper – I
> have not compared them.
> Mutex requirements for the optimized binary:
> num_mutexes = 75 + Num(partitions) + 4*Num(DSI/S) + 3*Num(DSI/E) +
> 2*Num(Dist) + 2*Num(RepAgent Exec) + 2*Num(RSI User) + 5*Num(Queues) +
> 5*Num(SQT Cache) + Num(rs_subscriptions rows) + Num(RSSD tables) +
> Setting(cm_max_connections) +
> 2*MAX(Admin connections) + 2*Num(Other Connections) + Num(Origins) +
> 2*Num(Threads) + MAX(subscription (de)mat)
> Where
> – “Other Connections” are connection to this RepServer including ID Server
> connections, RSM connections, etc.
> – “Origins” are the different origins (or primary databases) that could
> possibly have transactions flowing through this RepServer, whether by a
> RepAgent or by a route (intermediate included)
> – “Threads” includes every thread RepServer may start. These are the
> “Global” thread, the “Initialization” thread, threads for each of the
> daemons (dAIO, dCM, dVersion, dRec, dSub, dStats, dAlarm), RepAgent User
> threads, SQM Writer threads, SQT threads, Distributor threads, DSI/S and
> DSI/E threads, RSI User and RSI threads.
> – “subscription (de)mat” is the number of asynchronous subscription
> management requests for materializing or dematerializing that may be taking
> place at any moment.
> Note: For the diagnostic binary you will need to double the figure
> determined with the above formula.
> Message queue requirements for the optimized and diagnostic binary:
> num_msgqueues = 10 + Num(DSI/S) + Num(DSI/E) + Num(Queues) + Num(Dist)
> Thanks,
> G.Carter

Neither this explanation or the two equations are anywhere in the manuals.  I’ve opened feature request 485482 for RepServer to handle this automagically as there really is NO NEED for a RepServer admin to have to worry about this.  If you are or ever have run into this problem, give Sybase a holler and tell them to fix this bug.

Share Button

How to fix your parents’ Windows computer remotely

Save yourself a headache and use the OneClick VNC Utility from VNCScan.com. The geeks of Hak5, in episode 3×05, demonstrate just how easy it is. The steps are very simple:


  1. edit the settings.ini file to include your domain name or ip address. Hint: use a dynamic DNS service like DynDNS (free!) to give yourself a DNS name like mywifeisdueanytime.dyndns.org
  2. forward incoming VNC traffic to your home computer
  3. use Paquet Builder to bundle the settings.ini and the OneClick VNC Utility into a single executable
  4. Put the executable somewhere on your website

Your parents:

  1. download the executable and double click on it

You now have control of their computer so you can fix whatever issue they are having.  The free version of LogMeIn should also work fine.

Share Button