Thursday, May 17, 2012

My Experience with SQL Server 2005 Database Engine Tuning Advisor

I won't go into the how-to's for using SQL Server DBTA.  There are many out there of higher quality than I would produce, most notably:
http://msdn.microsoft.com/en-us/library/ms173494(v=sql.105).aspx

There are also several blogs with good info.

I want to relate some specifics of my recent experience.


I executed both the turning advisor and the activity monitor from a separate instance of SQL server.  My rationale for this was to distribute the workload across these two devices, thus hopefully minimizing the impact to the server that was being profiled.

Several observations:

1.       While the activity monitor will store trace data on the local server, the database tuning advisor will run its analysis and consume resources on the server that is being targeted.  This eventually lead to issues as the memory resources for the server in question were consumed.

2.       It is important to keep the workload being analyzed as small as possible.  The analysis runs for a very long time.

3.       It is important to disable the timeout value.  I had several analysis runs that ran for over an hour and a timed out, producing no recommendations.

4.       It appears possible that prior analyses which are left open continue to consume resources.  By resources, I mean resources on the server are being analyzed, not the server that is running the tuning advisor.

All of that said, the SQL server database tuning advisor is a fantastic tool.  It was able to recommend new indexes and statistics that improved our entire batch cycle time by almost 50%.


Tuesday, May 08, 2012

Problems docking and undocking HP 6910p laptop


I've had quite a number of issues with docking and undocking my JP 6910p on Windows XP, and later on Windows 7.

On Windows 7, I've found that, when it won't recognize my sound or display, I can OFTEN (not always) execute the following procedure to clear things up:
1 - lock the laptop by holding the Windows key and pressing L 
2 - switch users by holding alt and pressing W

The magic here is in the switch users - it must cause the laptop to re-detect, as it then USUALLY (again, not always) figures out where to route its display and sound.

Wednesday, April 25, 2012

Putting Away Childish Things

I've written about this before, but I again return to it tonight.

It's interesting, as we grow, I mean REALLY grow, spiritually, how the things in which we once took comfort are now out of reach.  I use the phrase "out of reach" deliberately.

I feel betrayed.  I feel hurt.  I feel devastated, to a degree and proportion that I don't know quite how to describe.

In times past, when my feelings like this arose, even to a much lesser extent than now, I reached for anger.  Rage.  I "let the beast out", meaning the animal within.  The part of me that was nothing but a mammal, cornered and injured and ready to make you bleed before I inevitably succumbed to your jaws.

Tonight, I felt a special release to return to that.  Not sure how to describe it.  It was like God saying "yeah, you know what, it's been a spectacularly rough 4 months or so.  Go for it.  We'll pick back up tomorrow."  But when I reached for that, when I started down that path, my spirit bore such strong witness against it, that I don't  couldn't get there.

Of course, this is wonderful.  But, if I'm to be completely honest, it also hurts a bit.  We have to be willing to lose that part of ourselves, and it's taken me a good, solid 20 years to accomplish this one, if, in point of fact, I can really claim I'm there.

It's like a part of my youth that is gone, a bit like when you realize that you'll never hang out at the camp ground with the guys talking about girls again, or when you realize that you're doing things to be cute but no one thinks you're cute anymore, or when you want to sit in Mom's lap but you're too big.

I suppose this is what is meant, at least in part, by putting away childish things.  There's a sort of death that happens.  It sounds crazy, but I morn my anger.  I don't need it anymore.  I don't want it anymore.  But part of me, just part of me, still wants to disappear into that blackness for just a while.

Thank you God, for clearly demonstrating to me that I'm not the man today that I have been.  I can't wait to see what the next 20 years brings...

Saturday, April 07, 2012

The first word of Christ ...

If we accept Markan Primacy, then the first words of Christ recorded in the bible are as follows:

“The time has come,” he said. “The kingdom of God has come near. Repent and believe the good news!"

What a truly, truly wonderful thought.

I have an idea.  Let's preach this:  The time has come.  The kingdom of God has come near.  Repent, and believe the good news.  :-D


Tuesday, April 03, 2012

A couple things I learned about databases today

1 - In DB2, the following pseudocode doesn't work:
define cursor
open cursor
while (not end of cursor)
   make table update
   commit;
 end-while
close cursor

The reason?  The "commit;" statement closes your cursor!  you'll have to commit after exiting your loop.

2 - In SQL Server, you can end up with a database that has no owner.  (!)
To correct this, us the sp_changedbowner system stored procedure.
example: sp_changedbowner 'sa'

A more thorough treatment of this topic can be found here.

Crazy ...

Tuesday, January 10, 2012

Bleed the Freak


It's funny, but every time in my entire career that I've faced a you-can't-get-there-from-here when writing code, it's been resolved by listening to Alice in Chains.  Tonight's song: Bleed the Freak

I honestly have no idea what to think of that.

Oh, well.  At any rate, another life saved ;-)>.  Who knew that, when writing a db2 stored procedure,  Get Diagnostics ROW_COUNT could be confused by a variable assignment within the select statement.  Now I know.

Here's the code snippet in case anyone stumbles across this and needs it.  Hopefully it's clear.  v_vTable and SWV_RowCount were previously declared, as was v_last_block.:
--    The following is absolutely terrible, but GET DIAGNOSTICS ROW_COUNT simply would not work!!! 
--    It was returning 0 no matter what, perhaps confused by the INTO clause?

SET SWV_RowCount = (select count(N_OID_LST) FROM OID_MGMT WHERE C_OID_CL_ABR = v_vTable);
--      GET DIAGNOSTICS SWV_RowCount = ROW_COUNT;   
select N_OID_LST into v_last_block FROM OID_MGMT WHERE C_OID_CL_ABR = v_vTable;

Friday, January 06, 2012

A note for those who mourn

A note for those who mourn:

My grandma, who raised me and was basically my mamma, died in 1991. When I think of her, it still does something to me that I don't quite have words to express, so much so that I have trouble writing this through the tears that her memory brings.

As the years have passed, I've come to view as something really beautiful the fact that one person can love another person so deeply, and that 20 years after her passing, she's still so real, and so present in my life as to inspire such a powerful reaction.  Missing someone a lot reminds you that you loved them a lot, and reassures you that you still do.  I hope I'm always able to enjoy that deep-in-my-bones kind of sadness as an expression of my love for her, until the day I see her again.

Time doesn't heal that hurt, but that's a good thing.  What time DOES do is alter the character of the pain, morphing it from an intense, shrill, constant, and at times overwhelming pain in places you didn't even know existed, into a deep-in-the-bones ache that appears and then subsides, and that is actually sort of beautiful, as odd as that sounds; something like Sarah Mclachlan's "glorious sadness".

I hope that hurt never heals.  I hope I'm always able to shed a few tears and, for a moment now and then, enjoy that glorious sadness as an expression of my love for my grandma, until the day I see her again.

Get Restart log using PowerShell

I'm often curious about a restart on a Windows server system. An easy way to get a list of the restart and what initiated it is to use t...