如何查询当前用户的表空间名称?因为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. Servlet模板,一个供新手参考的模板

    由于这学期老师的进度是刚开始教JavaSE部分,而我的进度比较快,所以买了3本javaee的书,我根据自己的基础,选择了合适的开发实践,另外两本书都和框架相关,我自认为我的web基础还不是很牢固,所以 ...

  2. sklearn.learning_curve

    学习曲线函数: from sklearn.learning_curve import learning_curve 调用格式: learning_curve(estimator, X, y, trai ...

  3. leecode第四十六题(全排列)

    class Solution { public: vector<vector<int>> permute(vector<int>& nums) { int ...

  4. TCP与UDP各自优缺点与区别

    TCP的优点: 可靠,稳定 TCP的可靠体现在TCP在传递数据之前,会有三次握手来建立连接,而且在数据传递时,有确认.窗口.重传.拥塞控制机制,在数据传完后,还会断开连接用来节约系统资源. TCP的缺 ...

  5. python如何判断一个字符串是中文,还是英文。

    参考链接: https://blog.csdn.net/hit0803107/article/details/52885702 decode:  将其它编码转成  ===>unicode enc ...

  6. spring security+freemarker获取登陆用户的信息

    spring security+freemarker获取登陆用户的信息 目标页面之间获取 ${Session.SPRING_SECURITY_CONTEXT.authentication.princi ...

  7. Twisted 简介

    Twisted是用Python实现的基于事件驱动的网络引擎框架,Twisted支持许多常见的传输及应用层协议,包括TCP.UDP.SSL/TLS.HTTP.IMAP.SSH.IRC以及FTP.就像Py ...

  8. linux 如何释放缓存

    操作: 同步 sync 释放所有缓存 echo 3 > /proc/sys/vm/drop_caches 原理: sync 将所有未写的系统缓冲区写到磁盘中,包含已修改的 i-node.已延迟的 ...

  9. English trip V1 - B 14. There Are Flowers in My Office 我办公室里有花 Teacher:Lamb Key: There be(is/are)

    In this lesson you will learn to describe a room or place. 这节课讲学习描述一个房间或地方 课上内容(Lesson) 1. Where do ...

  10. Zabbix安装(debian,centos)

    lnmp和lamp架构搭建一键安装脚本下载地址:https://lnmp.org/download.html  https://github.com/teddysun/lamp/tree/master ...