SQL 如何在 oracle 11g 中授予触发器和同义词的权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34429497/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 04:16:45  来源:igfitidea点击:

How to grant privileges on trigger and synonyms in oracle 11g

sqloracleoracle11gprivileges

提问by Mamta Vyas

I have created a sample application to get schema of all objects and generate SQLfile, so I simply created two user, user 'SYSTEM' and 'SCOTT' , and user SYSTEM grant all privileges to access some of tables,views,function etc. to user SCOTT, for grant privileges to user SCOTT use following oracle query

我创建了一个示例应用程序来获取所有对象的架构并生成 SQLfile,所以我简单地创建了两个用户,用户 'SYSTEM' 和 'SCOTT',用户 SYSTEM 授予所有权限以访问某些表、视图、函数等。用户 SCOTT,要授予用户 SCOTT 的权限,请使用以下 oracle 查询

GRANT ALL ON table_name to username

But the problem is this query is not working for trigger and synonyms. so anyone please suggest me how can I grant privileges on triggers and synonyms to user SCOTT.

但问题是此查询不适用于触发器和同义词。所以任何人都请建议我如何向用户 SCOTT 授予触发器和同义词的权限。

回答by Lalit Kumar B

But the problem is this query is not working for trigger and synonyms. so anyone please suggest me how can I grant privileges on triggers and synonyms to user SCOTT.

但问题是此查询不适用于触发器和同义词。所以任何人都请建议我如何向用户 SCOTT 授予触发器和同义词的权限。

  • TRIGGER- You cannot t give grants for trigger. There is no such thing. Triggers fire automatically whenever the trigger event is done on the table on which the the trigger is created. You only need to grant privilege on the table.

  • SYNONYM- You just create a synonym for the schema.tableand grant privilege on the table such that other users doesn't have to fully qualify the table and just use the synonym instead.

  • TRIGGER- 您不能为触发器提供资助。哪有这回事。只要触发器事件在创建触发器的表上完成,触发器就会自动触发。您只需要授予对表的权限。

  • SYNONYM- 您只需为schema.table表创建一个同义词并授予权限,这样其他用户就不必完全限定该表而只需使用同义词即可。