Oracle数据库创建用户相关

Oracle数据库创建一个用户,赋予角色,给相关表的只读(select)权限

--创建用户
create user etl_admin identified by YdEtl_ehr;
--修改用户密码
alter user etl_admin identified by YdEtl_ehr;
--删除用户
drop user etl_admin cascade;
drop user etl_admin;
--创建角色
create role etl_admin_select;
--授权角色
grant select on TB_HCM.TB_STA_EMP_ORG to etl_admin_select;
grant select on TB_HCM.TB_ORG_POSITION to etl_admin_select;
grant select on TB_HCM.TB_STA_EMP_CLASS to etl_admin_select;
grant select on TB_HCM.TB_STA_EMP to etl_admin_select;
grant select on TB_HCM.TB_ORG_ORGUNIT to etl_admin_select;
--删除角色
drop role etl_admin_select;
--给用户授权
grant connect, etl_admin_select to etl_admin;
--给用户撤销权限
revoke connect, etl_admin_select from etl_admin;

 

 

你可能感兴趣的:(数据库,oracle)