Showing posts with label SQL Server 2005. Show all posts
Showing posts with label SQL Server 2005. Show all posts

Tuesday, June 09, 2009

SQL & Socks

Firstly, the techie stuff (as I'm also watching Star Trek) and woolly stuff later on down.

Geek Stuff

I've been troubled with heat, slow speed, program lockups, and general vanishing hard-disk space on my laptop. I run MS SQL Server 2005 and VS 2005 on this machine for development, and, more and more often, running both intrfaces has locked them, with one or the other usurping the processor, taking 97%+ of cpu time.

This evening I was checking disk ocupancy to try to discover why I was running out of space. I was using a copy of FolderSizes, and found that at some time in the past I had been experimenting with scheduling backups for a database, and obviously never turned it off. Now turned off, I've removed several GB of backup files and life is better.

Something else I saw was that the log file from one database, itself 2 GB in size, had increased to about 25 GB, causing my system to run short. Truncating the log file got it back down to 2 MB! Here's the code:

use DataBaseName

backup log
DataBaseName with truncate_only

dbcc shrinkfile (
DataBaseName_log, 1)

This is definitely a wake-up call for all of you small-system DBAs: SQL Server documentation is quite clear that the database retains the log data until you clear it out. What the docs cannot tell you is how big it will get nor how quickly it will grow - that is totally up to your application. I managed to use up 25GB because I started with 2 GB of data and spent about a month doing analyses on it. Pretty soon I'll be able to get rid of the original database itself - phew!

Food

Here's something nice to eat. It should take you about 30 - 45 minutes from the time you enter the kitchen to the time you're mobbed as you sit to eat. It's called Mike's Bacon-wrapped Chicken, and I serve it with corn and couscous. I'm not going to be absolute with quantities - obviously you'll need more for more people.

Firstly, get all your ducks (chickens ?) in a row - this'll make everything go lots quicker, and get you to the table sooner. You'll need a sharp paring knife, tongs (like you might use barbecuing), but not huge, a cooking spatula and spoon. To cook in, a frying pan and two cooking pots. You'll also want 2 or, maybe, 3 bowls to put cut veggies into. Determine what people will want to drink before-hand and arrange someone to handle that for you.

Ingredients

Start with a smallish onion. Peel it and chop it in to pieces about two tenths of an inch in size. Put them into a bowl and reserve. Add about three or four crushed and chopped cloves of garlic to the onion. Chop up one or two peppers (any colour, but one of each is best). Make sure you dump the central area around the stalk, and all the seeds. Reserve them into a bowl (or two, if needed). Get out Rosemary, Thyme, Salt, Pepper, and (optionally) Nutmeg.

Put water into one pot and frozen corn too: put the heat under that to medium. Put some butter into the other pot - again dependent on how many people / how much couscous. You'll need almost a cup of couscous per person, together with chicken broth for the couscous and either white wine or more chick broth for the main dish

Take a chicken breast per person, wash, and dry them (just in case there's bone fragments from butchery). Trim the extra fat off each and cut each breast into roughly 3 or 4 equal-sized pieces. More important than being perfectly equal is that you cut the really thick parts of the breast parallel to the table to try to even up the cooking times for all the pieces. Finally, you'll need some wooden cocktail sticks - about 3 or 4 per chicken breast.

Take out one strip of bacon per piece of chicken but keep it aside with the cocktail sticks.

Cooking

Start medium-high heat under the frying pan and put some cooking oil in to warm. Personally, I use Safflower as it has a high smoke-point, so things get brown nicely, and it also doesn't taste the food much at all. Get the oil reasonably hot and put in the onion and garlic mix in to start cooking.

Once the onion is beginning to look cooked - about a minute or two - add in some salt and pepper, stir up to mix, and then start adding in the chicken. Don't worry if it doesn't all fit in - two stages will be fine. Raise the heat at this point and fry off the chicken for about two - three minutes a side. We want the chicken to be browning now, but not cooking in the middle.

Once the pieces of chicken are browned, take them out (tongs!) and put them on a plate to cool. Put in any that are still waiting and cook them. As soon as the chicken is all done, replace it with the peppers, some Rosemary, Thyme, and Nutmeg, and lower the heat to let them fry gently in the onion and chicken juice.

Meanwhile, take each piece of chicken, wrap a rasher of bacon around it, and pin the bacon on with a cocktail stick. Store in one of the bowls used for the veggies now in the pan.

As soon as the chicken is wrapped, return it all to the pan or, of it won't all fit, get another pot and transfer some of the veggies there, follow with the chicken, and add the rest of the veggies. Not add wine or broth. If in the pan, then about half-way up the pieces of chicken; if in a pot then until you just begin to see the liquid level. Either way, as soon as the liquid is in you should raise the heat to bring it just to the boil before lowering it again to a simmer. We can best keep this simmering for about five minutes or more.

Next, raise the heat on the corn to bring that to the boil before letting it just keep warm.

Now the couscous. This is a starch that cooks incredily quickly, so we can afford to keep it until the very last few minutes. You'll find the butter in the pot: it should be melted by now. Raise the heat to about medium-hot and add the couscous grain. Use a spoon to keep stirring the grain as it gets coated with the butter and starts gaining temperature. If you listen (yes, listen!) to the pot closely you'll be able to hear it start to hiss as it starts to fry. This is fine for a while, but eventually the couscous will start to brown (from a golden-yellow to a brick-red) and tat that stage it gets bitter, so you don't want to go too far!

Once the couscous is hot you can pour in the chicken broth. Start with a cup for two of couscous - as it hits the bottom of the pot there should be a kind of a "whoomph" sound as the broth turns to steam. This is good, as it pushes liquid all through the grain, cooling it quickly. Put enough broth in that all the couscous is in a very slightly soggy mass. Don't be scared to put in too much broth - too little leave "raw" grains with will seem like grit. Take the couscous pot off the heat and continue to stir quite quickly. It will absorb the liquid: if it looks to be too dry then add some more!

Now you are happy, leave it off-heat for a few minutes and turn off the corn, pour it through a sieve, and put into a bowl to serve.

Next, use your tongs to take out the bacon-wrapped chicken from the pot or pan into a serving bowl and raise the temperature under the rest to max. Add more wine or broth if needed: we want a kind of gravy here with lots of bits, so it needs to reduce for a minute or so: to do that it also needs something to reduce from !

While the veggies / broth mix is boiling, take a fork and stir up and finally fluff up the couscous. Pour it into a bowl to serve too: and fluff it up again now. Aerating the grain will let steam percolate better and make sure that grains still in need of moisture can get it.

Now everything else is ready for the table, kill the heat under the veggie-liquid and pour that into a bowl. Bring everything to the dining table to serve.

That may seem like a lot to do, but in all honesty it takes me about 30 minutes to make enough to feed four and have enough for four more little lunches to take to work. Don't expect to do it that fast to begin with - in fact, get someone to read out the instructions to you as you go, to save stopping and finding your place every few seconds.

Yarn

It was the spawn's birthday last week, so among other things, he got a pair of wool short-socks. Well, he will do, when the AG finishes the second one!

We went to Woolbearers last week, so there are three balls of black yarn waiting to go into the AG's Witches Hat for Hallow'een. Tomorrow it's the Grindhouse Café in Haddonfield for Stitch 'n' Bitch. If you're there, come and meet us all.

TTFN

Sunday, December 31, 2006

The Last Day of 2006

It's been a long time, so probably nobody'll read this but me, so that explains why this is a bit monologish. I've just ripped three Michael Chapman CDs that I received as a birthday present. Michael's been a pro guitar player for almost forty years now, and familiarity just seems to breed respect. The problem with being a fan of someone like Michael is that, as nobody'll ever admit to having heard of him, you tend to have to do unusual things - like buy all your CDs from the man himself, as no shop or web site ever carries them, and entering the track names on GraceNote and CDDB yourself, as very often you're the first to be ripping the disc !

With 26 albums of his (I just went and counted !) I suppose you could call me a fan. If anyone has a copy of Americana, though, I'd dearly love to buy it. I have Americana II, and have heard some of Americana's tracks, buy want that CD ! Anyhow, I just got "27 06 05", which is a recording of a concert he did on that data at The Greys in Brighton, which is where I grew up.

For Christmas I got something seriously more modern - Smoke and Mirrors from Marillion, the two albums from the Holiday Weekend in 2005 at Butlins, Minehead. I haven't listened to the double CD Mirrors yet, but Smoke (the single CD) is great.

Recently I've been listening to internet radio instead of CDs, and getting a good strong dose of Prog Rock. Groups such as Sylvan, Frost, and Ayreon especially. I think that these three will certainly feature in my CD buying list in the next few months. Remember that Frost is officially no more, so try to get Milliontown before it's sold out. Sylvan's is a German site: there's also a Dutch band Silvan. Finally in this musical adverts spot, take a look at Heather Nova.

So, I've spent a very large quantity of my spare time since August getting my teeth into VB.NET 2005 together with SQL Server 2005. All I can say is that I'm very thankful that I didn't try in January ! The six months have provided a huge amount of information onto the web for people to find. Even so, I've easily spent $500 on books, as it's impossible to predict what you'll need to know in advance. Finally, however, the effort is beginning to pay off. However, it's been painful at times !

After over a year with an AMD-based machine running Windows XP/64 I suppose that I was getting blasé. I had got to the point of believing that MS tools worked ! After all, I had installed the Express editions of VB and SQL Server with no problems. This feeling of security vanished abruptly when I installed Visual Studio 8. I did all the things that the release notes commanded me to do, and didn't do all the things they commanded me not to do, and then looked at what I had. The install had added a new copy of SQL Server Express, which was not what I wanted . In addition, it wasn't running. In fact, I couldn't find any services connected with VS8 at all !

OK I though - time for a reboot (akthough the install hadn't asked for one). The PC never came back !

Not good !

Eventually, through Safe Mode and the rebuilder, I found that the video drivers had been trashed, but somehow in a way that prevented me from re-installing them. Every time I touched the video software either the screen went blank or else the complete PC just stopped dead.

So, I added a small - 40GB IDE - drive to the machine and unplugged the two 200 GB SATA drives. Fine ! I can recreate a new system. Well, for a week or so, and then it crashed again - "cannot find NTOSKRNL.EXE". Well, I could find it, but I couldn't blow it away and replace it, so that drive was moved down a notch and yet another drive introduced and XP/64 installed.

Now things went better - except that it refuses to boot without the distribution disc in the CD drive ! So my original C: is now D: and my original D: is E:. So none of the original installs work and I've spent countless hours in reinstalling software onto a system that, before Visual Studio, was working extremely well.

The moral of the story appears to be to do development on your second-best machine ! Right now this PC has become a second-best machine !

My other birthday/Christmas/New Year present was a shiny new Acer 9300 laptop with a gleaming expanse of 17" of LCD screen. Seriously neat, and I hope to review it here for you in the next little while.

Meantime, however, my better half is calling ... New Year's Eve festivities are calling. Best wishes and a prosperous New Year to you all.

Found Food

I have published quite a few recipes here on my blog over the last few years, and I hope that all my readers have tried at least some of the...