日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
oracle怎么找視圖 oracle中創(chuàng)建視圖并查詢視圖

oracle 如何查找視圖名稱

查看當(dāng)前用戶的缺省表空間

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:申請域名、虛擬空間、營銷軟件、網(wǎng)站建設(shè)、永和網(wǎng)站維護、網(wǎng)站推廣。

SQLselect username,default_tablespace from user_users;

查看當(dāng)前用戶的角色

SQLselect * from user_role_privs;

查看當(dāng)前用戶的系統(tǒng)權(quán)限和表級權(quán)限

SQLselect * from user_sys_privs;

SQLselect * from user_tab_privs;

查看用戶下所有的表

SQLselect * from user_tables;

顯示用戶信息(所屬表空間)

select default_tablespace,temporary_tablespace

from dba_users where username='GAME';

1、用戶

查看當(dāng)前用戶的缺省表空間

SQLselect username,default_tablespace from user_users;

查看當(dāng)前用戶的角色

SQLselect * from user_role_privs;

查看當(dāng)前用戶的系統(tǒng)權(quán)限和表級權(quán)限

SQLselect * from user_sys_privs;

SQLselect * from user_tab_privs;

顯示當(dāng)前會話所具有的權(quán)限

SQLselect * from session_privs;

顯示指定用戶所具有的系統(tǒng)權(quán)限

SQLselect * from dba_sys_privs where grantee='GAME';

顯示特權(quán)用戶

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';

2、表

查看用戶下所有的表

SQLselect * from user_tables;

查看名稱包含log字符的表

SQLselect object_name,object_id from user_objects

where instr(object_name,'LOG')0;

查看某表的創(chuàng)建時間

SQLselect object_name,created from user_objects where object_name=upper('table_name');

查看某表的大小

SQLselect sum(bytes)/(1024*1024) as "size(M)" from user_segments

where segment_name=upper('table_name');

查看放在ORACLE的內(nèi)存區(qū)里的表

SQLselect table_name,cache from user_tables where instr(cache,'Y')0;

3、索引

查看索引個數(shù)和類別

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)/(1024*1024) as "size(M)" from user_segments

where segment_name=upper('index_name');

4、序列號

查看序列號,last_number是當(dāng)前值

SQLselect * from user_sequences;

5、視圖

查看視圖的名稱

SQLselect view_name from user_views;

查看創(chuàng)建視圖的select語句

SQLset view_name,text_length from user_views;

SQLset long 2000; 說明:可以根據(jù)視圖的text_length值設(shè)定set long 的大小

SQLselect text from user_views where view_name=upper('view_name');

6、同義詞

查看同義詞的名稱

SQLselect * from user_synonyms;

7、約束條件

查看某表的約束條件

SQLselect constraint_name, constraint_type,search_condition, r_constraint_name

from user_constraints where table_name = upper('table_name');

SQLselect c.constraint_name,c.constraint_type,cc.column_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 c.constraint_name = cc.constraint_name

order by cc.position;

8、存儲函數(shù)和過程

查看函數(shù)和過程的狀態(tài)

SQLselect object_name,status from user_objects where object_type='FUNCTION';

SQLselect object_name,status from user_objects where object_type='PROCEDURE';

查看函數(shù)和過程的源代碼

SQLselect text from all_source where owner=user and name=upper('plsql_name');

如何查詢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 怎么查看已有的物化視圖

pl/sql

developer

選中這個物化視圖,然后點擊查看,就能看到創(chuàng)建這個物化視圖的語句了

pl/sql

windows

中輸入這個物化視圖名稱有,鼠標(biāo)右鍵同樣可以查看這個物化視圖的創(chuàng)建語句

dbms_metadata.get_ddl

這個函數(shù)也可以

Oracle查詢表、視圖、序列等信息查詢

這幾天做性能優(yōu)化 網(wǎng)上找了些資料

有時候需要導(dǎo)出某用戶下的所有table view sequence trigger等信息 下面的SQL可以將這些信息select出來

select * from user_tables;

select * from user_views;

select * from user_sequences;

select * from user_triggers;

想查找表的數(shù)據(jù)條數(shù)

試試這個

select t table_name t num_rows from user_tables t

如果沒有值 那就創(chuàng)建個函數(shù)

代碼

create or replace function count_rows(table_name in varchar

owner in varchar default null)

return number

authid current_user

IS

num_rows number;

stmt varchar ( );

begin

if owner is null then

stmt := select count(*) from ||table_name|| ;

else

stmt := select count(*) from ||owner|| ||table_name|| ;

end if;

execute immediate stmt into num_rows;

return num_rows;

end

再執(zhí)行查詢

lishixinzhi/Article/program/Oracle/201311/18185

查看Oracle有哪些表或者視圖

可以嘗試在oracle中用PL/SQL找到對應(yīng)的視圖,然后右擊點“編輯”,就可以看到有哪些表了。


本文題目:oracle怎么找視圖 oracle中創(chuàng)建視圖并查詢視圖
當(dāng)前鏈接:http://www.dlmjj.cn/article/hhciod.html