Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL SERVER 2008 restore remote backup files

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report