How to back up a database to a local ing network drive

Source: Internet
Author: User
Tags account security

When we use a ing drive to back up the SQL Server database, the following error may occur:

 

"Failed. Error:" unable to open the backup device 'z: \ gbdb_backup_201306302002.bak '. Operating System Error
3 (the system cannot find the specified path .).

 

The database cannot find the path, but if we open it directly, it can be accessed normally. Why is SQL server inaccessible?

 

Because SQL server runs as a service, it cannot perceive the network drive disk mapped to the shared path. Because SQL
Server Service uses SQL Server to start the account security context and run in the local console context environment. The ing disk drive is only visible to specific sessions and invisible to services started in the context of the local console.

 

You can use the following method to back up data to a mapped Disk:

 

1. Open SQL Server and run the following commandExec xp_cmdshell 'net use <drivename> <Share Name>'

-- <Drive name>: ing drive letter -- <Share Name>: UNC shared path

 

2. You should be able to back up the drive letter created above.

Net use Documentation Reference:Http://technet.microsoft.com/en-us/library/bb490717.aspx

 

The disadvantage is that when the SQL Server service is restarted, the mapped disk will be lost. To continuously map disks, you need to create a startup stored procedure. In addition, security considerations (Xp_mongoshell)

A simple method is to use UNC for backup. In this way, you only need to ensure that the SQL server startup account has full control permissions on the remote shared folder.

 

Ideally, the service should not access the local ing drive, because the local ing drive has different features in different Windows versions, and the methods mentioned above are not necessarily available in all scenarios.

 

Refer to: 180362 info: Services and redirected drives.

 

Original article from:
How to backup SQL Server databases to a mapped drive

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.