DTA problem

  • Hi,

    In my Instance Db engine Tuning Advisor is not opening. It's showing initialize MSDB for tuning error message. i have MSDB backup file i am using this cmd for Restore

    USE master

    GO

    RESTORE DATABASE [msdb]

    FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\msdb.Bak'

    WITH REPLACE, FILE = 1, REPLACE, STATS = 10

    GO

    error msg is:

    Msg 3101, Level 16, State 1, Line 1

    Exclusive access could not be obtained because the database is in use.

    Msg 3013, Level 16, State 1, Line 1

    RESTORE DATABASE is terminating abnormally.

    what is the problem....

  • I have no idea why you need to restore msdb to work with DTA.

    However, somebody is logged into that database and it probably is the SQL Server Agent login.

    Stop the SQL Server Agent and you should be able to restore it.

    The system databases are not as easy to restore as the user databases. You have to know what you're doing.

    See here for some tips on restoring the msdb database: http://www.mssqltips.com/sqlservertip/2571/restoring-sql-server-system-databases-msdb-and-model/

    -- Gianluca Sartori

Viewing 2 posts - 1 through 1 (of 1 total)

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