频道栏目
首页 > 资讯 > Oracle > 正文

Oracle数据库的相关操作汇总

18-06-30        来源:[db:作者]  
收藏   我要投稿

select*from v$database:查询当前数据库名

select tablespace_name from dba_tablespaces:查看当前数据库的表空间

select*from all_tables where table_name like'%VIOLATION%' 模糊查询表名 表名必须大写

oracle不同用户表空间的表进行关联的时候需要在表名前添加用户表空间名

eg :select*from JTXT.VEHICLE

select table_name from user_tables :查询oracle数据库中本用户下的所有表

oracle库与库之间是可以直接关联表的

select*from SWRY_NEW@gazhk bggr用户下查询gazhk数据库的表

select table_name, tablespace_name from dba_tables where tablespace_name ='SYSTEM'

:查看表空间 (SYSTEM) 下的所有表

select*from all_users:查看你能管理的所有用户

select*from user_users:查看当前用户信息

select*from user_tables: 查看当前用户下有那些表

select*from all_tables:查询当前用户下可以访问哪些表,访问自己和其他用户的

select*from dba_tables:查询当前数据库的所有的表

select object_name,object_id from user_objects whereinstr(object_name,'LOG')>0 :查看名称中包含LOG字符的表

select object_name,created from user_objects where object_name=upper('&ETL_CONFIG_20160523')

:查看某表的创建时间

Selectsum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name =upper('&API_USER_EVALUATION'):查看某表的大小

SELECT TABLE_NAME,CACHEFROM USER_TABLES WHEREINSTR(CACHE,'y')>0:查看放在oracle的内存里的表

select*from user_indexes orderby table_name:查看索引信息

select*from user_ind_columns where index_name =upper('&AFFICHE_ID_PK'):查看表中被索引的字段

selectsum(bytes)/(1024*1024)as "size(M)" from user_segments where segment_name =upper('&AFFICHE_ID_PK') :查看索引的大小

select*from user_sequences:查看序列号

select*from user_views:查看视图的名称

createsynonym SWRY_NEW_tmp for SWRY_NEW@gazhk:创建同义词(同义词:不同用户下建一个同义词,即可访问不同用户下的表)

select*from SWRY_NEW_tmp:查询同义词创建的表

dropsynonym SWRY_NEW_tmp:删除同义词

select*from user_role_privs:查询当前用户的角色

select*from user_sys_privs:查看当前用户的系统权限

select*from user_tab_privs:查看当前用户的表级权限

select*from v$database:查询当前数据库名

select tablespace_name from dba_tablespaces:查看当前数据库的表空间

select*from all_tables where table_name like'%VIOLATION%' 模糊查询表名 表名必须大写

oracle不同用户表空间的表进行关联的时候需要在表名前添加用户表空间名

eg :select*from JTXT.VEHICLE

select table_name from user_tables :查询oracle数据库中本用户下的所有表

oracle库与库之间是可以直接关联表的

select*from SWRY_NEW@gazhk bggr用户下查询gazhk数据库的表

select table_name, tablespace_name from dba_tables where tablespace_name ='SYSTEM'

:查看表空间 (SYSTEM) 下的所有表

select*from all_users:查看你能管理的所有用户

select*from user_users:查看当前用户信息

select*from user_tables: 查看当前用户下有那些表

select*from all_tables:查询当前用户下可以访问哪些表,访问自己和其他用户的

select*from dba_tables:查询当前数据库的所有的表

select object_name,object_id from user_objects whereinstr(object_name,'LOG')>0 :查看名称中包含LOG字符的表

select object_name,created from user_objects where object_name=upper('&ETL_CONFIG_20160523')

:查看某表的创建时间

Selectsum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name =upper('&API_USER_EVALUATION'):查看某表的大小

SELECT TABLE_NAME,CACHEFROM USER_TABLES WHEREINSTR(CACHE,'y')>0:查看放在oracle的内存里的表

select*from user_indexes orderby table_name:查看索引信息

select*from user_ind_columns where index_name =upper('&AFFICHE_ID_PK'):查看表中被索引的字段

selectsum(bytes)/(1024*1024)as "size(M)" from user_segments where segment_name =upper('&AFFICHE_ID_PK') :查看索引的大小

select*from user_sequences:查看序列号

select*from user_views:查看视图的名称

createsynonym SWRY_NEW_tmp for SWRY_NEW@gazhk:创建同义词(同义词:不同用户下建一个同义词,即可访问不同用户下的表)

select*from SWRY_NEW_tmp:查询同义词创建的表

dropsynonym SWRY_NEW_tmp:删除同义词

select*from user_role_privs:查询当前用户的角色

select*from user_sys_privs:查看当前用户的系统权限

select*from user_tab_privs:查看当前用户的表级权限

相关TAG标签
上一篇:INSERT...ONDUPLICATEKEYUPDATE产生deathlock死锁的原理和解决
下一篇:Linux(CentOS 6.5和CentOS 7.2) 下ClamAV杀毒软件的安装与使用讲解
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站