1)创建永久表空间
create tablespace test datafile 'F:\dataspace\test.dbf' size 20M autoextend on;
(注:其中autoextend on作用是当容量不够时自动扩展;dataspace目录下的test.dbf文件不要直接右键删除,那样子有可能会导致数据库崩溃)
2)查询所有的系统表空间
select * from dba_tablespaces;
3)删除表空间
drop tablespace test including contents and datafiles;
4)创建用户
create user linn identified by 123456 default tablespace test temporary tablespace temp;
(注:“default tablespace test”:对应的表空间;“temporary tablespace temp”:临时表空间)
5)查询所有用户
select * from dba_Users;
6)删除用户
drop user linn;
7)
①给用户上锁
alter user linn account lock;
②给用户解锁
alter user linn account unlock;
8)
①给用户设置连接权限
grant connect to linn;
②若该用户已有连接权限,则可以将权限指定给用户admin
grant connect to linn with admin option;
③扩大用户的权限,可以将dba的权限指定给该用户
grant dba to linn with admin option;
④将用户连接权限收回
revoke connect from linn;
⑤将dba权限收回
revoke dba from linn;