SQL Server Performance

The database is not accessible. (Object Explorer)

Discussion in 'SQL Server 2005 General DBA Questions' started by sonnysingh, Dec 1, 2008.

  1. sonnysingh Member

    Hi FolksWe have restored a database and create user with db_owner rights. But when we login for the database error message came up. "The database is not accessible.(Object Explorer)". During investigation i have found that if user given sysadmin rights then user access to it and no such error but not as db_owner. we are using 2005 with SP2. I have search internet but no solution found...Please help...Thanks in Advance
  2. alexsqlforum New Member

    You have to create the same exact login as it is in the restored database and then login as sysadmin in the restored database and run sp_change_users_login 'auto_fix' ,'user with db_owner rights'. This will map the db user with a sql server login.
  3. sonnysingh Member

    No... I have simply restored the database and create new useras db_owner for both DBs. As i have mentioned one access fine secind one give this ERROR.
    Thanks.....
  4. satya Moderator

    Try using:
    GRANT VIEW <DatabaseName> to USERNAME
    go

Share This Page