Lost model.bak from system database

  • Lost model.bak from System databases,

    Now unable to add new database, throws error server unable to connect to model.bak.

    Traced the path: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup, here Backup folder is empty, It should have model.bak file, which is missing.

    From where do I download model.bak, can anyone help me on this?

  • Can you explain more? model.bak would be a backup file and it is in no way necessary for SQL's operation. the Model database, consisting od Model.mdf and Model.ldf are.

    Does the model database exist?

    Post error messages please.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    The file "model.bak" you are mentioning here is the backup of model database i think.

    The model.bak is available by taking a backup of model database.

    [font="Comic Sans MS"]+++BLADE+++[/font]:cool:

  • Hello,

    Your question is confusing.

    model.bak is used to restore the model database. If you don't found model.bak in backup folder does not means that you lost the database.

    If the system backup or tape backup is set you can retrive backup file model.bak from archieve.

    Clarify what you want!

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Add the error message you obtained...........

    [font="Comic Sans MS"]+++BLADE+++[/font]:cool:

  • Hi,

    I moved from Start-> Programs -> Microsoft Sql server 2005-> Sql server Management Studio Express->with server name:SANJ-PC\SQLEXPRESS, Aunthentication:Windows Authentication, user name:sanj-PC\sanj, then click connect,

    Right click on database, Attach, then click Add, I get this pop up message.

    TITLE: Microsoft SQL Server Management Studio Express

    ------------------------------

    Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

    ------------------------------

    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

    ------------------------------

    The server principal "sanj-PC\sanj" is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476

    ------------------------------

    When tried to expand Databases, got system Databases, then expanded it, got master, model, msdb, tempdb.

    I am able to expand master, msdb, tempdb, but when tried to expand model got this pop up error message:

    TITLE: Microsoft SQL Server Management Studio Express

    ------------------------------

    The database model is not accessible. (Microsoft.SqlServer.Express.ObjectExplorer)

    ------------------------------

    Please let me know how do I proceed now.

  • Any errors related to model in the SQL error log?

    Is your login sysadmin?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    I received following Error log:

    (c) 2005 Microsoft Corporation.

    2009-05-06 22:08:19.66 Server All rights reserved.

    2009-05-06 22:08:19.66 Server Server process ID is 2132.

    2009-05-06 22:08:19.66 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.

    2009-05-06 22:08:19.66 Server This instance of SQL Server last reported using a process ID of 2064 at 5/5/2009 11:58:45 PM (local) 5/5/2009 6:28:45 PM (UTC). This is an informational message only; no user action is required.

    2009-05-06 22:08:19.66 Server Registry startup parameters:

    2009-05-06 22:08:19.69 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf

    2009-05-06 22:08:19.69 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG

    2009-05-06 22:08:19.69 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf

    2009-05-06 22:08:19.82 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.

    2009-05-06 22:08:19.82 Server Detected 2 CPUs. This is an informational message; no user action is required.

    2009-05-06 22:08:24.42 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.

    2009-05-06 22:08:25.57 Server Database Mirroring Transport is disabled in the endpoint configuration.

    2009-05-06 22:08:25.86 spid5s Starting up database 'master'.

    2009-05-06 22:08:26.20 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.

    2009-05-06 22:08:26.70 spid5s SQL Trace ID 1 was started by login "sa".

    2009-05-06 22:08:26.78 spid5s Starting up database 'mssqlsystemresource'.

    2009-05-06 22:08:27.48 spid8s Starting up database 'model'.

    2009-05-06 22:08:27.54 spid5s Server name is 'SANJ-PC\SQLEXPRESS'. This is an informational message only. No user action is required.

    2009-05-06 22:08:27.56 spid5s Starting up database 'msdb'.

    2009-05-06 22:08:27.91 spid8s Clearing tempdb database.

    2009-05-06 22:08:27.98 Server A self-generated certificate was successfully loaded for encryption.

    2009-05-06 22:08:28.05 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].

    2009-05-06 22:08:28.05 Server Server local connection provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].

    2009-05-06 22:08:28.05 Server Dedicated administrator connection support was not started because it is not available on this edition of SQL Server. This is an informational message only. No user action is required.

    2009-05-06 22:08:28.07 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.

    2009-05-06 22:08:28.97 spid8s Starting up database 'tempdb'.

    2009-05-06 22:08:29.10 spid5s Recovery is complete. This is an informational message only. No user action is required.

    2009-05-06 22:08:29.18 spid11s The Service Broker protocol transport is disabled or not configured.

    2009-05-06 22:08:29.25 spid11s The Database Mirroring protocol transport is disabled or not configured.

    2009-05-06 22:08:29.54 spid11s Service Broker manager has started.

    How to proceed further.

  • There are no errors in that. The model database is starting up without any problems. If model were damaged, there would be lots of high severity errors in there.

    Is your login sysadmin?

    Are there any DDL triggers?

    What happens when you run CREATE DATABASE Test (from a query window)? (note, will create a database, you can just drop it if the command succeeds)

    What happens when you run this from a query window

    SELECT top 1 name from model.sys.objects

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Probably, you are not sysadmin and the public user in the model database is disabled. You need to have someone who is a sysadmin correct this. They either need to fix the public account or give you explicit permissions to access model.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Hi Robert,

    Thanks, Now I logged in with sysadmin and I am able to access model.

  • Hi GilaMonster,

    Thanks, Now I am able to access model after logging in with sysadmin.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply