Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Created database but used Model


Created database but used Model

Author
Message
Kricky
Kricky
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 96
Hi all - I needed to create a database, but somehow my dropdown for the database that I was in in SSMS, had been selected as "model". I came back to see that the Create Database statement was still running long after I had started it. I have now killed that process, but it is still cancelling 12 hours later. What is the best solution on this? I am guessing that since the Model db is open, I cannot create any other databases until this query is stopped. If I stop and start SQL, I am concerned that my model db will come back as suspect. I am not an expert db administrator, and we don't really have one. Hard to search the web for this topic.

Thanks.
Adiga
Adiga
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1912 Visits: 21012
When the create database statement is running, it requires exclusive access to model database. Now that you have killed the sessions, do you see any other session blocking it?


select * from sys.dm_exec_requests where blocking_session_id<>0



If that query is not causing any performance issues, you can wait for it to complete. Restarting the SQL Server is also an option but I don't think it will cause the MODEL database to go suspect.

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Kricky
Kricky
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 96
When I ran that query, I didn't get any results returned, so I will just let it finish. Thanks Adiga.
Lowell
Lowell
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17933 Visits: 39406
Kricky (12/17/2010)
When I ran that query, I didn't get any results returned, so I will just let it finish. Thanks Adiga.



kill it! kill it with fire!


it doesn't matter what database scope you are currently in, a new database is always a copy of the model database;

it should only take a second or two to complete, unless you make a mistake like alloting 1000 gigs instead of 10 meg or something...
regardless, if it's been goign 12 hours, I'd kill it and start fresh.
nothing good will come from a sql that has been that long running.

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search