SQL SERVER 2008 restore remote backup files
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.