Get the App
SLTechnology News&Howtos  ›  Database  › 

SQL SERVER 2008 restore remote backup files

Shulou Source: shulou.com Published: 2022-06-01 09:29:09 10月02日 Update

The method of restoring remote backup files by SQLSERVER2008R2

First, enable the xp_cmdshell component by SQL Server:

Opened by a SQL statement. [this method is recommended because it can be used in any version of SQL SERVER.]

By creating a new query analyzer, select the Master database, and then execute the following SQL content:

Sp_configure 'show advanced options',1

Reconfigure

Go

Sp_configure 'xp_cmdshell',1

Reconfigure

Go

Execution result:

The configuration option 'show advanced options' has been changed from 0 to 1. Please run the RECONFIGURE statement to install.

The configuration option 'xp_cmdshell' has been changed from 0 to 1. Please run the RECONFIGURE statement to install.

To turn it off, simply change "sp_configure 'xp_cmdshell',1" to "sp_configure' xp_cmdshell',0".

2. To establish a shared credit relationship, you must first map the remote shared folder to a local drive letter with the net use command, and then back it up directly to the drive letter. Refer to the code:

Exec master..xp_cmdshell 'net use X:\ 192.168.0.111\ BACKUP yourPassWord / user:192.168.0.111\ administrator'

3. SQL Server Management Studio recovers remote database files:

The above X: drive letter appears, that is, after reading the remote backup file successfully, click confirm, you can restore the file to the specified folder on the local disk.

Tags: File backup statement site data database folder run configuration success code credit content analyzer just command method this method version component Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Redmi OPPO Reno MySQL Huawei