Wednesday, March 28, 2012

Model DB problem..

attempted to move my Model and msdb database files to a different drive on the server. I did the following:
* Restarted SQL Server 2K with the -T3608 startup parameter
* successfully detached msdb and model DBs
* moved the msdbdata.mdf, msdblog.ldf, model.mdf and modellog.ldf
files to their new homes
* successfully reattached model and msdb

When I take away the -T3808 startup parameter and restart SQL Server, I do not see the model database in the db list in enterprise manager eventhough my 'attach' seemed to work. Now I get the following error when i try and query against the Model database using query analyzer:

"Could not locate entry in sysdatabases for database 'model'. No entry found with that name. Make sure that the name is entered correctly"

Also, when I look in the sysaltfiles table in Master, I see no reference whatsoever to the Model DB

What did I do wrong?attempted to move my Model and msdb database files to a different drive on the server. I did the following:
* Restarted SQL Server 2K with the -T3608 startup parameter
* successfully detached msdb and model DBs
* moved the msdbdata.mdf, msdblog.ldf, model.mdf and modellog.ldf
files to their new homes
* successfully reattached model and msdb

What did I do wrong?

Ouch! I HATE it when that happens. Here's a link, you've probably already read it (here (http://support.microsoft.com/default.aspx?scid=kb;en-us;224071)).

I would (in more or less this order):
1. Look carefully at the SQL Error log
2. Restart with -T3608 and attempt to re-attach model
3. Restore model from a backup (you did have a backup, right?)

I seem to recall from a distant memory that when you moved msdb and model, there was a particular sequence (one HAD to be done before the other). [Edit: here it is, smack in the middle of the link above].

Note If you are using this procedure together with moving the msdb
and model databases, the order of reattachment must be model first
and then msdb. If msdb is reattached first, it must be detached and
not reattached until after model has been attached.

I can't tell for certain from the steps you outline above which you did first.

I have used this procedure to move model, master, msdb and tempdb on several different occasions with no trouble at all (sorry, that doesn't help you, but I did want to verify that the steps outlined above DO work). As I recall, I usually make it a point to move msdb and model in separate steps (restarting SQL Server in between moving these two dbs).

Best of luck,

hmscottsql

No comments:

Post a Comment