oracle 在另一个数据库中授予用户

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5802505/
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-18 23:29:36  来源:igfitidea点击:

grant user in another database

oracle

提问by SarSaf

How can I grant 'select' on sequence to user in another database.

如何向另一个数据库中的用户授予“选择”顺序。

the syntax: grant select on SEQ_NAME to USER_NAME; allowed only to users in the same database.

语法:将 SEQ_NAME 上的选择授予 USER_NAME;仅允许同一数据库中的用户使用。

回答by ik_zelf

You remote user first needs to have some way to connect to your database. In Oracle this is done by creating a database link. The database link has to be created in the remote database and has to connect to your database. In the connect definition to your database, a user can be specified to use for the connection in your database. That user needs to have the select privilege. If there is no user specified in the database link definition, the remote user name will connect to your database using the same name as the remote username, using the same password. So, in both cases the privilege has to be granted to a user in your database.

您的远程用户首先需要通过某种方式连接到您的数据库。在 Oracle 中,这是通过创建数据库链接来完成的。数据库链接必须在远程数据库中创建,并且必须连接到您的数据库。在数据库的连接定义中,可以指定一个用户用于数据库中的连接。该用户需要具有选择权限。如果数据库链接定义中没有指定用户,远程用户名将使用与远程用户名相同的名称和相同的密码连接到您的数据库。因此,在这两种情况下,都必须将权限授予数据库中的用户。

create database link to_my_database connect to guest_in_my_database identified by 'bigsecret' using tns_alias_to_my_database;

In this example, you need to grant to guest_in_my_database, after it has been created and given at least the create session privilege.

在此示例中,您需要在 guest_in_my_database 创建并至少授予创建会话权限后授予它。