删除表空间(危险操作,谨慎使用)
1、删除非空表空间,包含物理文件
drop tablespace tablespaceName including contents and datafiles;
2、删除非空表空间,不包含物理文件
drop tablespace tablespaceName including contents;
3、删除空的表空间,不包含物理文件
drop tablespace tablespace_name;
4、删除空表空间,包含物理文件
慎重使用,危险操作
drop tablespace tablespaceName including datafiles;
1.创建表空间
create tablespace CREATETABLE
datafile 'CREATETABLE.dbf'
size 1024m
autoextend on
next 100m
maxsize unlimited;
datafile:指定表空间文件存储的位置;
size:表空间初始值大小;
autoextend:开启表空间大小自动扩展;
next:每次启动扩招的大小;
maxsize:表空间的最大值,unlimited表示无限制;
2.创建用户,关联表空间
create user create_table identified by create_table
default tablespace CREATETABLE profile default account unlock;
3.给用户授权
grant connect, resource to create_table ;
grant unlimited tablespace to create_table ;
4.测试
用户名:create_table
密码:create_table
如果失败,请检查端口,ip,服务名等。