oracle 資料庫相關資訊檢視

2021-07-14 05:41:18 字數 676 閱讀 4145

1.查詢所有使用者表空間占用大小

select segment_name,tablespace_name,sum(bytes/1024/1024)||』m』 from dba_extents where segment_type=』table』

group by segment_name,tablespace_name

2.查詢當前使用者表空間占用大小

select segment_name,tablespace_name,sum(bytes/1024/1024)||』m』 msize from user_extents where segment_type=』table』

group by segment_name,tablespace_name order by msize desc

3.查詢表中資料量

select t.table_name,t.num_rows from user_tables t

4.查詢表字段個數

select

『select count(*) from user_tab_columns where table_name=upper(』 || chr(39) || table_name || chr(39) ||』) ;』

from

user_tables

工作中用到的幾種整理了一下,用到其他的持續更新。

檢視ORACLE 資料庫及表資訊

檢視oracle 資料庫中本使用者下的所有表 select table name from user tables 檢視oracle 資料庫中所有使用者下的所有表 select user,table name from all tables 檢視oracle 資料庫中本使用者下的所有列 select...

檢視ORACLE 資料庫及表資訊

檢視oracle 資料庫中本使用者下的所有表 select table name from user tables 檢視oracle 資料庫中所有使用者下的所有表 select user,table name from all tables 檢視oracle 資料庫中本使用者下的所有列 select...

檢視ORACLE 資料庫及表資訊

檢視oracle 資料庫中本使用者下的所有表 select table name from user tables 檢視oracle 資料庫中所有使用者下的所有表 select user,table name from all tables 檢視oracle 資料庫中本使用者下的所有列 select...