In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to achieve remote database backup in SQLServer. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
I. the activation of xp_cmdshell
The xp_cmdshell extended stored procedure executes the command string as an operating system command shell and returns all output as lines of text. Because xp_cmdshell can execute any operating system command, once the SQL Server administrator account (such as sa) is breached, * * users can use xp_cmdshell to execute operating system commands in SQL Server, such as creating a system administrator, which means that the highest privileges of the system are under the control of others. Due to security concerns, xp_cmdshell is turned off by default in SQL Server 2005.
There are two ways to enable xp_cmdshell
1. Open Peripheral Application Configurator->
Peripheral Application Configurator for function->
Instance name Database Enginexp_cmdshell- >
Enable
2.sp_configure
-allow configuration of advanced options
EXEC sp_configure 'show advanced options', 1
GO
-- reconfigure
RECONFIGURE
GO
-- enable xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 0
GO
-- reconfigure
RECONFIGURE
GO
-- execute the desired xp_cmdshell statement
Exec xp_cmdshell 'query user'
GO
-- after using it, remember to disable xp_cmdshell (for security reasons)
-allow configuration of advanced options
EXEC sp_configure 'show advanced options', 1
GO
-- reconfigure
RECONFIGURE
GO
-- disable xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
-- reconfigure
RECONFIGURE
2. Start backup
Exec master..xp_cmdshell 'net use z:\\ juwang\ SQLBak 123456 / user:juwang\ administrator'
/ / establish network path mapping: network path,\\ juwang\ SQLBak;z: the drive letter that maps the network path to the local machine; juwang is the name of the remote computer (you can also write the IP address). Administrator is the user name of the login and 123456 is the password of the logged-in user (preferably "123456")
Backup database hjx to disk='e:\ hjx_backup.bak 'with init
Backup hjx database, with init overwrite, noinit append
Exec master..xp_cmdshell 'copy e:\ hjx_backup.bak zvl'
Copy the hjx_backup.bak file to z:
Exec master..xp_cmdshell 'del e:\ hjx_backup.bak'
Delete local backup files
Exec master..xp_cmdshell 'net use z: / delete'
Delete the network mapping disk z:
The above is how to achieve remote database backup in the SQLServer shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.