1. 程式人生 > >oracle 給使用者只訪問指檢視 或 表 的許可權

oracle 給使用者只訪問指檢視 或 表 的許可權

-- 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;

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

-- 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

grant unlimited tablespace to LIMS_FSGL;
grant create session to LIMS_FSGL;


將相應的表或檢視的選擇許可權 給用記LIMS_FSGL

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

只能訪問指定表或檢視的選擇許可權!