创建用户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';
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';