ORACLE学习第三天

1、创建oracle用户:create user test identified by test;

使用select * from dba_users可以查询到所有的用户

2、创建用户时指定表空间:create user test identified by test default tablespace test temporary tablespace temp;

3、查看数据库的默认表空间: select * from database_properties

其中:

     DEFAULT_PERMANENT_TABLESPACE                             USER                                 Name of default permanent tablespace

     DEFAULT_TEMP_TABLESPACE                                       TEMP                                 Name of default temporary tablespace

4、修改默认表空间:

     alter database dafault tablespace test;

5、使用户口令过期:alter   user test password expire;

6、锁定用户:alter user test account lock;

7、解锁:alter user test account unlock;

8、查看数据库状态:select status from v$instance

9、给用户分配表空间限额:alter user test  quota 10m on test(表空间名称) 50m on users;

 或者在摸个表空间上不限制配额:alter useer test quota unlimited on test(表空间名称);

10、配额相关视图:select * from dba_ts_quota

11、oracle的五种基本权限:connect 、resource 、imp_full_database 、exp_full_database和dba

12、特殊授权unlimited tablespace 只能授权给用户不能授权给角色

13、查看用户具有哪些角色:select * from dba_role_privs

       修改用户的角色时需要重新登录后才会生效

14、查看用户具有哪些系统权限:select * from dba_sys_privs

15、查看登录用户的权限:select * from session_privs

16、授予用户权限:grant  create session to test;

17、授予用户可以继续向下授权的权限:grant  create session to test with admin option;

18、回收用户权限:revoke create session from test;

19、

原文地址:https://www.cnblogs.com/cangos/p/2360232.html