ADO Error while creating new database

  • Thread starter Thread starter Nenad Dobrilovic
  • Start date Start date
N

Nenad Dobrilovic

Hi,
I just installed MS SQL 2000 Desktop engine - but I cannot create any
database. When I try to create a new one, I get following error : "Could
not obtain exclusive lock on database 'MODEL'. Retry the operation later."
I tried it from VS .NET 2003 (from Server Explorer) and also from DbaMGR2k.
Can you help me, please?
Thank you,
Nenad Dobrilovic
 
Nenad,

First check the logs for anything suspicious. If you do not see anything I
suggest that you stop and start the server. If this is a new install and you
haven’t restarted you could have a process left over from the install that is
hanging on. If the problem continues try to log into osql and do a sp_who2
command so you can see what is holding a lock on the database. At this point
you try to determine why this process is holding a lock on the Model
database. The Model database is used as a pattern for all of the databases
that you create in sql so I do not see (offhand) why there would be a lock on
this database (unless it is trying to recover from a restore…could be other
reasons).

If you see what is holding the lock is something trivial you can then issue
a kill (kill spid#) command to terminate the process. If none of this works
please repost more details (e.g. what you see in sp_who2) so we may provide
more help.

Hope this helps
 
Brian said:
First check the logs for anything suspicious. If you do not see anything I
suggest that you stop and start the server. If this is a new install and you
haven’t restarted you could have a process left over from the install that is
hanging on. If the problem continues try to log into osql and do a sp_who2
command so you can see what is holding a lock on the database. At this point
you try to determine why this process is holding a lock on the Model
database. The Model database is used as a pattern for all of the databases
that you create in sql so I do not see (offhand) why there would be a lock on
this database (unless it is trying to recover from a restore…could be other
reasons).

If you see what is holding the lock is something trivial you can then issue
a kill (kill spid#) command to terminate the process. If none of this works
please repost more details (e.g. what you see in sp_who2) so we may provide
more help.

Thank you,
Finally I succeeded to create new database, but let start from beginning.
First, I checked the logs, but everything was fine. I tried to stop and
start the server and that didn't help me, same as restarting Windows.
Then I logged into osql and did sp_who2 command and there was line that
was suspicious to me:

52 sleeping CHEYA\Nenad CHEYA .
model AWAITING COMMAND 16 0 01/20 10:47:51
MicrosoftR Visual Studio .NET 52

I closed Visual Studio, and then I tried to create database (from
DbaMGR2k) - and finally succeeded!
Just to be sure, I opened VS again and tried to create another database
through Server Explorer, but I got the same old error!
I don't know what is the catch...

Nenad
 
Nenad,

Great! I am glad that worked. IN VS Studio try deleting all of your
connections to that server and create a new one. Then try it again. If you
get the same results please post so we may continue to diagnose the problem.

Good Luck.
 
Brian said:
Nenad,

Great! I am glad that worked. IN VS Studio try deleting all of your
connections to that server and create a new one. Then try it again. If you
get the same results please post so we may continue to diagnose the problem.

Good Luck.

I deleted all the connections to the server and created a new one. It
seems that was solution, because I can create a new database now.

Thank you very much for your help!

Nenad
 
Back
Top