oracle怎么查字典表 oracle查询所有字段

ORACLE用户常用数据字典的查询使用方法查看当前用户oracle怎么查字典表的缺省表空间
SQLselect username,default_tablespace from user_users;
查看当前用户oracle怎么查字典表的角色
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
【oracle怎么查字典表 oracle查询所有字段】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、序列号
查看序列号oracle怎么查字典表,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; 说明oracle怎么查字典表:可以根据视图的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数据库查找所有表的字段名称1、MySQL数据库查询带有某个字段oracle怎么查字典表的所有表名:
SELECT * FROM information_schema.columns WHERE column_name='column_name';
2、Oracle数据库查询带有某个字段的所有表名:
SELECT column_name,table_name FROM user_tab_columns WHERE column_name='column_name';
3、SQLServer数据库查询带有某个字段的所有表名:
SELECT [name] FROM [库名].[dbo].sysobjects WHERE id IN (SELECT id FROM [库名].[dbo].syscolumns WHERE name = '字段名')
4、然后这样就完成oracle怎么查字典表了 。
如何查看oracle数据库中的所有表觉得你应该先弄清楚oracle的常规数据字典的结构,像9i里的常规数据字典中对象名称就有以USER,ALL,DBA为前缀的对象 。
以USER为例,我们查该对象下有些什么表,就应该执行下列的语句:
SQLselect table_name from user_tables;
类似的 , 你可以进行替换 。:)
如果你想查数据库中所有的表的话,可以查询
SELECT * FROM dba_tables
如果你想查询数据库中某个用户下的表的话,也可以登录这个用户,再查询:
SELECT * FROM USER_TABLES
要想导入外部sql语句可以用命令
sql @e:\文件名.sql
如你想保存 select * from tablename;语句的结果,可以在sql*plus 里面这样:
SPOOL c:\test.sql//这是保存文件的位置
select * from tablename;
SPOOL OFF
关于oracle怎么查字典表和oracle查询所有字段的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。

    推荐阅读