表空間的一些知識

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;



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章