创建表空间
create tablespace NNC_DATA01 datafile
‘D:\oracle\product\10.2.0\oradata\orcl10\nnc_data01.dbf’ size 500M autoextend on next 50M extent management local uniform size 512k;
create tablespace NNC_INDEX01 datafile
‘D:\oracle\product\10.2.0\oradata\orcl10\nnc_index01.dbf’ size 500M autoextend on next 50M extent management local uniform size 256k;
表空间默认最大32G,当超出时
ALTER TABLESPACE NNC_DATA01 ADD DATAFILE
‘F:\oracle\tablespace\NNC_DATA01_01.DBF’ SIZE 500M
AUTOEXTEND ON NEXT 50M;
删除表空间
–删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
–删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
–删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
–删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
–如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;
创建oracle用户及授权
Create user nc63train identified by a default tablespace
NNC_DATA01 temporary tablespace temp;
Grant connect,dba to nc63train;
删除用户
DROP USER XX CASCADE