SQL Server blocked access to the process ' Sys.xp_cmdshell ' for component ' xp_cmdshell ' when opening a large storage. sql file

Source: Internet
Author: User
Tags configuration settings sql server books

1.

" msg 15281, Level 16, State 1, procedure xp_cmdshell, line 1th
SQL Server blocked access to the process ' Sys.xp_cmdshell ' of component ' xp_cmdshell ' because this component was shut down as part of this server's security configuration. System administrators can enable ' xp_cmdshell ' by using sp_configure. For more information about enabling ' xp_cmdshell ', see "surface area Configurator" in SQL Server Books Online. ”

Workaround:

When sqlserver2005

EXEC sp_configure n ' Show advanced options ', n ' 1 '
RECONFIGURE with OVERRIDE
EXEC sp_configure n ' xp_cmdshell ', n ' 1 '
RECONFIGURE with OVERRIDE
EXEC sp_configure n ' Show advanced options ', n ' 0 '
RECONFIGURE with OVERRIDE
If not sqlserver2005 you can use the following method (I did not experiment)

EXEC sp_configure ' show advanced options ', 1; RECONFIGURE; EXEC sp_configure ' xp_cmdshell ', 1; RECONFIGURE

RECONFIGURE: Specifies that if the configuration settings do not require the server to be stopped and restarted, the currently running values are updated and the SQL Server service will be restarted if this keyword is not available.

Remind: Open execution order is ' show advanced options ' before executing ' xp_cmdshell '. , if you want to turn off this advanced option, execute ' xp_cmdshell ' and then ' show advance options '. The number 1 is on and 0 is off.

If the Cmdshell is not working yet, run it again:
DBCC ADDEXTENDEDPROC ("xp_cmdshell", "Xplog70.dll");--
Or
Sp_addextendedproc xp_cmdshell, @dllname = ' Xplog70.dll '
To restore Cmdshell.

2.

Execute Master.dbo.xp_cmdshell ' osql-u sa-p 123456-i d:\test.sql '

SQL Server blocked access to the process ' Sys.xp_cmdshell ' for component ' xp_cmdshell ' when opening a large storage. sql file

Related Article

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.