admin管理员组文章数量:1133730
I have a problem with an Oracle stored procedure that dynamically creates some materialized views.
The procedure first drops the materialized views if there are any with the same name of the ones that will be created. Then it creates the new materialized views.
Both the statements of drop and create are execute by means of the execute immediate command.
When I execute the procedure, it first drops the materialized views already created and fails to create the new ones because of an alleged lack of privileges.
Instead, if I run the code as a script, it perfectly works.
I tried to create a simpler stored procedure, but I get the same error.
Is there anyone able to explain why it happens or how to understand the reason?
I have a problem with an Oracle stored procedure that dynamically creates some materialized views.
The procedure first drops the materialized views if there are any with the same name of the ones that will be created. Then it creates the new materialized views.
Both the statements of drop and create are execute by means of the execute immediate command.
When I execute the procedure, it first drops the materialized views already created and fails to create the new ones because of an alleged lack of privileges.
Instead, if I run the code as a script, it perfectly works.
I tried to create a simpler stored procedure, but I get the same error.
Is there anyone able to explain why it happens or how to understand the reason?
Share Improve this question edited Jan 7 at 18:00 marc_s 754k183 gold badges1.4k silver badges1.5k bronze badges asked Jan 7 at 17:32 ennezetaquennezetaqu 251 silver badge4 bronze badges 1 |1 Answer
Reset to default 0You'll need to grant CREATE TABLE and CREATE MATERIALIZED VIEW to the account that owns the procedure.
本文标签: No privileges when executing Oracle stored procedureStack Overflow
版权声明:本文标题:No privileges when executing Oracle stored procedure - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736786587a1952895.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
drop
privilege granted directly but thecreate
privilege granted via a role? (This is similar, but there will be better duplicate targets...) Why are you dropping and creating objects at runtime at all though - that is not a normal pattern? Unless the view definition changes each time you can refresh it (if that isn't already automatic). Or perhaps an MV isn't the right solution for whatever you're doing. – Alex Poole Commented Jan 7 at 17:59