如何查询当前用户的表空间名称?因为oracle建立索引,需要知道当前用户的表空间,查找了一下资料

 --查询语法--
select default_tablespace from dba_users where username='登录用户'

如,我的登录用户是TMS21,那么查询语法是

 /* 查看用户所属的表空间 */
select default_tablespace from dba_users where username='TMS21';

相关查询的用法,也顺便记录一下

1)查询当前用户表空间

 /* 查看用户所属的表空间 */
select default_tablespace from dba_users where username='TMS21';

2)查询所有表空间

  /*查看所有的表空间 */
-- 1 )方式1:dba_tablespaces --
select * from dba_tablespaces;
--2 )方式2:v$tablespace --
select * from v$tablespace;

3)查询用户下所有表

  /* 查看用户下面的所有的表 */
-- 1 )方式1:user_tables --
select * from user_tables;
--2 )方式2: dba_tables --
select * from dba_tables where owner='TMS21';

4)查询表空间下的用户

  /*查看表空间下有多少用户,tablespace_name表空间 的名字一定要大写 */
select distinct s.owner from dba_segments s where s.tablespace_name ='TMS21';

PS:因为我的表空间名称跟用户一样,所以4)中的表空间都是TMS21(以查询结果为主)

资料来源:https://blog.csdn.net/qq_26941173/article/details/77155421

oracle 如何查看当前用户的表空间名称的更多相关文章

  1. oracle 表空间及查看所有用户的表空间

    用户有默认表空间,但是只能指定一个,但是你有其它表空间的限额的话,可以将表建到其它表空间中. 语法 create table xxx(xxxx xx) tablespace xxxxx 1.查看当前用 ...

  2. Oracle创建,删除用户与表空间

    1.创建表空间与用户 a:创建数据表空间 create tablespace user_data logging datafile 'D:\oracle\product\10.2.0\oradata\ ...

  3. oracle常用SQL——创建用户、表空间、授权(12C)

    一.查询 查询用户所属 表空间 select username,default_tablespace from dba_users where username='xxx' 查询表空间情况 SELEC ...

  4. Oracle查看用户所在表空间

    查看当前用户所在表空间 select username,default_tablespace from user_users; 修改用户默认表空间 alter user 用户名 default tab ...

  5. oracle创建用户、表空间、临时表空间、分配权限步骤详解

    首先登陆管理员账号,或者有DBA权限的用户,接下来依次: --查询所有用户select * from dba_users;--创建新用户create user gpmgt identified by ...

  6. ORACLE创建表空间、创建用户、更改用户默认表空间以及授权、查看权限

    Oracle创建用户.表空间.导入导出....命令 //创建临时表空间 create temporary tablespace ext_temptempfile 'D:\oracle\product\ ...

  7. (总结)Oracle 11g常用管理命令(用户、表空间、权限)

    1.启动oracle数据库: 从root切换到oracle用户进入:su - oracle 进入sqlplus环境,nolog参数表示不登录:sqlplus /nolog 以管理员模式登录:sqlpl ...

  8. Oracl数据库管理方面的资料(查询sga,查看oracle数据库名称sid,查看oracle数据库名称,查看表空间,修改表空间名称)

    显示Oracle sga相关信息: SQL> show sga Total System Global Area 105978600 bytes Fixed Size 453352 bytes ...

  9. oracle学习笔记(一) oracle 体系结构简单介绍以及创建表空间和用户

    体系结构 oracle数据服务器由oracle数据库和实例组成 实例由后台进程和内存结构组成 内存结构由共享池,数据缓冲区,日志缓存区 Oracle数据库是通过表空间来存储物理表的,一个数据库实例可以 ...

随机推荐

  1. JSON parse error: Cannot deserialize instance of `int` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc

    代码程序: @PostMapping("selectById") @ResponseBody public Result selectById(@RequestBody int i ...

  2. [原]关于helios自定义面板简述

    想研究一下helios和自己仿真软件的适配,于是找了一下关于helios的使用 首先关于helios的使用有一个“vr2009”的发帖者有过很详细描述: http://www.insky.cn/bbs ...

  3. cordova + Vue 开发 APP 上手指南

    什么是 cordova cordova 是由 Apache 基金会支持的,使用 HTML5 + CSS3 + JS 来构建多平台 APP 程序的开发框架.其支持调用手机系统(Android.IOS.W ...

  4. lua中pairs 和 ipairs 的区别

    1.table中存储值的时候,是按照顺序存储的,存储 k-v 的时候,是按照 k 的哈希值存储的. 2.ipairs --- 只能输出 table 中的值,并且不可输出nil,遇到 ni l就退出 p ...

  5. 优雅地记录Python程序日志1:logging模块简介

    本文摘自:https://zhuanlan.zhihu.com/p/31893724 本篇涉及: logging模块的调用: 保存log日志为文件: 调整输入日志等级: 修改日志消息格式: 前言 在使 ...

  6. 第一个dubbo程序

    Dubbo是一个高性能服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案,使得应用可通过高性能RPC实现服务的输出和输入功能,和Spring框架可以无缝集成. 作为一个 ...

  7. [mybatis-spring] Transaction 事务/事务处理/事务管理器

    使用mybatis-spring的主要原因之一就是: mybatis-spring允许mybatis参与到spring 事务中. mybatis-spring leverage[use (someth ...

  8. MySQL Connector/J

    5.1 Developer Guide 1. MysQL为由Java语言编程的客户端程序提供连接:MySQL Connector/J,这是一个实现Java Database Connectivity( ...

  9. EntityFramework的安装

    关于EntityFramework在vs2012无法引用的问题 这段时间学习MVC,发现一个问题,我公司的电脑可以直接引用EntityFrameWork这个命名空间,但我家里面的电脑就不能直接引用,刚 ...

  10. 20180821ImportContactFromExcel

    Excel创建vcf文件,借助百度云助手导入Iphone6Plus Sub CreateContractList() Set Wb = Application.ThisWorkbook FilePat ...