您的位置:首页 > 数据库 > Oracle

oracle给用户只访问指视图或表的权限

2013-03-21 01:30 369 查看
[sql]

-- Create the user   

create user LIMS_FSGL 

  identified by "LIMS_FSGL"  

  default tablespace VGSM_DB 

  temporary tablespace TEMP2 

  profile DEFAULT; 

-- Grant/Revoke role privileges   

grant connect to LIMS_FSGL ; 

grant resource to LIMS_FSGL; 

grant unlimited tablespace to LIMS_FSGL; 

grant create session to LIMS_FSGL;  

[sql]

GRANT SELECT ON VGSM.V_SAMPLE TO LIMS_FSGL;  

GRANT SELECT ON VGSM.V_SAMPLE_POINT TO LIMS_FSGL;  

grant select on vgsm.sample to lims_fsgl; 

grant select on vgsm.test to lims_fsgl; 

grant select on vgsm.result to lims_fsgl;  

grant select on vgsm.plant to lims_fsgl; 

grant select on vgsm.sample_point to lims_fsgl; 

grant select on vgsm.mlp_analysis to lims_fsgl;  

grant select on vgsm.mlp_components to lims_fsgl; 

grant select on vgsm.mlp_header to lims_fsgl;  

grant select on vgsm.mlp_level to lims_fsgl; 

grant select on vgsm.mlp_values to lims_fsgl; 

grant select on vgsm.mlp_view22 to lims_fsgl;  

 

创建用户并指定默认表空间、临时表空间、连接与资源的权限给用户LIMS_FSGL


[sql]

-- Create the user  

create user LIMS_FSGL 

  identified by "LIMS_FSGL" 

  default tablespace VGSM_DB 

  temporary tablespace TEMP2 

  profile DEFAULT; 

-- Grant/Revoke role privileges  

grant connect to LIMS_FSGL ; 

grant resource to LIMS_FSGL;  

 
不限制表空间  及 可以创建对话  给用户LIMS_FSGL

[sql]

grant unlimited tablespace to LIMS_FSGL; 

grant create session to LIMS_FSGL;  

 
将相应的表或视图的选择权限 给用记LIMS_FSGL

[sql]

GRANT SELECT ON VGSM.V_SAMPLE TO LIMS_FSGL;  

GRANT SELECT ON VGSM.V_SAMPLE_POINT TO LIMS_FSGL;  

grant select on vgsm.sample to lims_fsgl;  

grant select on vgsm.test to lims_fsgl; 

grant select on vgsm.result to lims_fsgl; 

grant select on vgsm.plant to lims_fsgl;  

grant select on vgsm.sample_point to lims_fsgl; 

grant select on vgsm.mlp_analysis to lims_fsgl; 

grant select on vgsm.mlp_components to lims_fsgl; 

grant select on vgsm.mlp_header to lims_fsgl;  

grant select on vgsm.mlp_level to lims_fsgl; 

grant select on vgsm.mlp_values to lims_fsgl; 

grant select on vgsm.mlp_view22 to lims_fsgl;  
 
设置完成,也就完成了用户LIMS_FSGL

只能访问指定表或视图的选择权限!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle学习经验