My thoughts on lots of random things,ranging from Sys Admin and Programming, through to Travel and Lifestyle.
March 20, 2012 by Mícheál

Migrating a SQL Express 2005 to Another Server

Having only limited DBA skills (99.9% of what I do with SQL is reporting), I ran in to some issues when I had to migrate a couple of small DBs from a win 2k3 box to a Win 7 (64-bit). I spent a few minutes trying to remember how to do this (haven’t done it in about 5 years), and settled for a simple backup/restore.

So first I ran the backup script that I use nightly, then just copied to the new box (on which I had already installed SQL 2005 Express and the management tools). From here I tried to simply do a “restore database”, but when I did I received the following error:

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Smo)

I did some digging and figured out that the simplest way to resolve this was to just create a new file location for the backup destination. I also coiped my backup script and changed the NOFORMAT option to FORMAT

DECLARE @DBName varchar(255)

DECLARE @DATABASES_Fetch int

DECLARE DATABASES_CURSOR CURSOR FOR
    select
        DATABASE_NAME   = db_name(s_mf.database_id)
    from
        sys.master_files s_mf
    where
       -- ONLINE
        s_mf.state = 0 

       -- Only look at databases to which we have access
    and has_dbaccess(db_name(s_mf.database_id)) = 1 

        -- Not master, tempdb or model
    and db_name(s_mf.database_id) not in ('Master','tempdb','model')
    group by s_mf.database_id
    order by 1

OPEN DATABASES_CURSOR

FETCH NEXT FROM DATABASES_CURSOR INTO @DBName

WHILE @@FETCH_STATUS = 0
BEGIN
    declare @DBFileName varchar(256)    
    set @DBFileName = datename(dw, getdate()) + ' - ' + 
                       replace(replace(@DBName,':','_'),'','_')

    exec ('BACKUP DATABASE [' + @DBName + '] TO  DISK = N''e:migration' + 
        @DBFileName + ''' WITH FORMAT, INIT,  NAME = N''' + 
        @DBName + '-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD,  STATS = 100')

    FETCH NEXT FROM DATABASES_CURSOR INTO @DBName
END

CLOSE DATABASES_CURSOR
DEALLOCATE DATABASES_CURSOR

And the batch file that I use to schedule the script:

sqlcmd -S .sql_db_name -i Backup_tables.sql
pause

Next I reran the script, and did a restore from the new files (remembering to change the options to update filepaths if necessary!), and this time it worked perfectly.

  •   •   •   •   •
March 11, 2012 by Mícheál

Odd Windows XP Installation Error

Got an error 8192 while trying to downgrade (upgrade really) a windows Vista machine to Windows XP file \ie386\ntkrnlmp.exe could not be loaded.

I was doing the downgrade because Vista had never really worked properly on this machine, and lately performance was exceptionally bad.  I tried to run a HP-Compaq windows Xp Sp3 install disc and got the error. I thought first it must be a RAM problem, but it passed both the vista memory error check, and then passed the BIOS memory and HDD diagnostics with zero errors.

So next I tried a different HP-Compaq disc, but this time running XP SP2, and it worked first time! Pretty surprising, never had any Sp3 over Sp2 issues before

 

  •   •   •   •   •
March 8, 2012 by Mícheál

Refreshing My Bose Headphones

For the last four years I’ve used both in-ear and on-ear Bose headphones. Twice I’ve had to replace the in-ear phones (both times for free under the Bose warranty, I use them a lot so the cables tend to break internally), but when my on-ear phones started to show signs of waer and tear I considered changing them for a set of new Bose headphones, preferably a noise cancelling pair. But since I’m not made of money (with all the iPad stuff i’ve been buying, along with a new laptop). I decided to go down another route: a simple refurb.

Bose on-ear headphones

Before: old, tattered cushions and damaged cable

Initially I was only going to order a new cable, with the built in mic for use with the iPhone (fortunately the Bose design means it’s only a a 3.5mm jack on the headphones itself). But alas customer service told me I that wouldn’t work on my old headphones (I had  tried my local Bose suppliers but they said it would be cheaper and quicker to contact Bose directly). So a normal cable was ordered from the customer service (less than €6 for a 5 ft cable). And since I’m planning on keeping the headphones for another couple of years i also ordered some new ear cushions (€27) as the old ones were really tattered.

