Freedom of the Press

2009-07-10

As A. J. Liebling put it:

Freedom of the press is limited to those who own one.

I wonder how he’d modernize that quote today, where almost anyone can say anything and reach almost everyone with the internet. And for almost nothing.
As a journalist he might say:

Freedom of the press is unlimited on the Internet. But some authors should have the good taste to limit themselves.

As you probably know, I don’t feel that way!


SQL Server copy_only backup and restore

2009-07-9

Previously I wrote an article listing information on SQL Server backups. I want to expand a little on the practical use of the new and useful copy_only backup available in SQL Server 2005 and 2008. You can’t get to copy_only backups/restores through the Management Studio for SQL Server 2005 (you have to use T-SQL) but you can using the new Management Studio for SQL Server 2008.

This is an ideal way to test production db’s on a development server without disrupting your normal backup schedule. In the following example I am doing a full db backup to the production backup drive:

BACKUP DATABASE [my_db]
TO DISK = N'Z:\backup\my_db_copyonly.bak'
WITH
NOFORMAT,
INIT,
copy_only,
NAME = N'my_db-Full Database CopyOnly Backup',
SKIP,
NOREWIND,
NOUNLOAD,
STATS = 10
GO

But when I restore it I would want to be sure that I’m moving the db files to the correct location on my development SQL Server, hence the WITH MOVE subcommands below.   I always want it to have a completely new name:

RESTORE DATABASE [my_db_copy]
FROM DISK = N'Z:\backup\my_db_copyonly.bak'
WITH
MOVE 'my_db_dat' TO 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\my_db_copydat.mdf',
MOVE 'my_db_log' TO 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\my_db_copylog.ldf',
FILE = 1,
NOUNLOAD,
REPLACE,
STATS = 10
GO

So now I have an up-to-date version of the production db on my system. Bear in mind that any logins for applications or users that are necessary would need to be recreated to be able work with this new copy. I keep a special login/user script handy and run it to recreate these.


Best Black Bean Soup

2009-07-6

I visited Puerto Rico years ago on a business trip and asked a waiter at the hotel restaurant to give me some suggestions for some local specialties from the menu. He recommended plantain fries and black bean soup both of which I ordered. I enjoyed these so much I ordered them again the next day.
On my return back to Canada I tried to duplicate what I had discovered for my family. The plantain was difficult as we don’t want to get a deep fat fryer for health reasons but the black bean soup was amazingly easy. My favourite recipe book The New James Beard did have black bean soup but the ingredients would be hard to come by. No, I found the best recipe at the Kraft website here.
My kids, normally not big soup fans, love it so it must be good!
Highly recommended.


Fed Up

2009-07-4

I went to see Up at the Galaxy, here in Guelph, tonight. As soon as I was about to pay the cashier tells me it isn’t 3D… it’s just the regular 2D Up. The family and I walked out. I rarely go to see a film in a theatre anymore: it’s too expensive and not as comfortable as my living room. But a Pixar film that’s 3D! That’s worth seeing and I was excited to see the Galaxy website said it was still on. The jerks didn’t say it wasn’t being shown in 3D on the website, though. Wanted to get people coming out by hook or by being a crook.
I was very disappointed. It was a treat, several months back, seeing Coraline in 3D.


Roofing at Chris’ house

2009-07-1

I’m roofing at Chris’ house and entering this with the Blackberry from the roof!


The Day the Earth Stood Still

2009-06-29

In anticipation of seeing this new remake directed by Scott Derrickson I showed the original 1951 version to the kids. For all the money and special effects, the new movie had very little of the impact of Robert Wise’s classic film. It was merely an interesting effects vehicle and not worth the price of admission. You can buy the DVD if you must but be sure you get the one that includes the original film even though it doesn’t have many special features. I’m glad I waited for the library to get it before seeing it.
Keanu Reeves as Klaatu, Jennifer Connelly as Dr. Helen Benson along with Kathy Bates as the Secretary of Defense (Regina Jackson) and John Cleese as Professor Barnhardt were all good but the sum of the parts now just wasn’t gripping or revolutionary. One obvious lack was the whole relationship developed between Klaatu and the boy Bobby. This is, I believe, how Klaatu is originally won over. And the heroism of Helen, his mother, when she tries to save the alien and the world in the end. Just completely absent. And for those poor people who haven’t seen the original, I doubt the meaning behind the title is even remotely possible to make out.
So see the original which, though over 50 years old, I still say is very highly recommended. And if you must watch the remake be sure you don’t pay too much for the sad thing.


The future of computers

2009-06-27

I listened to CBC radio today and heard an interview with Daniel H. Wilson who is the author of “Where’s My Jetpack?: A Guide to the Amazing Science Fiction Future that Never Arrived“. The point that Wilson made was that some of the scientific breakthroughs we keep waiting for may have already been made. The jetpack, for example, was invented long ago but just isn’t of practical use today. On the other hand we’re surrounded by objects that few predicted but would have boggled our imaginations a handful of years before their invention like the microwave oven, the iPod or the netbook computer.
But what about the computer? What’s in its future?
Obviously the trend is for more powerful computing to be crammed into tinier and tinier packages. This will eventually mean, I think, that we will be attaching our computing devices to ourselves at some point. People already don’t want to be parted from their cell phone, iPod and other computational devices. Perhaps there will come a time when these are embedded in our forearms.
Provide networking and we suddenly remove the need for the cell phone. Add in voice activation (which Google is creating huge databases to support already) and the keyboard and mouse goes. Of course some researchers are working on using brain waves for input so we may be able to bypass voice altogether.


