Archive

Archive for the ‘SQL’ Category

MOM2005: Manually removing a management server

October 20th, 2008 jpavleck No comments

Although there’s a proper method for removing a MOM2005 management server, sometimes you just can’t do it that way. That’s what recently happened here – the primary MOM 2005 management server died, and since they were transitioning to OpsMgr 2007 anyway, they decided to leave it down.

So how to remove it? It’s actually really simple.

Open up SQL management studio and connect to the OnePoint database for MOM2005 server.

  1. Run the following sql query to pull up all of your MOM2005 management servers:
    SELECT * FROM Computer
    WHERE ISCollector = 1 AND IsConfigManager = 1
  2. Now find the MS you want to remove and copy it’s GUID from the idComputer field, then run this query:
    UPDATE Computer
    SET IsCollector = 0, IsConfigManager = 0
    WHERE idComputer = ‘<GUID>’
  3. Now it’s magically no longer a management server, and can be removed from the console like a normal agent-managed computer. But what about the the agents using it as it’s primary server? No worries – grab the GUID for the management server you’d like to use as the new primary, and run this query:
    UPDATE Computer
    SET idConfigManager = ‘<New management server GUID>’
    WHERE idConfigManager = ‘Old management server GUID>’
  4. Now run the attribute and discovery scans on the management server, then just wait for the new configuration information to propagate to all the agents, and you’re good.
Categories: MOM, SQL Tags: , ,

Useful SCOM SQL Queries

June 10th, 2008 jpavleck 2 comments

I’m essentially mirroring this from the original one on my blog, but since I’ve decided to transition to a tech blog and a non-tech blog, it seems like a good idea.

I’ve taken the listing of SQL queries from Kevin Holman’s original post, cleaned them up a bit, and made it into one file which you can download and load into SQL Studio Manager, instead of copying and pasting individual queries. I’ll also be showing you how to automate a lot of these with PoSh, but right now I’m swamped and haven’t had the time to clean things up proper – so you’ll just have to wait.

Download Useful SCOM 2007 SQL Queries.sql

Read on to see what’s in the actual file

Read more…

Categories: SCOM, SQL Tags: ,