当前位置:数据库 > Oracle >>

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

oracle给用户只访问指视图或表的权限
 
[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_易做图ysis 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_易做图ysis 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
只能访问指定表或视图的选择权限!
 
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,