欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

六分鐘學(xué)會創(chuàng)建Oracle表空間的實(shí)現(xiàn)步驟

 更新時間:2013年06月12日 19:19:18   作者:  
這里介紹創(chuàng)建Oracle表空間的步驟,首先查詢空閑空間、增加Oracle表空間、修改文件大小語句如下、創(chuàng)建Oracle表空間,最后更改自動擴(kuò)展屬性

經(jīng)過長時間學(xué)習(xí)創(chuàng)建Oracle表空間,于是和大家分享一下,看完本文你肯定有不少收獲,希望本文能教會你更多東西。

1、先查詢空閑空間

復(fù)制代碼 代碼如下:

select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;

2、增加Oracle表空間

先查詢數(shù)據(jù)文件名稱、大小和路徑的信息,語句如下:

復(fù)制代碼 代碼如下:

select tablespace_name,file_id,bytes,file_name from dba_data_files;

3、修改文件大小語句如下

復(fù)制代碼 代碼如下:

alter database datafile  
'需要增加的數(shù)據(jù)文件路徑,即上面查詢出來的路徑 
'resize 800M;

4、創(chuàng)建Oracle表空間

復(fù)制代碼 代碼如下:

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

create tablespace sales  
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
autoextend on  
next 50M  
maxsize unlimited  
maxsize unlimited 是大小不受限制  

create tablespace sales  
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
autoextend on  
next 50M  
maxsize 1000M  
extent management local uniform;  
unform表示區(qū)的大小相同,默認(rèn)為1M  

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表示區(qū)的大小相同,為500K  

create tablespace sales  
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
autoextend on  
next 50M  
maxsize 1000M  
extent management local autoallocate;  
autoallocate表示區(qū)的大小由隨表的大小自動動態(tài)改變,大表使用大區(qū)小表使用小區(qū)  

create tablespace sales  
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
autoextend on  
next 50M  
maxsize 1000M  
temporary;  
temporary創(chuàng)建字典管理臨時表空間  

create temporary tablespace sales  
tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M  
autoextend on  
next 50M  
maxsize 1000M  
創(chuàng)建本地管理臨時表空間,如果是臨時表空間,所有語句中的datafile都換為tempfile  

8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時表空間,要創(chuàng)建本地管理臨時表空間要加temporary tablespace關(guān)鍵字  
創(chuàng)建本地管理臨時表空間時,不得使用atuoallocate參數(shù),系統(tǒng)默認(rèn)創(chuàng)建uniform管理方式  

為表空間增加數(shù)據(jù)文件:  
alter tablespace sales add  
datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M  
autoextend on next 50M  
maxsize 1000M;

創(chuàng)建本地管理臨時Oracle表空間,如果是臨時表空間,所有語句中的datafile都換為tempfile8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時表空間,要創(chuàng)建本地管理臨時表空間要加temporary tablespace關(guān)鍵字創(chuàng)建本地管理臨時表空間時,不得使用atuoallocate參數(shù),系統(tǒng)默認(rèn)創(chuàng)建uniform管理方式

為表空間增加數(shù)據(jù)文件:

復(fù)制代碼 代碼如下:

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

5、更改自動擴(kuò)展屬性:

復(fù)制代碼 代碼如下:

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;

以上介紹創(chuàng)建Oracle表空間,在這里拿出來和大家分享一下,希望對大家有用。

相關(guān)文章

最新評論