Oracle简单命令

Oracle启动,创建用户,创建角色,给用户授权

启动Oracle

sqlplus sys/1234 as sysdba	//sys用户登录
sqlplus mike/1234		// 普通用户登录 

简单命令

1,创建新用户并设置密码为pwd123

	create user mike identified by "123";	//此时用户还没有登录权限

2,创建新用户,设置密码,并设置默认表空间为USERS

create user tom identified by pwd123
default tablespace users
quota 50m on users;
grant create session to tom; --授予登录权限
grant unlimited tablespace to tom;	--授予无线表空间

3,创建用户,并设置用户为过期,用户状态为加锁

create user peter identified by pwd123
password expire
account lock;
alter user peter account unlock;	--解锁用户
alter user peter identified by pwd123;-- 修改用户密码
password peter;-- 修改用户密码

4,创建角色,角色:一组相关权限的集合

create role testrole;	--创建角色
grant create any table,create session to testrole;-- 授予登录和创建表的权限
grant select on scott.EMP to testrole; -- 授予角色访问sctt用户下的EMP表权限
grant testrole to peter;-- 将角色授予给用户
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值