oracle数据库sql语句14 数据库管理

conn system/12345678


--查询所有用户状态
select username,account_status from dba_users;


--查询数据文件
select tablespace_name, file_name from dba_data_files;


--查询所有权限
select * from system_privilege_map;


--创建用户
create user user1 identified by 123;


--授予连接数据库 创建数据库 权限
grant connect to user1;
grant resource to user1;


--授予权限
grant create session, create table, create view to user1;


--授予权限 传递性
grant create session, create table, create view to user1 with admin option;


--回收权限
revoke create table, create view from user1;


conn user1/123
create table aaa(id int);


--连接数据库的权限
grant create session to user1;


grant unlimited tablespace to user1;//授予user1用户使用表空间的权限


--创建表的权限
grant create table to user1;


--删除表的权限
grant drop any table to user1;


--插入表的权限
grant insert any table to user1;


--修改表的权限
grant update any table to user1;


grant all to public;//这条比较重要,授予所有权限(all)给所有用户(public)




grant select on tablename to user1;//授予zhangsan用户查看指定表的权限


grant drop on tablename to user1;//授予删除表的权限


grant insert on tablename to user1;//授予插入的权限


grant update on tablename to user1;//授予修改表的权限


grant insert(id) on tablename to user1;


grant update(id) on tablename to user1;//授予对指定表特定字段的插入和修改权限,注意,只能是insert和update


grant alert all table to user1;//授予zhangsan用户alert任意表的权限
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值