Thursday, 18 February 2010

VMware ESX 4 / IBM BladeCenter/H - Network Error

Had a problem on a blade running esx 4 yesterday. The blade couldn't ping out and nothing could ping in. We tried all sorts of things including working with the firewall and INPUT/OUTPUT rules to no avail.

Re-installed ESX. Same problem again.

The internal bladecenter network switch was at fault. It was showing the port as GREEN and working, but when we removed the blade and tried it in another slot it worked fine.

We had to disable then enable the network port in the switch and then it worked fine. As usual, there was absolutely no error from the IBM kit and we had to find it by trial and error.

Sigh. Regular readers will know about IBM's lack of errors when there is one.

Saturday, 6 February 2010

SQL 2005 - Transaction Logs

The transaction logs on our servers have grown too large and it takes ages for tools to crawl through them looking for specific transactions.

Our backups are done at the disk level, so SQL itself doesn't know that we've backed up OK

So - here's how to clear the transaction logs:

  1. Set the recovery mode to simple. This stops SQL from logging transactions
  2. Run a database shrink - this will clear the logs
  3. Set the recover mode back to full.
A couple of things can go wrong:

a) One of our databases thought it was being replicated although we've never turned it on. In this case:

Exec sp_removedbreplication // against the database to remove replication info.

However - if you are using replication you should use:

EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1 // this removes the log entries that are locked as unreplicated

b) If you have created multiple files for data and logs, DON'T unless you have to for example to span disks. To remove them:

  1. Clear the log files (see above)
  2. Shrink each additional file ticking the "empty file by migrating" box
  3. Go to properties of the DB, then file and remove it
c) If you have multiple log files, you will not be able to detatch the DB, delete the log files then re-attach - it will fail so DON'T! The detach, delete, attach process seems to work OK for single log file DB's - but always keep a back of the log file.

Nick