创建表空间的命令:
create tablespace hr datafile ‘/u01/app/oracle/oradata/ORADB/pdb1/HR1.dbf’ size 10M AUTOEXTEND ON NEXT 1M MAXSIZE 100M;
数据文件一般时.dbf文件,归档文件一般是.arc文件,控制文件一般是.ctl文件,参数文件一般是.ora文件
扩展表空间:
alter tablespace hr datafile add datafile ‘/u01/app/oracle/oradata/ORADB/pdb1/HR2.dbf’ size 10M AUTOEXTEND ON NEXT 1M MAXSIZE 100M;
创建undo表空间:
create undo tablespace undo2 datafile ‘/u01/app/oracle/oradata/ORADB/pdb1/undo2.dbf’ size 10M AUTOEXTEND ON NEXT 1M MAXSIZE 100M;
每个数据可以有若干个表空间,查看当前使用的哪个undo表空间
show parameter undo
更改当前使用的undo表空间:
alter system set undo_tablespace=undo2
临时表空间的创建
create temporary tablespace temp2 tempfile ‘/u01/app/oracle/oradata/ORADB/pdb1/undo2.dbf’ size 10M AUTOEXTEND ON NEXT 1M MAXSIZE 100M;
更改当前使用的临时表空间:
alter database default temporary tablespace temp2;
创建表时如果不指定表空间,要看创建表的用户用的是哪个表空间ÿ