Oracle 用户的相关操作

创建用户jade:
create user jade
identified by jade
default tablespace jade_SPACES
temporary tablespace temp
profile DEFAULT;
授予用户jade权限:
-- Grant/Revoke role privileges
grant connect to jade;
grant dba to jade;
grant resource to jade;
-- Grant/Revoke system privileges
grant alter any index to jade;
grant alter any table to jade;
grant alter tablespace to jade;
grant create any index to jade;
grant create any table to jade;
grant create tablespace to jade;
grant drop any index to jade;
grant drop any table to jade;
grant drop tablespace to jade;
grant manage tablespace to jade;
grant select any table to jade;
grant unlimited tablespace to jade;

删除权限:
revoke connect, resource from jade
删除用户
drop user user01
删除用户及其对象:
drop user user01 CASCADE
查看当前登录的用户:
select user from dual;
查看所有登录的用户:
select username from v$session
查看用户权限:
select * from user_role_privs;
查看用户下所有的表
select * from user_tables;
查看用户序列号
select * from user_sequences;
查看视图的名称
select view_name from user_views;
查看用户是否被锁住:
select USERNAME , ACCOUNT_STATUS from dba_users;
解锁scott:
alter user scott account unlock;
解锁之后可能会要求改密码:
alter user scott identified by tiger;
(注:以下用户具有管理员身份)
查看用户密码是否过期:
select * from USER_HISTORY$;
密码过期修改:alter user <user_name> password expire;
alter user <user_name> password expire;
查询用户是否存在密码:
SELECT name,password FROM user$ WHERE name='SCOTT';
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值