网站首页 > 文章中心 > 其它

oracle怎么搜索表_oracle怎么查看锁表

作者:小编 更新时间:2023-09-11 10:35:01 浏览量:465人看过

查找 oracle 数据库中包含某一字段的所有表的表名

①.、首先,打开并登陆plsql.

如何查询oracle数据库中所有的表

以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怎么查询所有的表?有没有主键?

①.、查找表的所有索引(包括索引名,类型,构成列):

select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = 要查询的表

select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name = 要查询的表

select column_name from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'U' and au.table_name = 要查询的表

select * from user_constraints c where c.constraint_type = 'R' and c.table_name = 要查询的表

查询外键约束的列名:

select * from user_cons_columns cl where cl.constraint_name = 外键名称

查询引用表的键的列名:

select * from user_cons_columns cl where cl.constraint_name = 外键引用表的键名

select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name = c.table_name and t.column_name = c.column_name and t.table_name = 要查询的表

select table_name,num_rows from user_tables;

select * from all_users;

select * from dba_users

①.0、Oracle查看当前用户连接:select * from v$Session

①.1、Oracle查看当前用户权限:select * from session_privs

select a.file_id "FileNo",a.tablespace_name

"Tablespace_name",

a.bytes "Bytes",a.bytes-sum(nvl(b.bytes,0)) "Used",

sum(nvl(b.bytes,0)) "Free",

sum(nvl(b.bytes,0))/a.bytes*100 "%free"

from dba_data_files a, dba_free_space b

where a.file_id=b.file_id(+)

group by a.tablespace_name ,

a.file_id,a.bytes order by a.tablespace_name;

如何查看oracle数据库中的所有表

①.、查询用户创建的所有表:

select * from user_tables;

select * from all_all_tables;

oracle里面怎么通过表名查找表数据

直接用超级管理员权限(sysdba)查看每个表空间中表名. sql:Select Table_Name, Tablespace_Name From Dba_Tables Where Tablespace_Name = '表空间名字'; 解释:通过管理员权限登陆后,查看"Dba_Tables "表中的字段信息即可完成查询表名操作...

以上就是土嘎嘎小编为大家整理的oracle怎么搜索表相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!

版权声明:倡导尊重与保护知识产权。未经许可,任何人不得复制、转载、或以其他方式使用本站《原创》内容,违者将追究其法律责任。本站文章内容,部分图片来源于网络,如有侵权,请联系我们修改或者删除处理。

编辑推荐

热门文章