oracle 创建用户和视图并授权

  • 创建用户和授权
# 删除用户名为 cascade 的用户
drop user usernam cascade
# 创建用户 username 并设置验证密码 password
create user usernam identified by password
# 授权(connect/resource权限)
grant connect,resource to usernam
  • 创建视图并授权
# 创建只读视图
CREATE OR REPLACE VIEW CODE_TREE AS
 SELECT * FROM T_CODE_TREE
 WITH READ ONLY
# 创建用户
 CREATE USER dms_2020 IDENTIFIED BY dms_2020
# 授权,连接权限和指定视图权限
GRANT CONNECT TO dms_2020
GRANT SELECT ON CODE_TREE TO dms_2020
posted @ 2021-08-17 10:26  huanggy  阅读(857)  评论(0编辑  收藏  举报