S h o r t S t o r i e s

// Tales from software development

Archive for August 2012

Windows XP Service Pack 3 hangs on ‘Performing cleanup’

leave a comment »

Like many others who’ve applied Windows XP Service Pack 3 I found that when the installer reaches the ‘Performing cleanup’ step it appeared to hang.

But I could hear plenty of disk activity so I thought that something was going on, the problem was whether it was in some sort of loop and not making any progress or just taking a long time to do what it needed to do.

I searched for ‘windows xp sp3 hangs performing cleanup’ and found numerous posts suggesting that if the installation of SP3 takes longer than two hours then you should kill the update task and reboot. Not surprisingly, many people following this advice then complained that their PC either wouldn’t reboot or that it now regularly blue screened.

I knew there’d be a log file somewhere and as long as this showed that the installation was progressing then it’d be best to leave it to complete not matter how long it took.

Opening Windows Explorer, browsing to C:\Windows and ordering by Date/Time descending. It was obvious that log files for knowledgebase articles had been created within the past few minutes. Refreshing the display showed fresh activity. So, the installation was progressing. I checked every ten minutes to confirm that this was still the case and then, finally, 2 hours and 57 minutes after starting the install, it completed successfully.

Windows XP Service Pack 3 log files

Windows XP Service Pack 3 log files

Advertisements

Written by Sea Monkey

August 23, 2012 at 8:00 pm

Posted in Environments

Tagged with

MySQL restore without logging

leave a comment »

If you’ve got binary logging enabled then restoring a database is likely to increase the size of the binary log by the size of the database being restored and this is probably log data that isn’t wanted or needed.

There are several options to get around this with the two obvious ones being: (1) to configure logging to ignore updates to the database being restored, or; (2) to use a text editor to insert “SET sql_log_bin=0;” at the start of the dump file.

Option (1) is achieved using the MySQL Administrator utility to set the ‘Ignore updates for’ option on the Log Files tab of the Startup Variables view. The first disadvantage is that it won’t take effect until MySQL is restarted which might be a problem in a live environment. Then there’s the issue of whether you really want to turn all logging off for the database in question.

Option (2) is nice and simple but also has a couple of disadvantages. First, it might be problematic to edit a large dump file. Secondly, should you be doing this and compromising the integrity of the dump file ? In the particular scenario that I was dealing with, the dump file was for a live database and was being restored as a copy of this database to be used in a test system. I didn’t really want to be compromising the integrity of the live backup by editing it manually.

There is a solution but it’s not as obvious as it should be. The MySQL.exe utility allows a file containing SQL statements to be processed as input either using STDIN redirection or the -e argument and the source command. The following are equivalent:

mysql.exe db-name <database.dmp
mysql.exe db-name -e"source database.dmp"

The -e argument allows multiple statements to be executed:

mysql.exe db-name -e"statement1;statement2;etc;"

So, you might think that this this would work:

mysql.exe db-name -e"SET sql_log_bin=0;source database.dmp"

Unfortunately, it doesn’t. The MySQL.exe utility doesn’t appear to allow the source command to be mixed with SQL statements in this way in the -e argument. However, it does allow this combination of commands in a source file. So, if you create a text file called, for example, restore.sql containing

SET sql_log_bin=0;
source database.dmp

You can then execute MySQL.exe against it:

mysql.exe db-name -e"restore.sql"

and the restore is performed without logging.

Written by Sea Monkey

August 20, 2012 at 8:00 pm

Posted in Environments

Tagged with