Oracle管理监控之Oracle数据库存储空间监控
1、监控表空间使用率
基表:dba_data_files、dba_free_space
脚本:
select a.tablespace_name,
round((a.maxbytes / 1024 / 1024 / 1024), 2) "sum G",
round((a.bytes / 1024 / 1024 / 1024), 2) "datafile G",
round(((a.bytes - b.bytes) / 1024 / 1024 / 1024), 2) "used G",
round(((a.maxbytes - a.bytes + b.bytes) / 1024 / 1024 / 1024), 2) "free G",
round(((a.bytes - b.bytes) / a.maxbytes) * 100, 2) "percent_used(%)"
from (select tablespace_name, sum(sumnow) bytes, sum(summax) maxbytes
from (select t1.tablespace_name,
sum(t1.bytes) sumnow,
sum(t1.maxbytes) summax
from dba_data_files t1
where t1.maxbytes <> 0
group by t1.tablespace_name
union all
select t2.tablespace_name,
sum(t2.bytes) sumnow,
sum(t2.bytes) summax
from dba_data_files t2
where t2.maxbytes = 0
group by t2.tablespace_name)
group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
order by ((a.bytes - b.bytes) / a.maxbytes) desc;
2、创建表空间时指定最大值时查询表空间使用率脚本:
select a.tablespace_name,
round((a.maxbytes / 1024 / 1024 / 1024), 2) "sum G",
round((a.bytes / 1024 / 1024 / 1024), 2) "datafile G",
round(((a.bytes - b.bytes) / 1024 / 1024 / 1024), 2) "used G",
round(((a.maxbytes - a.bytes + b.bytes) / 1024 / 1024 / 1024), 2) "free G",
round(((a.bytes - b.bytes) / a.maxbytes) * 100, 2) "percent_used(%)"
from (select tablespace_name, sum(bytes) bytes, sum(maxbytes) maxbytes
from dba_data_files
where maxbytes != 0
group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
order by ((a.bytes - b.bytes) / a.maxbytes) desc;
3、查看数据文件状态
select t.tablespace_name,
t.file_id,
t.file_name,
t.autoextensible,
ROUND(t.maxbytes / 1024 / 1024 / 1024, 2) || 'G' AS MAXBYTES,
ROUND(t.bytes / 1024 / 1024 / 1024, 2) || 'G' AS BYTES,
ROUND(t.user_bytes / 1024 / 1024 / 1024, 2) || 'G' AS USER_BYTES
from dba_data_files t;
Oracle管理监控之Oracle数据库存储空间监控的更多相关文章
- Oracle数据库的监控及数据维护
目前Oracle数据库的管理,数据查询等都需要安装Oracle软件或安装Oracle Client等,远程访问都需要先登录到服务器等繁琐的操作.如果是开发团队,那么每个开发,测试,管理人员都要经历这个 ...
- Oracle管理监控之Oracle用户权限
数据字典 1.动态数据字典是以v$xxx开始的数据字典,在数据库中约有150个左右,这些数据字典反映数据库动态运行状况,在不同时间查询会得到不同的结果. 2.DBA数据字典是以DBA_xxx表示,该数 ...
- Oracle【IT实验室】数据库备份与恢复之四:RMAN(备份与恢复管理器)
RMAN是ORACLE提供的一个备份与恢复的工具,可以用来备份和还原数据库文件. 归档日志和控制文件.它也可以用来执行完全或不完全的数据库恢复. RMAN可以由命令行接口或者 OEM的 Backup ...
- Lepus监控之Oracle配置
1.安装cx_Oracle a.官网下载客户端组件包 oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpmoracle-instantclien ...
- 采用link方式解决zabbix对于备份监控和ORACLE日志监控由于路径不统一的问题
#对于备份监控和ORACLE日志监控由于路径不统一,我们可以采用link的方式如:#ln -s 原路径 新路径(/zabbix/logs)#新路径统一放在/zabbix/logs下具体看模板指定. # ...
- 3. SQL Server数据库状态监控 - 可用空间
原文:3. SQL Server数据库状态监控 - 可用空间 数据库用来存放数据,那么肯定需要存储空间,所以对磁盘空间的监视自然就很有必要了. 一. 磁盘可用空间 1. 操作系统命令或脚本.接口或工具 ...
- 2. SQL Server数据库状态监控 - 错误日志
原文:2. SQL Server数据库状态监控 - 错误日志 无论是操作系统 (Unix 或者Windows),还是应用程序 (Web 服务,数据库系统等等) ,通常都有自身的日志机制,以便故障时追溯 ...
- oracle之二实例与数据库
实例与数据库 1.Oracle 网络架构及应用环境 看PPT,Oracle结构的基本单元.术语 2.Oracle 体系结构 1)oracle server :database + instanc ...
- oracle 10g 学习之oracle管理(3)
怎样将预先写好的sql脚本执行? select * from employees;→107条记录 利用 Oracle 企业管理器连接数据库服务器 点击打开以下界面: 此时已经连接成功了 用 Oracl ...
随机推荐
- redis的学习使用(ubuntu系统下)
1.安装redis,/usr/local/redis-4.0.1/src/redis-server启动服务,若想启动后自动退出redis控制台进行其他操作,可配置redis.config中 daem ...
- 【Java面试题】13 Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
1.什么是匿名内部类? 内部类,存在于另一个类内部的类,而匿名内部类,顾名思义,就是没有名字的内部类. 2.为什么需要匿名内部类? 每个inner class都能够各自继承某一实现类(implemen ...
- mysql获取外键, 根据数据库名和表名获取表所对应的所有外键
SELECT ii.`COLUMN_NAME` FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ii WHERE ii.`CONSTRAINT_SCHEMA`= ...
- Ubuntu 13.10 安装 Oracle11gR2
#step 1: groupadd -g 2000 dba useradd -g 2000 -m -s /bin/bash -u 2000 grid useradd -g 2000 -m ...
- OpenCV学习:Mat结构中的数据共享机制
使用Mat类,内存管理变得简单,不再像使用IplImage那样需要自己申请和释放内存. Mat是一个类,由两个数据部分组成:矩阵头(包含矩阵尺寸,存储方法,存储地址等信息)和一个指向存储所有像素值的矩 ...
- OpenCV学习:实现简单的图像叠加
本实例使用简单的线性叠加方法来实现两幅图像的叠加,主要使用的知识如下: 1)线性融合 2)addWeighted函数 //! computes weighted sum of two arrays ( ...
- VS2008远程调试操作方法
前言 最近遇到一个问题:组态王在本地调试机上运行正常,但在远程测试机上运行却出现了崩溃.本机上装有Visual Studio 2008,测试机上则没有.于是,在网上找资料,想利用远程调试方法,在本机上 ...
- Entity Framework底层操作封装V2版本号(4)
这个版本号里面.由于涉及到了多库的操作.原有的系统方法不能做到这种事情了.所以这里有了一点差别 这个类的主要用作就是,连接字符串的作用,默认是指向默认配置里面的,可是你能够指向其它的连接 using ...
- mybatis由浅入深day01_ 7输入映射(7.1传递pojo的包装对象_7.2#{}与${}_7.3传递简单类型_7.4传递pojo对象_7.5传递hashmap)
7 输入映射 通过parameterType指定输入参数的类型,类型可以是简单类型.hashmap.pojo的包装类型. 7.1 传递pojo的包装对象 7.1.1 需求 完成用户信息的综合查询,需要 ...
- InstallShield程序打包图解
InstallShield程序打包图解 VS2012中打包工具被看做程序集,在使用时和程序集一样被创建到程序解决方案下.需要我们做的是添加项目即可.但是对于初次使用的朋友来说,我们需要根据提示 ...