視圖是沒有結構查詢語句的。因為試圖就是一個別名,如果真的想查,那么可以通過
創新互聯企業建站,十年網站建設經驗,專注于網站建設技術,精于網頁設計,有多年建站和網站代運營經驗,設計師為客戶打造網絡企業風格,提供周到的建站售前咨詢和貼心的售后服務。對于做網站、成都網站建設中不同領域進行深入了解和探索,創新互聯在網站建設中充分了解客戶行業的需求,以靈動的思維在網頁中充分展現,通過對客戶行業精準市場調研,為客戶提供的解決方案。
select * from user_tab_columns where TABLE_NAME='視圖名';查詢,這里不僅有表的信息,也有視圖的相關信息。
用戶
查看用戶下所有的表
SQLselect * from user_tables;
查看當前用戶的缺省表空間
SQLselect username default_tablespace from user_users;
查看當前用戶的角色
SQLselect * from user_role_privs;
查看當前用戶的系統權限和表級權限
SQLselect * from user_sys_privs;
SQLselect * from user_tab_privs;
顯示當前會話所具有的權限
SQLselect * from session_privs;
顯示指定用戶所具有的系統權限
SQLselect * from dba_sys_privs where grantee= GAME ;
顯示特權用戶
select * from v$pwfile_users;
顯示用戶信息(所屬表空間)
select default_tablespace temporary_tablespace
from dba_users where username= GAME ;
顯示用戶的PROFILE
select profile from dba_users where username= GAME ;
表
查看用戶下所有的表
SQLselect * from user_tables;
查看名稱包含log字符的表
SQLselect object_name object_id from user_objects
where instr(object_name LOG ) ;
查看某表的創建時間
SQLselect object_name created from user_objects where object_name=upper( table_name );
查看某表的大小
SQLselect sum(bytes)/( * ) as size(M) from user_segments
where segment_name=upper( table_name );
查看放在ORACLE的內存區里的表
SQLselect table_name cache from user_tables where instr(cache Y ) ;
索引
查看索引個數和類別
SQLselect index_name index_type table_name from user_indexes order by table_name;
查看索引被索引的字段
SQLselect * from user_ind_columns where index_name=upper( index_name );
查看索引的大小
SQLselect sum(bytes)/( * ) as size(M) from user_segments
where segment_name=upper( index_name );
序列號
查看序列號 last_number是當前值
SQLselect * from user_sequences;
視圖
查看視圖的名稱
SQLselect view_name from user_views;
查看創建視圖的select語句
SQLset view_name text_length from user_views;
SQLset long ; 說明 可以根據視圖的text_length值設定set long 的大小
SQLselect text from user_views where view_name=upper( view_name );
同義詞
查看同義詞的名稱
SQLselect * from user_synonyms;
約束條件
查看某表的約束條件
SQLselect constraint_name constraint_type search_condition r_constraint_name
from user_constraints where table_name = upper( table_name );
SQLselect nstraint_name nstraint_type lumn_name
from user_constraints c user_cons_columns cc
where c owner = upper( table_owner ) and c table_name = upper( table_name )
and c owner = cc owner and nstraint_name = nstraint_name
order by cc position;
存儲函數和過程
查看函數和過程的狀態
SQLselect object_name status from user_objects where object_type= FUNCTION ;
SQLselect object_name status from user_objects where object_type= PROCEDURE ;
查看函數和過程的源代碼
lishixinzhi/Article/program/Oracle/201311/18880
pl/sql
developer
選中這個物化視圖,然后點擊查看,就能看到創建這個物化視圖的語句了
pl/sql
windows
中輸入這個物化視圖名稱有,鼠標右鍵同樣可以查看這個物化視圖的創建語句
dbms_metadata.get_ddl
這個函數也可以
用Oracle
Enterprise
Manager
Console登錄進去,選擇你要查找視圖的數據庫,選擇方案----選擇和你連接Oracle用戶相同的方案,第一個為表,第二個為索引,第三個就是視圖,在這里可以查看,也可以修改。
--查詢所有表,owner為用戶,dba_objects只能由具有dba角色的用戶去查詢,比如system用戶。
select * from dba_objects where owner='SYS' and object_type='TABLE';
--查詢所有視圖
select * from dba_objects where object_type='VIEW';
--查看object_type所有對象類型,你可以看看,需要什么就查什么
select distinct object_type from dba_objects order by object_type asc;
網站名稱:如何察看oracle視圖 oracle查看所有視圖的命令
文章分享:http://m.kartarina.com/article12/hgjogc.html
成都網站建設公司_創新互聯,為您提供外貿建站、網站維護、Google、外貿網站建設、網站內鏈、軟件開發
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