KingbaseES数据库对system用户权限限制

一、环境介绍
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit

操作系统:CentOS release 6.9 (Final)
数据库版本:V008R006C005B0054

二、权限讲解

测试过程KESV8数据库的restricted_dba插件,功能是限制超级用户的权限,当restricted_dba插件功能开启后,Superuser将不能更改其他用户所拥有的以下对象

三、测试权限限制

 1、加载插件restricted_dba限制system用户权限  vim kingbase.conf

检测插件grep restricted_dba kingbase.conf

2、重启数据库服务,使插件生效

3、创建名为restricted_dba 的extension

       create extension restricted_dba;

注:使用sso用户打开restricted_dba的开关
\c - sso
alter system setrestricted_dba.restricted_enable=on;
重新加载一下参数
select sys_reload_conf();

4、普通用户建表及写入数据测试

create table t300(id int,name text);

insert into t300 selectgenerate_series(1,1000),md5(random());

select * from t300 limit 2;

5、用system用户查询普通用户的数据,修改普通用户的表结构,及删除表等测试

ksql -Usystem -d test

\dt  可以看到t300表的所有者是user01

 

select * from t300;

ERROR: permission denied for table t300

 

alter table t300 add column address text;

ERROR: must be owner of table t300

 

drop table t300;

ERROR: must be owner of table t300

限制DBA权限测试完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值