Create Sql Server Backup on Local Machine

后端 未结 5 362
粉色の甜心
粉色の甜心 2021-01-17 15:56

I am using SQL Server Management Studio running on my local machine.

I can log on to a remote box (database engine) and use the Studio to create a database backup w

5条回答
  •  执念已碎
    2021-01-17 16:24

    See this MSDN article, for the section on backing up to a network share, e.g.:

    BACKUP DATABASE YourDatabase
       TO DISK = '\\SomeMachine\Backups\YourDatabase.Bak';
    

    Backing Up to a File on a Network
    Share For SQL Server to access a remote disk file, the SQL Server service account must have access to the network share. This includes having the permissions needed for backup operations to write to the network share and for restore operations to read from it. The availability of network drives and permissions depends on the context is which SQL Server service is running:

    • To back up to a network drive when SQL Server is running in a domain user account, the shared drive must be mapped as a network drive in the session where SQL Server is running. If you start Sqlservr.exe from command line, SQL Server sees any network drives you have mapped in your login session.
    • When you run Sqlservr.exe as a service, SQL Server runs in a separate session that has no relation to your login session. The session in which a service runs can have its own mapped drives, although it usually does not.
    • You can connect with the network service account by using the computer account instead of a domain user. To enable backups from specific computers to a shared drive, grant access to the computer accounts. As long as the Sqlservr.exe process that is writing the backup has access, it is irrelevant whether the user sending the BACKUP command has access.

提交回复
热议问题