资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

oracle如何查视图,oracle查看视图内容

如何查询oracle中的所有表和视图

--查询所有表,owner为用户,dba_objects只能由具有dba角色的用户去查询,比如system用户。

武乡网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、响应式网站等网站项目制作,到程序开发,运营维护。创新互联于2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。

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 如何查找视图名称

查看当前用户的缺省表空间

SQLselect username,default_tablespace from user_users;

查看当前用户的角色

SQLselect * from user_role_privs;

查看当前用户的系统权限和表级权限

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、用户

查看当前用户的缺省表空间

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

2、表

查看用户下所有的表

SQLselect * from user_tables;

查看名称包含log字符的表

SQLselect object_name,object_id from user_objects

where instr(object_name,'LOG')0;

查看某表的创建时间

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的内存区里的表

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

3、索引

查看索引个数和类别

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是当前值

SQLselect * from user_sequences;

5、视图

查看视图的名称

SQLselect view_name from user_views;

查看创建视图的select语句

SQLset view_name,text_length from user_views;

SQLset long 2000; 说明:可以根据视图的text_length值设定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、存储函数和过程

查看函数和过程的状态

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

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

查看函数和过程的源代码

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

oracle数据库怎样查看视图结构

视图是没有结构查询语句的。因为试图就是一个别名,如果真的想查,那么可以通过

select * from user_tab_columns where TABLE_NAME='视图名';查询,这里不仅有表的信息,也有视图的相关信息。

Oracle如何合并多个视图进行查询?

with aa as(

select * from view1

union all

select * from view2 ...)

select callid,sum(callerno)

from aa a

where a.begintime >.. and endtime <..

group by callid order by callerno

Oracle查看用户下,表下有哪些视图

select * from dba_tab_privs where grantee='user_name'--查看该用户下所有视图信息

select * from dba_dependencies where referenced_name='table_name'--查看该表创建了哪些视图

oracle 怎么查看已有的物化视图

pl/sql

developer

选中这个物化视图,然后点击查看,就能看到创建这个物化视图的语句了

pl/sql

windows

中输入这个物化视图名称有,鼠标右键同样可以查看这个物化视图的创建语句

dbms_metadata.get_ddl

这个函数也可以


文章标题:oracle如何查视图,oracle查看视图内容
本文网址:http://cdkjz.cn/article/hsjjee.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220