自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle數(shù)據(jù)庫查詢登錄用戶名所屬表空間及其使用情況

數(shù)據(jù)庫 Oracle
本文主要介紹了Oracle數(shù)據(jù)庫中查詢登錄用戶名所屬表空間以及表空間的使用情況的方法,希望能夠?qū)δ兴鶐椭?/div>

Oracle數(shù)據(jù)庫可以查詢登錄的用戶名所屬表空間以及表空間的使用情況嗎?答案是肯定的,不過執(zhí)行select username,default_tablespace from dba_users order by username需要有dba的權(quán)限才行,本文我們就介紹這一實現(xiàn)方法,接下來就讓我們來一起了解一下吧。

1、查看用戶使用的缺省表空間名稱

首先需要知道你登錄的用戶名,然后以sysdba登錄,然后執(zhí)行下列的語句:

 

  1. sqlplus / as sysdba  
  2.  
  3. select username,default_tablespace from dba_users; 

 

2、查看表空間總大小,及其已使用大小

 

  1. select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",  
  2.  
  3. round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"  
  4.  
  5. from  
  6.  
  7. (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,  
  8.  
  9. (select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b  
  10.  
  11. where a.tablespace_name=b.tablespace_name  
  12.  
  13. order by ((a.bytes-b.bytes)/a.bytes) desc; 

 

關(guān)于Oracle數(shù)據(jù)庫查看登錄用戶名所屬表空間的知識就介紹到這里了,如果您想了解更多Oracle數(shù)據(jù)庫的知識,可以看一下這里的文章:http://database.51cto.com/oracle/,相信一定可以帶給您收獲的。

【編輯推薦】

  1. Oracle數(shù)據(jù)庫賬號頻繁被鎖定的原因排查
  2. SQL Server 2005數(shù)據(jù)庫鏡像相關(guān)知識概述
  3. Oracle數(shù)據(jù)庫如何創(chuàng)建虛擬列和復(fù)合觸發(fā)器
  4. MySQL數(shù)據(jù)庫binlog記錄的時間戳失序的原因
  5. SQL Server數(shù)據(jù)庫使用DBCC ShowContig檢查索引碎片
責任編輯:趙鵬 來源: 博客園
相關(guān)推薦

2010-11-16 11:40:04

Oracle查詢表空間

2010-04-16 10:00:06

Oracle查看表空間

2011-05-26 10:11:24

Oracle數(shù)據(jù)庫索引

2009-02-03 09:49:00

FTP空間共享

2010-10-14 16:10:28

MySQL排序

2019-09-29 17:40:55

緩沖池MySQL數(shù)據(jù)庫

2011-08-15 14:52:07

數(shù)據(jù)庫登錄名數(shù)據(jù)庫用戶名

2022-07-13 14:26:26

Linux

2010-04-09 13:17:32

2018-07-06 14:52:49

Docker容器云服務(wù)

2017-01-18 21:57:14

2015-11-09 15:32:34

TorTor網(wǎng)絡(luò)隱私網(wǎng)絡(luò)

2010-05-12 15:14:59

subversion管

2010-09-27 15:43:47

SQL語句

2009-10-21 16:03:06

Oracle查詢用戶表

2010-10-27 14:41:45

Oracle查詢用戶表

2019-08-26 19:24:55

Podman容器Linux

2020-02-04 13:50:09

Linux進程內(nèi)存使用

2009-06-30 14:11:00

Hibernate緩存

2010-06-02 11:06:15

Linux 內(nèi)存監(jiān)控
點贊
收藏

51CTO技術(shù)棧公眾號