2

I have database that is a datawarehouse environment that loads data with an ETL process.

During the ETL process I wish to make the database unavailable for querying for certain roles.

What would be a possible solution?

3
  • Could you please provide code of what you have tried?
    – Hexie
    Aug 8, 2013 at 7:33
  • 2
    @Hexie sometimes it's better think before you comment. it is not a select query or something like that , that he needs help with but a configuration modification
    – Royi Namir
    Aug 8, 2013 at 7:35
  • Take a look here, may help you: stackoverflow.com/questions/4143558/… Aug 8, 2013 at 7:36

2 Answers 2

0

I think the easiest answer would be to REVOKE PERMISSIONS for the rolls in the ETL process and reverse it at the end (or on fail).

5
  • Thanks for the reply. Revoke is an option. But what troubles me with revoke is that I have to specify the tables individualy. I would rather revoke all acces with a single command.
    – Roland
    Aug 8, 2013 at 7:42
  • Assuming all the tables you want to "hide" are in one SCHEMA, you can just revoke permissions on the SCHEMA. Does that help?
    – Gidil
    Aug 8, 2013 at 7:44
  • 1
    I think that's a great idea. I will try it.
    – Roland
    Aug 8, 2013 at 7:47
  • Let me know if it works. If not I'll try to help you find something else.
    – Gidil
    Aug 8, 2013 at 7:48
  • 1
    It works ;-). A deny on schema level overrules all grants on object level. So when I start the ETL I will deny SELECT on schema level and after the ETL finishes I will REVOKE that DENY. Thanks for the help.
    – Roland
    Aug 8, 2013 at 8:26
0

One option would be to create a stored procedure which modifies the permissions of the roles, then drops users connections, then following the data load you reset permissions.

An alternative to this is to run your ETL process when no one is using the system...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.