I know that it's possible to grant public permission to UNLOAD via the -gl database option. I don't really want to do that.

Is it possible to create a procedure that puts a wrapper around my specific UNLOAD statement and then grant a specific user permission to execute that procedure?

(I'm trying, but its not working, and I'm not getting any meaninful error messages).

Thanks!

I'm using 9.0.2.3850

asked 09 Apr '10, 20:52

Ron%20Hiner's gravatar image

Ron Hiner
880202427
accept rate: 9%


You can do this by creating a procedure owned by DBA and then grant execute permissions to the user that you want to be able to run this procedure.

Example:

CREATE PROCEDURE DBA.unload_some_data()
BEGIN
    unload
    select *
      from mytable
        to 'myfile.txt';
END;

GRANT EXECUTE ON DBA.unload_some_data TO "otheruser";

This gives the user otheruser the ability to call the procedure unload_some_data and when the procedure is called, the procedure will run as user DBA and therefore will be able to unload the data (as long as you did not start the server with -gl none)

permanent link

answered 09 Apr '10, 22:57

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297
accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×48
×28

question asked: 09 Apr '10, 20:52

question was seen: 2,273 times

last updated: 09 Apr '10, 22:57