backup to network share

  • I would like to backup SQL Server DB's to a network share. Would someone share with me the exact syntax or show me an example how to accomplish that on 2005.

     

    Thanks

    Shahab

  • Backup database pubs to disk = '\\servername\c$\pubs.bak' with init

    MohammedU
    Microsoft SQL Server MVP

  • Make sure the account that is running the SQL Server service is a domain account that has write permissions to the network share you are writing to.  If the account is LocalSystem it will not work.

  • You have a much higher likelihood of getting a corrupted backup this way. Back up locally and then copy or move to the network share.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Robert,

    Can you elaborate on that a little?  I'm not sure I understand.  It would seem to me that the method you suggest would be more likely to intorduce corruption, due to the additional I/O involved.

     

  • IO isn't the issue. The issue is the network. If there are dropped packets or a network glitch of some sort during the backup process, the backup either fails or gets created as a corrupted file. If you create the backup locally, a valid backup can be created without any intereference from the network.

    Think of it like this. If someone on the other side of the room asked you to fill their water glass, would you pour the water directly into the glass (i.e. fill it locally)  or would you spray the water across the room with a hose?


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Doing the local backup and copy the bak file to nework location is good idea but when you don't have the space, you have to use network backup....

    If there is any issue in network backup job will fail. When the backup is running SQL sends the packets waits for aknowledgement from the host, incase on no aknowledgement backup job will report you as failure even it is completed 100%...

    I am doing nework backups since 7.0 without any major problems...

    If some ask the water on the other side of the room you can ask them to use the tap if there is any and if you have the switch for that tap you need on it...

    I beleive network backup is like running the pipe for water...

     

    MohammedU
    Microsoft SQL Server MVP

  • Still don't follow.  You are still using the same "packet" thingys when you copy the file.  So there is an equal chance for a dropped packet to cause corruption.

    Now add in the fact that you must first place the file on the local machine, involving the disk controller and the drives, then go back and read the exact same data back from controller and drives, then shove it through the same network adapter, etc.

    You've added a lot of places where corruption could occur.  And as Mohammed indicates, the SQL server will know about the network problems during the backup.  "Later on" is too late when the LSNs get updated for the next transacton log backup.

    I'll stick with the direct-to-network approach.  I've backed up 50 GB/day for 5 years over the network without a problem.

    And I do test my backups regularly.

     

     

     

  • Yes, if space dictates backing up to a remote server, then certainly do so.

    If the remote server is down, you can't make any backups at all without manual intervention. Using my method, if the remote server is down, and I can still create the backups locally.

    I do my backups locally and then copy the backups to a remote store. I maintain 1 week's worth of backups locally and considerably more on the remote server.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • >> Still don't follow.  You are still using the same "packet" thingys when you copy the file.  So there is an equal chance for a dropped packet to cause corruption.

    Yes, but if corruption occurs, you still have a noncorrupted copy on the local.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Which is not true if I pick option 2 below...

    >> Back up locally and then copy or move to the network share.

     

     

  • Which is why I copy.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 12 posts - 1 through 11 (of 11 total)

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