SQL 2012 - trying to create a new DB - model DB locked

Hi All,

Firstly Im no DB. Im trying to install my Vmware vcenter DB on my SQL 2012 server. When trying to run the following script i get the error:

USE MASTER
GO
CREATE DATABASE D001_VMware_SSO ON PRIMARY(
NAME='RSA_DATA',
FILENAME='D:\Program Files\Microsoft SQL Server\MSSQL11.SCCM\MSSQL\DATA\vmware_SSO_data.mdf',
SIZE=10MB,
MAXSIZE=UNLIMITED,
FILEGROWTH=10%),
FILEGROUP RSA_INDEX(
NAME='RSA_INDEX',
FILENAME='D:\Program Files\Microsoft SQL Server\MSSQL11.SCCM\MSSQL\DATA\vmware_SSO_index.mdf',
SIZE=10MB,
MAXSIZE=UNLIMITED,
FILEGROWTH=10%)
LOG ON(
NAME='translog',
FILENAME='D:\Program Files\Microsoft SQL Server\MSSQL11.SCCM\MSSQL\DATA\vmware_SSO_log.ldf',
SIZE=10MB,
MAXSIZE=UNLIMITED,
FILEGROWTH=10% )
GO
ALTER DATABASE [VMware_SSO] SET RECOVERY SIMPLE
GO
CHECKPOINT
GO

I get error :

Msg 1807, Level 16, State 3, Line 1
Could not obtain exclusive lock on database 'model'. Retry the operation later.
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

I then ran a select * from sys.dm_tran_locks to see what was locked and got the following results (attached)

Can anyone help on this:?

locks
MJB2011Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

geek_vjCommented:
From the screenshot, it looks like the model database is being accessed.

As such, please try disconnecting the management studio and try executing again.

If the errors still happen, try killing the sessions which are active on model database and try executing the query again
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.