如何在多个对象之间使用一个模式而不在对象之前添加模式名称的前缀? [英] How to use one schema by multiple users without pre-fixing schema name before the objects?

查看:39
本文介绍了如何在多个对象之间使用一个模式而不在对象之前添加模式名称的前缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了很多帖子来解决以下问题.但是无法解决.有人可以解决这个问题吗?

I have searched for many posts to achieve the below problem. But could not get the solution. Can some one resolve this please.

问题. 我创建了一个名为RAMFULL的用户/架构,并授予了connect,resource特权.我想使用名为RAMREAD的oracle用户作为具有只读特权的别名访问该用户.在访问/使用RAMFULL中的对象时,我不需要向其他人提及管理员/完全特权用户RAMFULL.

Problem. I have created a user/Schema with name RAMFULL with connect,resource privileges granted. and I want to access this user with oracle user called RAMREAD as alias having read only privilege. I need not mention the Adminitrator/full privilege user RAMFULL to others during the accessing/using the objects in RAMFULL.

  1. 我已经创建了一个名称为RAMFULL的用户/架构

  1. I have created a user/Schema with name RAMFULL

我正在以相同的用户名使用此用户/方案进行所有CRUD操作.

I am using this user/schema with same username for all CRUD operations.

问题是我必须将此架构提供给我的开发中心才能分析问题.但是我不想给他们这个数据库.由于它具有所有特权,并且可以被它们篡改或尝试.

The problem is I have to give this schema to my development center to analyze an issue. but I do not want to give them this db as it is. Since it has all the privileges and it can be tampered or experimented by them.

现在,我正在寻找一种解决方案来创建另一个仅具有只读特权的用户,并且在他登录该帐户/架构时,除了特权之外,其他人应该会喜欢使用原始架构.

NOW, I am looking for a solution to create another user which will have only read only privileges and the moment he logs into that account/schema, a person should feel like working on Original schema except the privileges.

我看过很多文章,我可以通过分配给另一个用户来创建同义词或使用Ro来创建角色.但是在所有这些问题中,问题是当我确实选择时,我必须对模式名称进行前缀固定.例如,如果我需要搜索表,则必须从SCHEMA1.TABLE1中选择Select count(*).

I have seen many articles and I could able to get creating synonyms or creating role with Ro by assigning to another user. But in all these the problem is when I do select I have to pre-fix the schema name. For example if I need to search for a table I have to give Select count(*) from SCHEMA1.TABLE1;

我想知道是否可以使用具有只读权限的RAMREAD用户访问架构RAMFULL.在使用RAMREAD用户时,我不应该在任何地方给/提及RAMFULL用户.请帮帮我.

I want to know if Schema RAMFULL can be access using RAMREAD user with Read Only privileges. I should not give/mention RAMFULL user anywhere while I am working on RAMREAD user. Please help me out.

推荐答案

您可以更改会话以执行此操作:

alter session set current_schema = RAMREAD;

引用:

在会话期间随后对架构对象的不合格引用将解析为指定架构中的对象.

Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema.

它没有赋予您任何其他特权,因此您仍然需要在RAMFULL中的所有表上授予SELECT,以使用户登录到RAMREAD才能看到

It doesn't give you any additional privileges so you would still need to grant SELECT on all the tables in RAMFULL that you wanted the user logged into RAMREAD to be able to see

这篇关于如何在多个对象之间使用一个模式而不在对象之前添加模式名称的前缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