oracle的系統表

2021-08-22 06:43:58 字數 1725 閱讀 1125

oracle的系統表

1、使用者:

select username from dba_users;

2、表空間:

select * from dba_data_files;  //資料檔案

select * from dba_tablespaces; //表空間

select tablespace_name,sum(bytes), sum(blocks) from dba_free_space group by tablespace_name; //空閒表空間

select * from dba_data_files where tablespace_name='rbs';  //表空間對應的資料檔案

select * from dba_segments where tablespace_name='indexs'; //

3、資料庫物件:

select * from dba_objects; //

4、表:

select * from dba_tables;  

select extent_id,bytes from dba_extents where segment_name='customers' and segment_type='table' order by extent_id;

select distinct table_name from user_tab_columns where column_name='so_type_id';  //列資訊

5、索引: 

select * from dba_indexes;      //索引,包括主鍵索引

select * from dba_ind_columns;  //索引列

select i.index_name,i.uniqueness,c.column_name

from user_indexes i,user_ind_columns c

where i.index_name=c.index_name and i.table_name ='s1cardinf';  //聯接使用

6、序列:

select * from dba_sequences;

7、檢視:

select * from dba_views;

select * from all_views; //text欄位,可用於查詢檢視生成的指令碼   

8、聚簇:

select * from dba_clusters;

9、快照:

select * from dba_snapshots;  //快照、分割槽應存在相應的表空間。

10、同義詞:

select * from dba_synonyms where table_owner='spgroup';

//if owner is public,then the synonyms is a public synonym.

//if owner is one of users,then the synonyms is a private synonym.

11、資料庫鏈:

select * from dba_db_links;

在spbase下建資料庫鏈

create database link dbl_spnew

connect to spnew identified by spnew using 'jhhx';

insert into acc_nbr@dbl_spnew

oracle的系統表,常用表

dba 開頭.dba tables 使用者表資訊 dba users 資料庫使用者資訊 dba segments 表段資訊 dba extents 資料區資訊 dba objects 資料庫物件資訊 dba tablespaces 資料庫表空間資訊 dba data files 資料檔案設定資訊 d...

oracle系統表的查詢

檢視當前使用者的預設表空間 sql select username,default tablespace from user users 檢視當前使用者的角色 sql select from user role privs 檢視當前使用者的系統許可權和表級許可權 sql select from us...

Oracle 系統表大全

資料字典dict總是屬於oracle使用者sys的。1 使用者 select username from dba users 改口令alter user spgroup identified by spgtest 2 表空間 select from dba data files select fro...