cancel
Showing results for 
Search instead for 
Did you mean: 

How do I grant permission to UNLOAD to just one user?

Former Member
2,612

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

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

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)

Answers (0)