oracle數(shù)據(jù)庫中查詢表主鍵外鍵及索引的命令是什么?
要通過查詢ORACLE的數(shù)據(jù)字典才能知道。
1、查主鍵名稱: select * from user_constraints where table_name = 'ART' and constraint_type ='P'; 查主鍵對應(yīng)的列: select * from user_cons_columns where table_name = 'ART' and constraint_name = 'PK_ART';
2、查索引名稱: select * from user_indexes where table_name = 'ART'; 查索引對應(yīng)的列: select * from user_ind_columns where table_name = 'ART' and index_name = 'INDX_BA';