Tuesday 11 September 2012

Moving SCCM 2012 site DB to another drive

OK, I promised to be so pr0, so here it is - fresh topic from today, I just resolved it and I thought I'll share.


Sometimes you must move DB to different drive on the same server, but for SCCM 2012 it's not that straightforward as in SCCM 2007. 
Normally, you'd detach DB, move it to new location  and attach again, like this:

1. Go to SCCM install root /bin/x64/00000409 (00000409 is folder related to language, english in that case)
2. Run preinst /stopsite. Lot of components should stop.
3. In SQL Management Studio, right click DB and select Detach.
4. Copy DB and LOG files to new location
5. In SQL Management Studio attach your DB from new location.
6. Start SMS_* services.

Simple, eh? Yes, but that doesn't work... console still showed "link Failed" status... WTF? 
In rcmctrl.log you'll probably have similar errors:
ERROR: Detected Servie Broker is not enabled.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:19 PM    5468 (0x155C)
ERROR: To fix this, put the database in single user mode and execute 'ALTER DATABASE [CM_SEC1] SET ENABLE_BROKER'.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:19 PM    5468 (0x155C)

What I did:
7. Stop SCCM site again with preinst /stopsite.
8. In Management Studio run query: ALTER DATABASE [YOUR_DB_NAME] SET ENABLE_BROKER  (it may take a while)


You don't need to put DB to single user mode! It worked nicely in multi user mode (but I had site disabled).

This link will help you find out if service broker is enabled and how to enable/disable it.

9. Start SCCM services again.
10. In rcmctrl.log you should see something like that:
  waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:40 PM    5468 (0x155C)
InvokeDrsActivation thread is stopping...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:40 PM    2416 (0x0970)
Stopping all activation sprocs. Waiting 5 seconds for sprocs to finish.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:40 PM    2416 (0x0970)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:40 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:41 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:41 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:42 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:42 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:43 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:43 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:44 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:44 PM    5468 (0x155C)
waiting for 500 miliseconds for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:45 PM    5468 (0x155C)
The asynchronous command finished with return message: [spDRSActivation finished at 9/11/2012 1:38:28 PM. End execute query finished at 9/11/2012 1:38:28 PM.].    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:45 PM    2416 (0x0970)
InvokeDrsActivation thread exited.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:45 PM    5468 (0x155C)
Exiting SMS_REPLICATION_CONFIGURATION_MONITOR thread ...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:38:45 PM    5468 (0x155C)
SMS_EXECUTIVE started SMS_REPLICATION_CONFIGURATION_MONITOR as thread ID 5412 (0x1524).    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:11 PM    5612 (0x15EC)
SMS_REPLICATION_CONFIGURATION_MONITOR is starting...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:11 PM    5412 (0x1524)
RCM registry info - SQLServerName = I03FS500.adgroup.michelin.com; DatabaseName = CM_I03; SiteNumber = 65542    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:11 PM    5412 (0x1524)
Connecting to RCM.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:11 PM    5412 (0x1524)
Waiting for InvokeDrsSync thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:15 PM    5412 (0x1524)
InvokeDrsSync thread exited.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:15 PM    5412 (0x1524)
Waiting for InvokeDrsActivation thread to exit.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:15 PM    5412 (0x1524)
InvokeDrsActivation thread exited.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:15 PM    5412 (0x1524)
Exiting SMS_REPLICATION_CONFIGURATION_MONITOR thread ...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:40:15 PM    5412 (0x1524)
SMS_EXECUTIVE started SMS_REPLICATION_CONFIGURATION_MONITOR as thread ID 6032 (0x1790).    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:14 PM    2052 (0x0804)
SMS_REPLICATION_CONFIGURATION_MONITOR is starting...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:14 PM    6032 (0x1790)
RCM registry info - SQLServerName = I03FS500.adgroup.michelin.com; DatabaseName = CM_I03; SiteNumber = 65542    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:14 PM    6032 (0x1790)
Connecting to RCM.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:14 PM    6032 (0x1790)
Initializing RCM.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:19 PM    6032 (0x1790)
Processing Replication    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:19 PM    6032 (0x1790)
DRS change application started.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:19 PM    4860 (0x12FC)
InvokeDRSSync thread is starting...    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:19 PM    3360 (0x0D20)
DRS sync started.    SMS_REPLICATION_CONFIGURATION_MONITOR    9/11/2012 1:44:19 PM    3360 (0x0D20)

 That's it! Your SCCM console should report "Link Active" status, DB location in "Child Site" tab should be reported correctly!

But I have a hunch that this may be helpful after moving DB :)

4 comments:

  1. Dear friend :)

    I just don't want you to feel so lonely here, that's why I decided to wrote down this comment.

    Keep blogging (it's always better than having a FB account :)

    Hope that you will get this years 'BEST BLOG AWARD', but you still need to work a little harder.

    Your first subscriber :P
    Take care !

    ReplyDelete
  2. I ran this query after moving the database because SMS_REPLICATION_CONFIGURATION_MONITOR was creating errors every few minutes.
    Correct?

    ReplyDelete
    Replies
    1. Whoa, someone actually read this :) I'm surprised. Well, if it doesn't generat eerrors, then you're correct.

      Delete
  3. this is great and yes we do read the blog. Question, My remote server, db name and instance did NOT change but the DB did move to another local drive. Does this need to be done ? I ask because I hav SQL errors when I am trying to download new windows updates in SCCM

    ReplyDelete