Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

A while ago we dropped some xp_real-functions in a production database, because of some security issues.
How can we recreate these functions?

Executing the following create statement as DBA:

create function dbo.xp_real_cmdshell(
  in command varchar(8000) default null,
  in redir_output char(254) default '' )
returns integer
internal name 'xp_real_cmdshell'

results in an error message:

Could not execute statement.
Permission denied: you do not have permission to use
the "CREATE FUNCTION" statement
SQLCODE=-121, ODBC 3 State="42000"
Line 1, column 1

Does anybody know how to solve this problem?

asked 01 Dec '11, 05:24

Dan%20Jernberg's gravatar image

Dan Jernberg
accept rate: 0%

edited 15 Mar '13, 21:32

Mark%20Culp's gravatar image

Mark Culp

There isn't a way to do this on an existing database that I know of - the server will not permit anyone (including a DBA) to link a new procedure to an internal server mechanism.

To get the system procedures back, dbinit a new database, and do an unload/reload into it.

permanent link

answered 01 Dec '11, 07:08

Glenn%20Paulley's gravatar image

Glenn Paulley
accept rate: 43%

...and that's why the "secure server features" have been introduced with v10, right?

dbsrv12 -sf cmdshell ...

(01 Dec '11, 07:30) Volker Barth

I was hoping to avoid creating a new database. Was hoping on something like
sp_configure updates,1
ala ASE..

(01 Dec '11, 07:47) Dan Jernberg
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 01 Dec '11, 05:24

question was seen: 2,543 times

last updated: 15 Mar '13, 21:32