oracle 常用的 sql
来源:互联网 发布:韩国大尺度电影知乎 编辑:程序博客网 时间:2024/05/19 09:09
1.查询表空间使用情况:
--1G=1024MB
--1M=1024KB
--1K=1024Bytes
--1M=11048576Bytes
--1G=1024*11048576Bytes=11313741824Bytes
SELECT a.tablespace_name "表空间名",
total "表空间大小",
free "表空间剩余大小",
(total - free) "表空间使用大小",
total / (1024 * 1024 * 1024) "表空间大小(G)",
free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
round((total - free) / total, 4) * 100 "使用率 %"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) total
FROM dba_data_files
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
--1G=1024MB
--1M=1024KB
--1K=1024Bytes
--1M=11048576Bytes
--1G=1024*11048576Bytes=11313741824Bytes
SELECT a.tablespace_name "表空间名",
total "表空间大小",
free "表空间剩余大小",
(total - free) "表空间使用大小",
total / (1024 * 1024 * 1024) "表空间大小(G)",
free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
round((total - free) / total, 4) * 100 "使用率 %"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) total
FROM dba_data_files
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
2.查询表空间下的各表的使用情况:
select segment_name,bytes/1024/1024 from dba_segments where tablespace_name='UUMS01' and segment_type='TABLE';
阅读全文
0 0
- oracle 常用的sql
- Oracle常用的Sql
- oracle常用的sql
- oracle的常用sql
- oracle 常用的 sql
- 常用的oracle的SQL
- Oracle常用的SQL语句
- Oracle常用的一些sql
- oracle常用的sql命令
- oracle几个常用的SQL
- oracle的常用sql语句
- oracle常用的SQL语句
- oracle常用的sql语句
- oracle常用的sql命令
- oracle中常用的sql
- oracle比较常用的sql
- ORACLE常用的sql语句
- 常用的Oracle SQL语句
- Error:SSL peer shut down incorrectly
- android热修复--阿里热修复使用和源码分析
- 数据、结构、算法
- 细谈C++的运算符重载
- 我为什么鼓励工程师写blog
- oracle 常用的 sql
- UVa232 Crossword Answers AC
- Universial-imageloader的cache原理
- Jedis Util
- 正确遍历删除Map中的元素
- mybatis错误收集
- 洛谷P1057 传球游戏(递推)
- 廖雪峰的Python教程-高阶函数
- spark 2.1 Stage and ResultStage and ShuffleMapStage