locked
Trying to setup SQL Mirroring... RRS feed

  • Question

  • And I'm having problems as I'm not the Database owner/sysadmin.  Running SQL Server 2008 R2 (not express).  I've inherited this server and I'm not able to sign in with the SA account using any of our standard SA passwords.  The previous admin has been gone just over a year and I'm not able to run this by him to see if he remembers the SA password.  I'm trying to set my DB's recovery mode to Full but it says:
    Alter failed for Database 'DBName'. (Microsoft.SqlServer.Smo)

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

    The user does not have permission to permorm this action. (Microsoft SQL Server, Error: 297)

    I've googled this and found an article that said to run exec sp_changedbowner 'domain\myusername' to grant my account ownership of the DB.  The error I get from that is: Msg 15151, Level 16, State 1, Line 1
    Cannot find the database 'DBName', because it does not exist or you do not have permission.

    I need to somehow take ownership of this DB or grant my account the sysadmin role so I can set it's recovery mode to full.  Please advise.


    Monday, May 6, 2013 3:59 PM

Answers

  • Hello,

    This has nothing to do with database mirroring. Your account does not have the correct permissions to do these operations.

    You're going to need to start the instance up in single user mode and then connect to it with something like SQLCMD. Add your login as a sysadmin and then take it out of single user mode and start it up normally.

    -Sean


    Sean Gallardy | Blog | Twitter

    • Proposed as answer by Uri DimantMVP Tuesday, May 7, 2013 5:31 AM
    • Marked as answer by Fanny Liu Thursday, May 16, 2013 3:17 AM
    Tuesday, May 7, 2013 12:26 AM
    Answerer

All replies

  • Hello,

    This has nothing to do with database mirroring. Your account does not have the correct permissions to do these operations.

    You're going to need to start the instance up in single user mode and then connect to it with something like SQLCMD. Add your login as a sysadmin and then take it out of single user mode and start it up normally.

    -Sean


    Sean Gallardy | Blog | Twitter

    • Proposed as answer by Uri DimantMVP Tuesday, May 7, 2013 5:31 AM
    • Marked as answer by Fanny Liu Thursday, May 16, 2013 3:17 AM
    Tuesday, May 7, 2013 12:26 AM
    Answerer
  • check exact which edition of sql server you are using, you cant configure Mirroring when the Priciple/Mirrored Server version is RTM,

    Please make sure that both the SQL Servers are started with the same user name,if they are not in domain ,create same users and password and start then .\administrator


    Ramesh Babu Vavilla MCTS,MSBI

    Thursday, May 9, 2013 6:02 AM