FirstServed Tech Blog - FirstServed and the Art of Server Tuning

Posts Tagged ‘dedicated hosting’

Microsoft SQL Server: How to recover a suspect database

Wednesday, January 19th, 2011

Hi,

Normaly you should always have backups of your databases, restoring suspected databases is not a good option, but I think at some point in time, in some situation you’ll want to do it anyway.
So today I set up a test case for this. I mirrored one of our database servers and made it crash, badly.
Two databases were corrupted, and went to the "suspect state".

Microsoft SQL Server started throwing errors in our general direction like:

"Database cannot be opened. It has been marked SUSPECT by recovery."

Not good, but just what we wanted…

So how would it be possible to recover these databases?

First, set them to emergency mode, this way you will be able to retrieve control.
In emergency mode you can actually open the database:

alter database "test-database" set emergency;

Second, put them in single mode (needed for the check we will be performing):

alter database "test-database" set single_user;

Then, check the database (this repair allows data-loss, since I’m sure some data will have to be lost in my scenario):

dbcc checkdb ('test-database', REPAIR_ALLOW_DATA_LOSS);

Finally, if the check succeeded, you can re-enter multi-mode:

alter database "test-database" set multi_user;

And there you go, the database is restored…
Not a best practice, but it may save some time once. So if you ever have a problem on your dedicated server database hosting, you know this might to the trick.

Dell PowerEdge R410 & CentOS 5.4 IPMI (bmc) configuration

Wednesday, November 18th, 2009

Hi,

If you want to configure a serial console on your Dell PowerEdge R410 (or R710) dedicated server with CentOS 5.4 (or 5.3 and probably also the Red Hat Enterprise systems) you can use these guidelines.
In the Bios:

Under "Serial Communication":
Serial Communication: On with Console Redirection via COM1
Serial Port Address: Serial Device1=COM2,Serial Device2=COM1
External Serial Connector: Serial Device2
Failsafe Baud Rate: 115200
Remote Terminal Type: VT100/VT220
Redirection After Boot: Enabled (so grub displays)

Then you configure Grub:

title CentOS (2.6.18-164.6.1.el5) Serial
root (hd0,0)
kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=LABEL=/ console=tty0 console=ttyS0,115200n8
initrd /initrd-2.6.18-164.6.1.el5.img

This makes the kernel display it’s messages on screen and over the serial console.

In /etc/securetty append:

ttyS0
ttyS1

This way root can log in using the serial console.

Finally configure the inittab (/etc/inittab) and add the following line:

co:2345:respawn:/sbin/agetty ttyS0 115200 linux

Now reboot and enjoy pure serial console goodness over ip (ipmi).

(Oh, don’t forget to enable IPMI over lan in the iDrac configuration and to set a username, password and ip-address.
The iDrac 6 configuration flashes by when the server boots.)