Oracle Tablespace & Datafiles–Oracle資料表空間–應用執行個體(2)

來源:互聯網
上載者:User

1.建立tablespace test:表示建立一個名為test的tablespace,test的大小為8M,自動成長步長為5M,最大空間是10M。

create tablespace test datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M autoextend on next 5M maxsize 10M;

 

2.建立tablespace sales:表示建立一個名為sales的tablespace,sales的大小為800M,自動成長步長為50M,沒有最大空間限制。
create tablespace sales datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize unlimited maxsize UNLIMITED; --是大小不受限制

 

3.建立tablespace sales:表示建立一個名為sales的tablespace,sales的大小為800M,自動成長步長為50M,最大空間為1000M,

 採用local管理方式,unform表示區的大小相同,預設為1000M。
create tablespace sales datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local uniform; --unform表示區的大小相同,預設為1000M

 

4.建立tablespace sales:表示建立一個名為sales的tablesapce,sales的大小為800M,自動成長步長為50M,最大空間為1000M,

採用local管理方式,uniform表示區的大小相同為500M。 
create tablespace sales datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local uniform size 500K; --unform size 500K;表示區的大小相同,為500K

 

5.建立tablespace sales:表示建立一個名為sales的tablespace,sales的大小為800M,自動成長步長為50M,最大空間為1000M,

採用local管理方式,automaticate表示區的大小由隨表的大小自動動態改變,大表使用大的分區,小表使用小的分區。 
create tablespace sales datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local autoallocate; --autoallocate表示區的大小由隨表的大小自動動態改變,大表使用大區小表使用小區

 

6.建立tablespace sales:表示建立一個名為sales的tablespace,sales的大小為800M,自動成長步長為50M,最大空間為1000M,

 temporary表示建立字典管理暫存資料表空間。
create tablespace sales datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize 1000M temporary; --temporary建立字典管理暫存資料表空間

 

7.建立臨時tablespace sales:表示建立一個名為sales的temporary tablespace,並且datafile變成tempfile。
create temporary tablespace sales tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M autoextend on next 50M maxsize 1000M --建立本地管理暫存資料表空間,如果是暫存資料表空間,所有語句中的datafile都換為tempfile 8i系統預設建立字典管理暫存資料表空間,要建立本地管理暫存資料表空間要加temporary tablespace關鍵字

 

8.建立本地管理暫存資料表空間時,不得使用atuoallocate參數,系統預設建立uniform管理方式 為資料表空間增加資料檔案:
alter tablespace sales add datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M autoextend on next 50M maxsize 1000M;

 

9.為資料表空間增加資料檔案 

alter tablespace sales add datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M autoextend on next 50M maxsize 1000M;

 

10.更改自動擴充屬性

alter database datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf', '/home/app/oracle/oradata/oracle8i/sales02.dbf' '/home/app/oracle/oradata/oracle8i/sales01.dbf autoextend off;

 

11.刪除資料表空間

Drop tablespace test INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;

文法參考 orale tablespace&datafile -- oracle資料表空間

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.