How to Unlock the Database

  • Hi All,

    How to Unlock the database in sql 2008.

    is there any Query to Unlock database....

    Regards

    Jagadeesh...

    Regards
    Chowdary...

  • What do you mean 'unlock a database'? What are you trying to do?

    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
  • :-):-):-):-):-)

    Regards
    Chowdary...

  • Still not understanding the problem, could you explain in more detail?

    If it's file permissions, then grant the needed permissions or ask your administrator to help you.

    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
  • am having the database in External Drive ,That was locked by that local system.

    Now i want to restored that Locked Database from that Exte Drive to New System...

    Note:Both Systems are not in Domain...

    Regards
    Chowdary...

  • There are having two systems which are not in domain. so they re planning to restore the database from A server to B.

    in A server they are using the external drive but they don't have the access to A sql server. they copied the backup file and trying restore in B server here they are getting the error like "Unable to open the physical file "p:\*****\*****.mdf". Operating system error 5: "5(error not found)"

  • You need to grant the SQL Server service account (the account SQL runs under) full control of all data and log files and all folders which contain data and log files.

    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
  • If the files are "locked" it sounds like a SQL Server instance is actively using them. You may want to look into the process for taking a database backup to assist you in migrating your database to a new server.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 8 posts - 1 through 7 (of 7 total)

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