Double Agent

2009-06-17

Closed to poetry
I come, expectant, to a moment
where prose just won’t work.
So I sit and wait.

Is the muse jealous of my stories?
Is the rhythm lost?
The stream damned?

It’s such a leap
and I tense those muscles
to cross from something like a simile
to a metaphor unbound.

But I learn the lack doesn’t sit elsewhere.
I’m the one who’s out of touch.

The flow is still there.
But what is left to betray?

–2009/6/17–


Dangerous driving by a City bus driver

2009-06-16

This morning a bus cut me off in the lane I was biking to work in. I was shocked at the cavalier attitude of the driver and decided to take action. Here is the body of an e-mail I sent to the transit authority in Guelph with a copy to the Mayor (who also rides her bike to work), the City Administrator and the two representatives for my Ward:

To whom it may concern,

I commute daily by bicycle to work year round and the most consistently dangerous situation on the road I experience are City bus drivers who have no idea about what it is to share the road. This morning I had enough. I have decided to document each case of City bus aggression that I encounter.

This morning (20090616) at 7:40 I was cycling west on Stone Road West between Edinburgh Road South and Scottsdale Drive when the 52 bus (#218) started to pass me in the right lane with only a few inches to spare and then swerved even closer to the right side of the road cutting me off. I was forced to swerve to the right. I can think of no reason why the driver would have performed such a dangerous manoeuver outside of aggression. There was no one at the bus stop ahead and the driver didn’t stop before he or she changed into the left lane to turn onto Scottsdale.

If this e-mail isn’t sufficient I would like you to let me know how I can formally lodge a complaint against this driver. I have encountered lots of aggressive drivers in almost a decade of daily biking but, day to day, most City bus drivers obey the rules of the road and drive appropriately. So I realise my experience today was unusual but it is that kind of driver who needs to be counselled or simply taken off the road to work in some less dangerous job before another cyclist is killed. I will await your reply for a reasonable amount of time before pursuing other avenues.

Sincerely,

Terry Grignon
Ward 2

Nothing may happen, of course, but I am hopeful that something good will come out of my ‘action’. Guelph is trying to promote cycling as a way to cut down on the carbon emissions, traffic and all that goes with overuse of the internal combustion engine. Educating our transit people about sharing the road with bicycles should be at the top of the list of to do’s if the City is serious about this, in my opinion.


SQL Server 2005 Disaster Recovery

2009-06-10

First, screaming and running around in a circle might help alleviate the built up tension. Especially if you don’t have a good and tested plan.

If we’re dealing with a Simple Recovery Model database, we can restore the full backup followed by the latest differential. Here’s an example of that:

restore database [my_db]
from disk = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\my_db\my_db_backup_200904262300.bak-f'
with file = 1, nounload, replace, norecovery
go
--to restore to the 4PM backup
restore database [my_db]
from disk = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\my_db\my_db_backup_200904271100.bak-d'
with file = 1, nounload, recovery
go

If we’re dealing with the demo db as it exists now (Full Recovery Model). We want to do a tail-log backup first followed by a full backup restore, then a log restore (if that applies and end with the tail-log restore. Here’s an example of that:

backup log demo
to disk = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\demo\demo_backup_tail.bak'
with no_truncate
go
restore database demo
from disk = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\demo\demo_backup_200904252350.bakf'
with file = 1, nounload, stats = 10, norecovery
go
restore log demo
from disk = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\demo\demo_backup_200904261600.trn'
with file=1, norecovery
go
restore log demo
from disk = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\demo\demo_backup_tail.bak'
with file=1, recovery
go

Of course no disaster recovery plan is worth anything unless it has been tested. This is one of the major flaws with our installation. The other big one, is that we don’t have a fully workable plan yet.
Recovering from a dead Master db
A dead Master db is a very nasty thing to have happen and can be difficult to restore. You’ll be able to diagnose this problem because the SQL Server service cannot be started. If the corruption had happened in other system db’s and not master then you could still get on and restore the others (msdb, model, etc.) but master is a special case. It contains meta data on all the db’s and SQL Server only knows the other db’s exist through it.
If you have a corrupt master then you may need to re-install SQL Server. Fortunately there’s a way to do this that disrupts the other db’s in a minimal way:

start /wait e:\setup.exe
/qn
INSTANCENAME = MSSQLServer
REINSTALL = SQL_Engine
REBUILDDATABASE = 1
SAPWD = 'Pa$$w0rd'

Note that the password doesn’t really matter since it is only temporary. Then you can restore the old Master if you have a backup (you should backup your master db once a day):

restore database master
from disk = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\master\master_backup_200904262245.bak'

An alternative is to have a recent copy of Master.mdf and .ldf (you have to shut down SQL Server to get it) and then simply attach it. But this has to be ‘recent’ enough to have most of your db information intact. If only a few db’s are ‘new’ or ‘modified’ then this may be an advisable way to restore. Attaching a db is much more efficient and quicker than restoring one from backup. So you’d only have to attach the new db’s and set up any Management admin again for them.