oracle中关于表空间,用户,表相关的查询语句
来源:互联网 发布:如何注册淘宝达人 编辑:程序博客网 时间:2024/06/07 03:21
/* 查询表空间的名字和大小 */
select tablespace_name "表空间的名字", sum(bytes)/1024/1024 "表空间大小" from dba_data_files group by tablespace_name ;
/*查看表空间下有哪些用户 */
select distinct a.owner from dba_segments a where a.tablespace_name='TS_MHS5';
/*查看当前登录的用户名*/
select user from dual;
select * from user_users;
/*查看当前用户名拥有的角色和权限*/
select * from user_role_privs;
select * from session_privs;
/*查看用户下有多少表*/
select * from user_tables where table_name like '%patient%';
select count(*) from user_tables; /*user_tables是当前用户的所有表,用这个可以缩小查找的范围*/
select * from dba_tables where owner='MHS5'; /*dba_tables是管理员可以看到的数据库中所有的表*/
select count(*) from all_tables where owner='MHS5'; /*all_tables显示用户有权限看到的所有的表,包括系统表*/
select distinct table_name from user_tables;
/*查看用户某一张表的结构 */
desc mhs5.patient_info; /*要在命令模式下使用 */
select * from all_tab_columns;
select * from user_col_comments; --查询当前用户的表的列名和注释
/*查看用户的某一张的大小 ,在pl/sql 中不好用,不知道为什么*/
select sum(bytes)/1024/1024 "表大小(M)" from user_segments where segment_name='mhs5.patient_info_mid';
select tablespace_name "表空间的名字", sum(bytes)/1024/1024 "表空间大小" from dba_data_files group by tablespace_name ;
/*查看表空间下有哪些用户 */
select distinct a.owner from dba_segments a where a.tablespace_name='TS_MHS5';
/*查看当前登录的用户名*/
select user from dual;
select * from user_users;
/*查看当前用户名拥有的角色和权限*/
select * from user_role_privs;
select * from session_privs;
/*查看用户下有多少表*/
select * from user_tables where table_name like '%patient%';
select count(*) from user_tables; /*user_tables是当前用户的所有表,用这个可以缩小查找的范围*/
select * from dba_tables where owner='MHS5'; /*dba_tables是管理员可以看到的数据库中所有的表*/
select count(*) from all_tables where owner='MHS5'; /*all_tables显示用户有权限看到的所有的表,包括系统表*/
select distinct table_name from user_tables;
/*查看用户某一张表的结构 */
desc mhs5.patient_info; /*要在命令模式下使用 */
select * from all_tab_columns;
select * from user_col_comments; --查询当前用户的表的列名和注释
/*查看用户的某一张的大小 ,在pl/sql 中不好用,不知道为什么*/
select sum(bytes)/1024/1024 "表大小(M)" from user_segments where segment_name='mhs5.patient_info_mid';
阅读全文
0 0
- oracle中关于表空间,用户,表相关的查询语句
- 查询ORACLE用户表空间使用情况的SQL语句
- 获取oracle中某一用户某一表空间下的表、列注释说明的SQL查询语句
- oracle查询用户所在的表空间
- oracle中关于用户和表空间的操作
- oracle表空间查询语句
- Oracle表空间相关查询
- oracle查询用户所有表的语句
- Oracle查询用户所有表的语句
- Oracle查询用户所有表的语句
- Oracle查询用户所有表的语句
- Oracle查询用户所有表的语句
- 表空间、用户及其权限的相关SQL语句
- Oracle表空间及其用户的创建语句
- oracle创建表空间和用户的sql语句
- Oracle sql语句 创建表空间、用户
- Oracle创建表空间和用户语句
- Oracle创建用户与表空间的相关操作
- It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by t
- 细说mybatis动态sql和底层数据交互与JDBC和hibernate的相关性
- 物料主数据--1. BAPI_MATERIAL_MAINTAINDATA_RT的使用以及心得
- 经典:生产者消费者模型
- vuex2.0 基本使用 --- mutation 和 action
- oracle中关于表空间,用户,表相关的查询语句
- 全国shp矢量数据分享(精确到区县)
- 知识点总结
- MySQL 密码忘记
- JQuery样式
- redis必杀命令:脚本
- Sql 各种查询
- centos 7 下安装tomcat 8.5.11及mysql5.7.16
- 跟上 Java 8 : 你忽略了的新特性