Oracle 查看索引資料表空間

來源:互聯網
上載者:User

標籤:

Oracle 查看錶空間的使用方式或資料表空間的大小,應該如何?呢?下面就為您介紹實現 Oracle 查看錶空間方面的語句。 

    1、查看錶空間的使用方式 

Java代碼  
  1.    
  2. select sum(bytes)/(1024*1024) as free_space,tablespace_name   
  3. from dba_free_space  
  4. group by tablespace_name;  
  5.   
  6.   
  7. SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,  
  8. (B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"  
  9. FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C  
  10. WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;  


    2、查看資料庫庫對象 
  1. select owner, object_type, status, count(*) count# from all_objects group by owner, object_type, status;  



    3、查看資料庫的版本 
  1. Select version FROM Product_component_version   
  2. Where SUBSTR(PRODUCT,1,6)=‘Oracle‘;  


    4、查看資料庫建立日期和歸檔方式 
  1. Select Created, Log_Mode, Log_Mode From V$Database;  


    5、查詢資料庫中索引佔用資料表空間的大小 
  1. select a.segment_name,a.tablespace_name,b.table_name,a.bytes/1024/1024 mbytes,a.blocks  
  2. from user_segments a, user_indexes b  
  3. where a.segment_name = b.index_name  
  4. and a.segment_type = ‘INDEX‘ --索引  
  5. and a.tablespace_name=‘APPINDEX‘ --資料表空間  
  6. and b.table_name like ‘%PREP%‘ --索引所在表  
  7. order by table_name,a.bytes/1024/1024 desc

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.