...Because someone's gotta tell the story...


To return to the main Blog List, click Full Blog Listing.


System Center

Moving a SCCM database causing unknown errors

Monday, April 20, 2015 in System Center (Views: 1977)
So, one very simple thing to note about moving databases from one location to another in SCCM. If you are moving across servers, the Setup utility will do this for you. But, what if you are just moving drives to save space, or moving a file from a folder to another?

Scenario 1: Moving within the same drive
- Database is moved from C:\Program Files\Microsoft SQL Server\.. to something like C:\SQLData

Scenario 2: Moving between drives
- Database is moved from C:\Program Files\Microsoft SQL Server\.. to something like D:\SQLData

You should see these errors in the provider, aren't they pretty? In the below case, software updates were being moved between groups.

*** *** Unknown SQL Error!
*~*~*** Unknown SQL Error! ThreadID : 2836 , DbError: 50000 , Sev: 16~*~*
ERROR CCISource::InsertObject returned -1ERROR: CSspConfigurationItem: SQL_ERROR

You would think this is an easy and supportable feature, and it should be - but this draws a line between bug and feature when it comes to security. The reason SQL gets hosed is 2 reasons:
1. The database "trustworthy" flag is reset because the file was reattached or moved.
2. The database owner was changed to whoever moved and reattached the database. It needs to be reset to "sa".

Solving #1, run this SQL against your master database:
ALTER DATABASE (whatever your database name is)

Solving #2, run this against your SCCM database:
EXEC sp_changedbowner 'sa'

All should be good in your world again after this. There is an isolation level flag, but I've rarely ever seen it reset. But this should get you out of the jam, if you indeed see it.


Related Blogs You May Be Interested In:

To leave a comment, please log in and/or register.