1.創建表空間
create tablespace xxx datafile 'd:\...\book.dbf'
size 32M autoextend on next 10M maxsize 1000M;
注:表空間一般放置位置select * from dba_data_files;
用戶要求有DBA權限,不過通常情況表空間放置在D:\APP\用戶名\ORADATA\ORCL\USERS01.DBF裏面
2.設置默認表空間
alter database default tablespace xxx;
commit;
select default_tablespace from user_users;
3.查看錶空所在位置及佔用空間大小
select tablespace_name,file_id,file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
4.增大表空間大小
alter database datafile '表空間位置' resize 新的大小
除了增大尺寸外,還有兩種方式
方式一:增加數據文件的個數
alter tablespace book add datafile '\oracle\oradata\anita_2015.dbf' size 1000M;
方式二:設置表空間自動擴展
alter database datafile '\...\..'
autoextend on next 100M maxsize 10000M;