由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 怎么设置多个用户 (Oracle 10g)?
相关主题
问个关于Oracle recyclebin的菜鸟问题Help: 如何在oracle 9i 中添加1 个user?
question on JOIN on Oracleanother question--怎么delete a row from a table
oracle求助Drop table error.
How to creat user in Oracle?Can I execute alter inPL/SQL
Oracle database link problem求教一ORACLE问题
出道oracle dba 面试题sql server 面试题 (7)
Export Oracle db schema onlySQL Developer, how to switch schema?
Oracle 11g下,如何創建兩個schema,並且求教: dba privilage
相关话题的讨论汇总
话题: johndoe话题: tablespace话题: select话题: grant
进入Database版参与讨论
1 (共1页)
y********o
发帖数: 2565
1
MySQL里面有不同的databases, 比如你可以 show databases 得到一个数据库名称列表
。在Oracle里面与此相对应的是叫做tablespace吗?
假设我是DBA, 对数据库myTestDB有绝对权限。我想创建几个其他用户,让他们对
myTestDB只有read only权限。
我这样试了一下:
create user johndoe
default tablespace myTestDB
identified by thepassword
temporary tablespace temp;
然后我说
grant create session to johndoe;
grant select on myjunktable to johndoe;
grant select on anotherjunktable to johndoe;
结果不对,好像johndoe被另立门户成了一个独立的database。瞧:
SQL> desc myjunktable;
ERROR:
ORA-04043: object myjunktable does not exist
f********t
发帖数: 74
2
I don't think you understand tablespace correctly. tablespaces are used to
organize the datafiles. One datafile can belong to only one tablespace,
while a tablespace can have many datafiles. It is one of the logic structure of the database. A tablespace is not a database and it is not eual to schema either.
You can make a tablespace read only by using ALTER TABLESPACE command.
If you have not created myjunktable, it does not exist for sure.
CREATE USER command should work fine.
y********o
发帖数: 2565
3
Thanks and yes, I don't know what exactly tablespace is.
Also, I am only interested in creating users who have read only permissions
on all tables. I am not interested in creating read-only tables/datafiles/
tablespaces per se.
Can you share some of your wisdom please?
f********t
发帖数: 74
4
Select is an object privilege.
Just grant the privilege to the users, your grant command should work.
f********t
发帖数: 74
5
1. assume user A created myjunktable
2. user A, or SYSDBA, or other users who have been granted select privilege
with grant option on this table can grant the select privilege to other
users
3. put schema in the grant command like
GRANT SELECT ON A.myjunktable to johndoe;
4. test it by using SELECT command after you login as johndoe
good luck
y********o
发帖数: 2565
6

privilege
Thank. Looks like it works now. I followed your instruction.
But johndoe would have to explicitly prefix myjunktable with the schema as
shown below:
select * from A.myjunktable; ---- (1)
In other words, if johndoe issues this:
select * from myjunktable; ----- (2)
Oracle complains that table or view does not exist (ORA-00942).
So, there is no way that (2) would work for johndoe, given this situation,
right? It'll work only if johndoe has a table called myjunktable, am I right

【在 f********t 的大作中提到】
: 1. assume user A created myjunktable
: 2. user A, or SYSDBA, or other users who have been granted select privilege
: with grant option on this table can grant the select privilege to other
: users
: 3. put schema in the grant command like
: GRANT SELECT ON A.myjunktable to johndoe;
: 4. test it by using SELECT command after you login as johndoe
: good luck

f********t
发帖数: 74
7
You are right. you have to specify the schema. myjunktable belong to schema
A.
y********o
发帖数: 2565
8
OK, got it. Thanks.

schema

【在 f********t 的大作中提到】
: You are right. you have to specify the schema. myjunktable belong to schema
: A.

1 (共1页)
进入Database版参与讨论
相关主题
求教: dba privilageOracle database link problem
SQL SERVER 2K5 schema vs. Oracle schema出道oracle dba 面试题
[转载] what's wrong with this PL/SQLExport Oracle db schema only
Oracle急问Oracle 11g下,如何創建兩個schema,並且
问个关于Oracle recyclebin的菜鸟问题Help: 如何在oracle 9i 中添加1 个user?
question on JOIN on Oracleanother question--怎么delete a row from a table
oracle求助Drop table error.
How to creat user in Oracle?Can I execute alter inPL/SQL
相关话题的讨论汇总
话题: johndoe话题: tablespace话题: select话题: grant