There was a delay of a few weeks waiting for the new parts to arrive, but once they did it was a simple 1 minute job to change the cushions, et voila : effectively new headphones for €35 as opposed to €150 for the equivalent new model OE2 headphones from the same company.  €35 mightn’t be very cheap compared to buying a new set of cheaper cans, but I’m expecting to get another few years out of these, so for that I consider it a bargain.

Bose On-Ear heaphones, after the refurb

After : as good as new!

  •   •   •   •   •
March 6, 2012 by Mícheál

My iPad 2 Set-Up

I originally wanted to get the iPad for my Masters, both as a testbed for the thesis I’m working on, and as a secondary screen for watching Adobe Connect sessions on, as well a PDF reader. As for other uses, I was actually skeptical that it would be really useful for anything other than a toy. But with the right combination of accessories it’s actually quite versatile and I find that we use it for many things that I hadn’t considered.

The Right Gear

The first 2 things I knew I would need were:

  • a cover/stand
  • and a screen protector (a clear film that protects the screen)

Re the case and stand Otterbox were the first brand that came to mind. I’ve used it before on my iPhone, and while the bulky case adds weight and detracts from the aesthetics for my money that’s a price worth paying for the extra protection on the iPad (well, that and €70!). In the 2 months I’ve used it I’ve been very happy with the case, and the main screen cover also doubles as a stand that allows viewing at 30 and 60 degrees. One downside is that when used as a cover this rubs against the screen, and I’d worry that this could in fact actually end up damaging rather than protecting the screen.

If you order from Otterbox directly it also ships with a screen protector, although in the end I opted for a different option and coughed up for a Zagg invisibleSHIELD (I got the Otterbox and Zagg seperately on eBay and it came to approx the same amount). Obviously because it’s much bigger than an iPhone screen it was much trickier to fit to the iPad, but I eventually got it on (although it took several attempts to get the Otterbox back on as the film kept lifting at the edges while the case was slid over).

In the first post where I decied to get the iPad I also mentioned that I might also get a keyboard, but instead of going for an Apple I went for a a Logitech iPad keyboard, due mainly to better  reviews on various, and so far I’m impressed. The keyboard itself doesn’t weight much (at least the weight of the keyboard and iPad is less than a laptop), and the case can double as a stand if you haven’t already got one. But the main reason I went for it is the keys are nice and smooth. For the vast majority of web browsing and multimedia stuff the keyboard isn’t necessary at all, but if you need to do any bit of word processing it’s a must, but I’ll go on to that in a second.

ipad, keyboard, espresso

Watching the rugby live, with keyboard for a bit of blogging.

A Really Useful TV

One the things that we end up using it for (a lot!) is as a secondary TV. I don’t have a regular TV service in the house, but the 20mb broadband allows “us to use apps like the RTE player and Netflix on both the  laptop and PS3. But given the excellent battery life, and the fact that both of these are available as iPad apps, the iPad is unbeleivably useful as a “TV”. Add in a pair of decent headphones and we can both sit on the couch and watch 2 completely different things at the same time. Domestic bliss! And because the iPad doesn’t need cables it’s no problem to bring it around without having to pause what your watching (if making the above pictured espresso, for example).

Word Processor

Obviously on it’s own the iPad does not a good word processor make. But fitted with the aforementioned keyboard, and using Evernote as the backend, the iPad is surprisingly useful for text processing. Because of there size, neither the keyboard or iPad are stable enough to use on your lap, but on a regular desk it works perfectly well. As long as it’s just plain text (with no formatting) I find the iPad is actually at an advantage over using the laptop as there are less distractions. So what I often end up doing is using the iPad to just do all  the really hard stuff (ie content generation) in Evernote, and then tidy it up later on the laptop. (That’s actually how I’m writing the blog at the minute!)

Oh yeah, I’d Recommend one

My biggest worry was that after the expense of getting one was that the novelty would wear off after 2 days and it would be thrown in the corner, like the old gen 1 Galaxy Tab I have. But I really pleased with the iPad 2, to the point that instead of buying a second replacement laptop for the both of us, we’ll just use the iPad in it’s place. Sure, I still need the big laptop for a lot of the “heavy lifting”, but the iPad is definitely feeling a lot more roles than I ever realised it could do.

  •   •   •   •   •