Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Problem with attaching a copy of DB which is recieved from another server

Problem with attaching a copy of DB which is recieved from another server

Scheduled Pinned Locked Moved Database
databasequestionhelpsharepointsql-server
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ArtemCh
    wrote on last edited by
    #1

    Hi! I need to move a database from one server to another. So I have the server 'S1', the database 'DB1' which is located on the server 'S1' and the server 'S2'. I use MS SQL Server 2005 Express. I carried out following actions: 1) executed stored procedure sp_detach_db 'DB1' on server 'S1' 2) copied files DB1.mdf and DB1Log.ldf from 'S1' to 'S2' 3) tried to execute the query on the server 'S2':

    CREATE DATABASE DB1
    ON (NAME = DB1_data, FILENAME = 'file_path\DB1.mdf')
    LOG ON (NAME = DB1_log, FILENAME = 'file_path\DB1Log.ldf')
    FOR ATTACH

    and recieved the error: "Unable to open the physical file "file_path\DB1.mdf Operating system error 5". When I executed the same query on 'S1' to attach DB1 again it was finished successfully... Tell me please what is the source of the error? and how do I solve my problem.

    A 1 Reply Last reply
    0
    • A ArtemCh

      Hi! I need to move a database from one server to another. So I have the server 'S1', the database 'DB1' which is located on the server 'S1' and the server 'S2'. I use MS SQL Server 2005 Express. I carried out following actions: 1) executed stored procedure sp_detach_db 'DB1' on server 'S1' 2) copied files DB1.mdf and DB1Log.ldf from 'S1' to 'S2' 3) tried to execute the query on the server 'S2':

      CREATE DATABASE DB1
      ON (NAME = DB1_data, FILENAME = 'file_path\DB1.mdf')
      LOG ON (NAME = DB1_log, FILENAME = 'file_path\DB1Log.ldf')
      FOR ATTACH

      and recieved the error: "Unable to open the physical file "file_path\DB1.mdf Operating system error 5". When I executed the same query on 'S1' to attach DB1 again it was finished successfully... Tell me please what is the source of the error? and how do I solve my problem.

      A Offline
      A Offline
      ArtemCh
      wrote on last edited by
      #2

      Problem is solved by adding full access permisions for 'MSSQLUser' user group to the file_path directory.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups