oracle常用查詢

2021-09-06 10:18:51 字數 620 閱讀 5797

select * from dba_users --檢視所有使用者

select * from user_all_tables --查詢當前使用者表空間

select * from user_source --查詢所有函式和儲存過程

select * from v$session  --檢視當前使用者連線

select * from session_privs --檢視當前使用者的許可權

select a.file_id "fileno",a.tablespace_name "tablespace_name",

a.bytes "bytes",a.bytes-sum(nvl(b.bytes,0)) "used",

sum(nvl(b.bytes,0)) "free",

sum(nvl(b.bytes,0))/a.bytes*100 "%free"

from dba_data_files a, dba_free_space b

where a.file_id=b.file_id(+)

group by a.tablespace_name ,

a.file_id,a.bytes order by a.tablespace_name; --查詢表空間使用情況

oracle常用查詢

查詢庫表中大資料量的表 select owner,segment name,sum bytes 1024 1024 m from dba segments where segment type in table index and owner bomc2 group by segment name,...

Oracle常用查詢

顯示資料庫所有分割槽表的資訊 dba part tables 顯示當前使用者可訪問的所有分割槽表資訊 all part tables 顯示當前使用者所有分割槽表的資訊 user part tables 顯示表分割槽資訊 顯示資料庫所有分割槽表的詳細分割槽資訊 dba tab partitions 顯...

oracle常用系統查詢

select table name from dba tab columns where column name 欄位名 注意 欄位名需要大寫,否則你查不出來 select column name from user tab columns where table name table1 table...