ORACLE用户管理

                                         ORACLE用户管理


作者:Vashon

时间:20140305

发布时间:20151208


创建用户:create user 用户名 identified by 密码;
范例:创建一个c##Vashon用户并设置密码为123456:
create user c##Vashon identified by 123456;


范例:将用户解锁:alter user scott account unlock 
范例:锁定用户:alter user scott account lock    
范例:修改当前用户的密码:alter user scott identified by 新密码 
范例:让密码失效:alter user scott password expire;这样下次再登录时就必须强制用户修改密码。


使用oracled的数据字典查看所有用户
select * from dba_users;


删除用户:drop user 用户名 cascade;


范例:创建一个比较完整的用户,建立后会使用默认的配置。
create user c##Vashon identified by 123456 
defaulttablespace ywx_data
temporary tablespace ywx_temp
quota 30m on ywx_data
quota 30m on users
account unlock
password expire;  //密码失效
其中:ywx_data、ywx_temp、users是表空间和临时表空间


此时的用户(c##Vashon)无法使用,因为没有权限


conn c##Vashon/123456
连接不上,因为没有connect权限,用户sys用户登录,授权
conn / as sysdba
grant connect to c##Vashon;
再用test用户连接
conn c##Vashon/123456 可以连接了。


可以在创建用户后修改用户表空间和临时表空间
alter user test3 default tablespace tabs;
alter user test3 temporary tablespace tmptbs;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值