pl/sql

創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比曲阜網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式曲阜網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋曲阜地區(qū)。費(fèi)用合理售后完善,10余年實(shí)體公司更值得信賴。
developer
選中這個(gè)物化視圖,然后點(diǎn)擊查看,就能看到創(chuàng)建這個(gè)物化視圖的語句了
pl/sql
windows
中輸入這個(gè)物化視圖名稱有,鼠標(biāo)右鍵同樣可以查看這個(gè)物化視圖的創(chuàng)建語句
dbms_metadata.get_ddl
這個(gè)函數(shù)也可以
方法如下:
第一步:
第二步:
第三步:
點(diǎn)擊查看sql后 會(huì)有這張表的創(chuàng)建語句,改下他說屬的數(shù)據(jù)庫,然后將這些代碼貼到你要?jiǎng)?chuàng)建這張表的數(shù)據(jù)庫里 執(zhí)行就行了。
導(dǎo)入數(shù)據(jù),請(qǐng)看截圖:
當(dāng)點(diǎn)擊圖中按鈕后,會(huì)出現(xiàn)四個(gè)選項(xiàng),選擇sql文件就行了,這樣在copy and exec,就可以了。
視圖是沒有結(jié)構(gòu)查詢語句的。因?yàn)樵噲D就是一個(gè)別名,如果真的想查,那么可以通過
select * from user_tab_columns where TABLE_NAME='視圖名';查詢,這里不僅有表的信息,也有視圖的相關(guān)信息。
select table_name from user_tables; //當(dāng)前用戶的表
select table_name from all_tables; //所有用戶的表
select table_name from dba_tables; //包括系統(tǒng)表
把tables改為views就是視圖
--查詢所有表,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所有對(duì)象類型,你可以看看,需要什么就查什么
select distinct object_type from dba_objects order by object_type asc;
查看當(dāng)前用戶的缺省表空間
SQLselect username,default_tablespace from user_users;
查看當(dāng)前用戶的角色
SQLselect * from user_role_privs;
查看當(dāng)前用戶的系統(tǒng)權(quán)限和表級(jí)權(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)限和表級(jí)權(quán)限
SQLselect * from user_sys_privs;
SQLselect * from user_tab_privs;
顯示當(dāng)前會(huì)話所具有的權(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)建時(shí)間
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、索引
查看索引個(gè)數(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、序列號(hào)
查看序列號(hào),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、存儲(chǔ)函數(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');
文章標(biāo)題:如何查看oracle視圖,oracle 查看所有視圖
網(wǎng)站網(wǎng)址:http://chinadenli.net/article41/dsggihd.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、商城網(wǎng)站、網(wǎng)站設(shè)計(jì)、電子商務(wù)、域名注冊(cè)、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)