1.查詢所有數據庫
由於Oralce沒有庫名,只有表空間,所以Oracle沒有提供數據庫名稱查詢支持,只提供了表空間名稱查詢。
select * from v$tablespace; --查詢表空間(需要一定權限)
2.查詢當前數據庫中所有表名
select * from user_tables;
3.查詢指定表中的所有字段名
select column_name from user_tab_columns where table_name = 'table_name'; --表名要全大寫
4.查詢指定表中的所有字段名和字段類型
select column_name, data_type from user_tab_columns where table_name = 'table_name'; --表名要全大寫
