自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle 數(shù)據(jù)庫中查看表空間的2種方法

數(shù)據(jù)庫 Oracle
本文主要講述的是Oracle 數(shù)據(jù)庫中查看表空間使用狀況的兩種方法的介紹,你如果是Oracle數(shù)據(jù)庫的瘋狂一族的話,以下的文章,會對你有所幫助。

Oracle 數(shù)據(jù)庫中查看表空間使用狀況是我們在實際應(yīng)用中經(jīng)常涉及到的,以下的內(nèi)容就就是對Oracle 數(shù)據(jù)庫中查看表空間使用狀況時所要用到的SQL的描述,希望你能從中獲得自己想要的東西。

Oracle表空間的事情狀況要經(jīng)常查看,一般空閑比例過低的時候就應(yīng)該考慮增大表看空間了。查看方法如下SQL:

方法一:

 

  1. select dbf.tablespace_name,  
  2. dbf.totalspace "總量(M)",  
  3. dbf.totalblocks as 總塊數(shù),  
  4. dfs.freespace "剩余總量(M)",  
  5. dfs.freeblocks "剩余塊數(shù)",  
  6. (dfs.freespace / dbf.totalspace) * 100 "空閑比例"  
  7. from (select t.tablespace_name,  
  8. sum(t.bytes) / 1024 / 1024 totalspace,  
  9. sum(t.blocks) totalblocks  
  10. from dba_data_files t  
  11. group by t.tablespace_name) dbf,  
  12. (select tt.tablespace_name,  
  13. sum(tt.bytes) / 1024 / 1024 freespace,  
  14. sum(tt.blocks) freeblocks  
  15. from dba_free_space tt  
  16. group by tt.tablespace_name) dfs  
  17. where trim(dbf.tablespace_name) = trim(dfs.tablespace_name) 

 

方法二:

 

  1. SELECT Total.name "Tablespace Name",  
  2. Free_space, (total_space-Free_space) Used_space, total_space  
  3. FROM  
  4. (select tablespace_name, sum(bytes/1024/1024) Free_Space  
  5. from sys.dba_free_space  
  6. group by tablespace_name  
  7. ) Free,  
  8. (select b.name, sum(bytes/1024/1024) TOTAL_SPACE  
  9. from sys.v_$datafile a, sys.v_$tablespace B  
  10. where a.ts# = b.ts#  
  11. group by b.name  
  12. ) Total  
  13. WHERE Free.Tablespace_name = Total.name 

 

當(dāng)發(fā)現(xiàn)有的Oracle 數(shù)據(jù)庫里查看表空間不夠的錯誤時,處理如下:
1:找出該表空間對應(yīng)的數(shù)據(jù)文件及路徑

 

  1. select * from dba_data_files t  
  2. where t.tablespace_name = 'ARD' 

 

2:增大數(shù)據(jù)文件

alter database datafile '全路徑的數(shù)據(jù)文件名稱' resize ***M

3:增加數(shù)據(jù)文件

alter tablespace 表空間名稱

add datafile '全路徑的數(shù)據(jù)文件名稱' ***M

注解:Oracle 數(shù)據(jù)庫里查看的表空間盡量讓free百分比保持在10%以上,如果低于10%就增加datafile或者resizedatafile,一般數(shù)據(jù)文件不要超過2G
 

【編輯推薦】

  1. Oracle 數(shù)據(jù)庫的SQL的描述
  2. Oracle用戶密碼的修改方案
  3. Oracle存儲過程的開發(fā)的介紹
  4. 開發(fā)Oracle存儲過程的步驟介紹
  5. Oracle表列的修改具體步驟介紹
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2010-11-19 14:51:09

Oracle數(shù)據(jù)庫關(guān)閉

2010-06-02 16:14:14

導(dǎo)入MySQL

2010-10-27 16:33:39

Oracle查看表空間

2010-10-28 14:18:01

oracle數(shù)據(jù)庫版本

2010-09-13 15:41:23

sql server數(shù)

2010-03-24 09:42:12

Oracle數(shù)據(jù)庫

2010-04-07 18:26:43

Oracle數(shù)據(jù)庫

2010-07-29 09:56:45

Flex數(shù)據(jù)庫

2010-04-29 15:58:51

Oracle存儲過程

2010-04-16 10:00:06

Oracle查看表空間

2009-10-29 16:32:24

查看Oracle用戶的

2009-04-20 14:29:41

Oracle連接創(chuàng)建連接

2009-03-30 14:19:26

優(yōu)化數(shù)據(jù)庫MySQL

2009-07-22 11:33:14

JDBC連接Sybas

2011-08-02 17:26:38

Oracle數(shù)據(jù)庫遠(yuǎn)程連接

2010-10-27 17:11:35

oracle查詢

2011-05-26 13:16:37

Oracle數(shù)據(jù)庫備份

2010-04-26 18:32:48

Oracle數(shù)據(jù)庫

2011-08-29 17:25:21

Oracle日期范圍搜索

2010-11-16 11:17:41

Oracle表空間大小
點贊
收藏

51CTO技術(shù)棧公眾號