oracle11监视器,Oracle 11g 表空间监控(一) datafile autoextend
表空间监控(一) datafile autoextend
导言:监控数据文件自增的表空间脚本。
#######################################################################################
Oracle Environment=>11.2.0.4.0 rac on two nodes
OS Environment=>AIX 6.1 (64bit)
#######################################################################################
SQL> @DFfreePrct.sql
TSpace TSpace Auto TSpace TSpace TSpace TSpace TSpace TSpace TSpace TSpace TSpace TSpace
Name Status DATAFILE Extend Size Used Free Used Free Segmt Extent Maxed MaxSiz Maxed
Used File Space Space Space Space Space Space Used Mb Free
Space ? Mb Mb % % Mb Mb Space Space
% % %
------------------ --------- ---------- ------ --------- --------- --------- ------ ------ --------- --------- ------ ------ ------
HP_DATA_TBS ONLINE 76 Yes 306046 298833 7213 98 2 298822 298821 76 393216 24
HPU_DATA_TBS ONLINE 73 Yes 321599 288444 33155 90 10 288432 288432 73 393216 27
DHP_DATA_TBS ONLINE 63 Yes 42544 41492 1053 98 2 41490 41490 63 65536 37
BMCD_BBD2 ONLINE 52 Yes 35910 34385 1525 96 4 34455 34383 52 65536 48
...
### NOTE ###
TSpace Name : Tablespace name
TSpace Status : Tablespace status
TSpace Size : TableSpace Total allocated size
TSpace Used Space Mb : Tablespace currently used space
TSpace Free Space Mb : Tablespace remaining free space
TSpace Used Space % : Tablespace currently used space in percentage
TSpace Free Space % : Tablespace remaining free space in percentage
TSpace Segmt Space Mb : Tablespace space used by all segments
TSpace Extent Space Mb : Tablespace space used by all extents
Auto Extend File ? : Does the Tablespace use a file that is auto-extendable ?
TSpace MaxSize mb : Tablespace Total allocate-able size, taking into account the possible extension of auto-extendable files. This supposes that the files have enough disk space available to auto-extend.
TSpace Maxed Free Space : Tablespace remaining free space, taking into account the possible extension of auto-extendable files. This supposes that the files have enough disk space available to auto-extend.
##########################################################################################################################################################
##DFfreePrct.sql scripts contents are as follows ##
set lines 150
set pages 10000
clear break
col TSname heading 'TSpace|Name|||'
col TSname format a18
col TSstatus heading 'TSpace|Status|||'
col TSstatus format a9
col TSSizeMb heading 'TSpace|Size|||'
col TSSizeMb format 99999999
col TSUsedMb heading 'TSpace|Used|Space|Mb|'
col TSUsedMb format 99999999
col TSFreeMb heading 'TSpace|Free|Space|Mb|'
col TSFreeMb format 99999999
col TSUsedPrct heading 'TSpace|Used|Space|%|'
col TSUsedPrct format 99999
col TSFreePrct heading 'TSpace|Free|Space|%|'
col TSFreePrct format 99999
col TSSegUsedMb heading 'TSpace|Segmt|Space|Mb|'
col TSSegUsedMb format 99999999
col TSExtUsedMb heading 'TSpace|Extent|Space|Mb|'
col TSExtUsedMb format 99999999
col AutoExtFile heading 'Auto|Extend|File|?|'
col AutoExtFile format a6
col TSMaxSizeMb heading 'TSpace|MaxSize|Mb||'
col TSMaxSizeMb format a6
col TSMaxUsedPrct heading 'TSpace|Maxed|Used|Space|%'
col TSMaxUsedPrct format a6
col TSMaxFreePrct heading 'TSpace|Maxed|Free|Space|%'
col TSMaxFreePrct format a6
col DFfreePrct heading 'DATAFILE|Used|Space|%'
col TSMaxFreePrct format a6
WITH
ts_total_space AS (SELECT
tablespace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks,
SUM(maxbytes) as maxbytes
FROM
dba_data_files
GROUP BY
tablespace_name),
ts_free_space AS (SELECT
ddf.tablespace_name,
NVL(SUM(dfs.bytes),0) as bytes,
NVL(SUM(dfs.blocks),0) as blocks
FROM
dba_data_files ddf,
dba_free_space dfs
WHERE
ddf.file_id = dfs.file_id(+)
GROUP BY
ddf.tablespace_name),
ts_total_segments AS (SELECT
tablespace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks
FROM
dba_segments
GROUP BY
tablespace_name),
ts_total_extents AS (SELECT
tablespace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks
FROM
dba_extents
GROUP BY
tablespace_name),
tts_total_space AS (SELECT
tablespace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks,
SUM(maxbytes) as maxbytes
FROM
dba_data_files where maxbytes>0
GROUP BY
tablespace_name)
SELECT
dt.tablespace_name as "TSname",
dt.status as "TSstatus",
ROUND((ttsp.bytes-tfs.bytes)/tttsp.maxbytes*100,0) as "DFfreePrct",
CASE
WHEN ttsp.maxbytes = 0 THEN 'No' ELSE 'Yes'
END as "AutoExtFile",
ROUND(ttsp.bytes/1024/1024,0) as "TSSizeMb",
ROUND((ttsp.bytes-tfs.bytes)/1024/1024,0) as "TSUsedMb",
ROUND(tfs.bytes/1024/1024,0) as "TSFreeMb",
ROUND((ttsp.bytes-tfs.bytes)/ttsp.bytes*100,0) as "TSUsedPrct",
ROUND(tfs.bytes/ttsp.bytes*100,0) as "TSFreePrct",
ROUND(ttse.bytes/1024/1024,0) as "TSSegUsedMb",
ROUND(tte.bytes/1024/1024,0) as "TSExtUsedMb",
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND((ttsp.bytes-tfs.bytes)/ttsp.maxbytes*100,0))
END as "TSMaxUsedPrct",
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND(ttsp.maxbytes/1024/1024,0))
END as "TSMaxSizeMb" ,
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND((ttsp.maxbytes-(ttsp.bytes-tfs.bytes))/ttsp.maxbytes*100,0))
END as "TSMaxFreePrct"
FROM
dba_tablespaces dt,
ts_total_space ttsp,
tts_total_space tttsp,
ts_free_space tfs,
ts_total_segments ttse,
ts_total_extents tte
WHERE dt.tablespace_name = ttsp.tablespace_name(+)
AND dt.tablespace_name = tfs.tablespace_name(+)
AND dt.tablespace_name = ttse.tablespace_name(+)
AND dt.tablespace_name = tte.tablespace_name(+)
and dt.tablespace_name = tttsp.tablespace_name(+)
and ROUND((ttsp.bytes-tfs.bytes)/tttsp.maxbytes*100,0)>50
ORDER BY 10 desc
;
########################################################################################
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!【QQ交流群:53993419】
QQ:14040928
本文链接:
http://blog.itpub.net/26442936/viewspace-1471600/
########################################################################################
oracle11监视器,Oracle 11g 表空间监控(一) datafile autoextend相关推荐
- oracle 11g b表空间什么情况下自动增加,Oracle 11g表空间——创建和扩展(永久)表空间...
Oracle 11g表空间--创建和扩展(永久)表空间 本文内容 创建(永久)表空间 查看表空间 扩展表空间 创建(永久)表空间 Oracle 按照区和段空间进行管理表空间. 区管理方式 - 针对区的 ...
- oracle表空间dbf文件,Oracle 11g表空间dbf文件迁移
当Oracle的数据文件所在的磁盘空间不够用了或其他情况需要把dbf文件迁移到另外的位置,下面是操作步骤: 1.sqlplus sys/sys as sysdba 2.shutdown immedia ...
- oracle 11g 表空间加密
由于我们在创建表空间后产生的dbf数据文件是没有加密的二进制文件,通过简单的转储或者strings便能查看里面的数据 所以存在着数据泄露的隐患,我们可以通过wallets方法对创建的表空间进行加密. ...
- 唐老师 oracle,ORACLE数据库表空间的监控和维护_快速发表职称论文网
ORACLE数据库表空间的监控和维护 摘 要:通过ORACLE数据库内部管理表和视图加强数据库系统数据表空间的监控和维护. 关键字:数据库表空间监控 ORACLE数据库在系统性能,安全性以及可靠性方面 ...
- Oracle数据库表空间占用过大的解决办法
最近调接口的时候接口访问历史表报错: 检查之后发现表空间满了,随后把相应表空间进行了扩展,顺带总结了Oracle检查&调整表空间的sql语句如下: --查看某张表的表空间 select tab ...
- linux oracle 创建表空间2016,Linux下Oracle表空间及用户创建
记录详细过程以备使用 Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 Connected as sys@i ...
- oracle 给表空间改名,Oracle重命名表空间和删除表空间
在需要的情况下,可以对表空间的名称进行修改.修改表空间的名称,不会影响到表空间中的数据.但不能修改系统表空间system与sysa Oracle重命名表空间和删除表空间 [日期:2015-03-10] ...
- Oracle 11g实时SQL监控 --好东西不该藏着
Oracle 11g实时SQL监控 Oracle, 深入解析Oracle, 读书笔记 四月 9th, 2010 作者:dbtan |[转载时请以超链接形式标明文章出处和作者信息] 链接:http:// ...
- Oracle 的 表空间(Tablespace)、用户(User)、模式(Schema)
前面有整理了一篇 Oracle 数据库(database) 与 实例(instance) 的概念及关系整理 . 那接下来就往下整理一个数据库里面的一些其他几个东西之间的奇奇怪怪的关系. 一.表空间(T ...
最新文章
- error LNK2001: 无法解析的外部符号 “void __cdecl cv::cvtColor
- 基础连接已经关闭: 无法与远程服务器建立信任关系
- ActiveMQ跟SpringBoot整合的双向队列
- ASP.NET Core 双因素验证2FA 实战经验分享
- 一文教你使用java开发一款推箱子游戏
- [html] 精确获取页面元素位置的方式有哪些?
- SQL Server 2005中的分区表(四):删除(合并)一个分区
- GIt -- Window下配置 git
- 文章id 文章标题点击量php,zblogphp函数:GetPost 获取指定ID/标题/别名的文章或页面数据...
- 【渝粤教育】国家开放大学2018年秋季 2312T旅行社经营管理 参考试题
- HTTP服务器项目详解
- linux分区挂载到内存,ubuntu下SD卡分区与挂载
- Silverlight MMORPG WebGame游戏设计(二)--通讯协议之惑
- 优启通做服务器系统,系统安装教程1:制作优启通PE启动盘
- Apache Flink如何处理背压
- OracleDataAdapter.Fill()处于无限等待中 【已解决】
- iOS开发——仿微信图片浏览交互的实现(向下拖拽图片退出图片浏览器)
- 中文翻译拉丁文转换_实时正则表达式(猪拉丁文翻译器)
- EasyNVR纯H5摄像机直播解决方案前端解析之:RTSP安防监控实时直播的网页H5自动播放方案
- uint64_t 头文件 linux,32/64位平台printf uint64的方法
热门文章
- vue-cli创建项目,webpack运行时在 95% emitting CompressionPlugin卡住不动
- 用例图中的包含关系(include)与拓展关系(extend)的区别
- 关于vscode 中Live Server插件无法弹出Chrome浏览器问题
- php的qq邮箱正则表达式语法_正则表达式综合应用:qq邮箱提取
- QT Creator 应用程序*.exe文件打包发布详细教程【绿色便携形式 和 安装包形式】
- 京东/淘宝的手机销售榜(前4名 -- 手机品牌 --手机型号*3 --手机分辨率 -- 手机操作系统 --安卓版本号)
- Unity 彩色打印日志信息
- 蓝桥杯JAVA-32.二维数组(矩阵)实现旋转模板(JAVA实现)
- 2022下半年软考-中级-软件设计师-过关经验
- spring cache annotation(二)