oracle 表空间查看脚本
发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,#!/bin/bashecho -e "\n\n*********~~~~~~~~~~~~~~~~~~~~~~~~~~~~DATE:" `date '+%Y/%m/%d %T'` "~~~~~~~~~
千家信息网最后更新 2025年11月07日oracle 表空间查看脚本
#!/bin/bash
echo -e "\n\n*********~~~~~~~~~~~~~~~~~~~~~~~~~~~~DATE:" `date '+%Y/%m/%d %T'` "~~~~~~~~~~~~~~~~~~~~~~~*********" >>/home/oracle/tablespace.log
export PATH=/opt/oracle/1102/db01/bin:$PATH
export ORACLE_HOME=/opt/oracle/1102/db01/
sqlplus -S /nolog <conn xx/xx@orcl
spool /home/oracle/tablespace.log append
set line 200;
set feedback off;
set pagesize 50000;
col member for a45;
select a.tablespace_name,a.summary,b.free,b.maxf "MAX_FREE_EXTENT",b.free_exts "FREE_EXTENTS",
100-b.free/a.summary*100 "USED%"
from
(select tablespace_name,sum(bytes/1024/1024) "SUMMARY" from dba_data_files
group by tablespace_name) a,
(select tablespace_name,sum(bytes/1024/1024) "FREE",max(bytes/1024/1024)
"MAXF" ,count(*) free_exts
from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by 6 desc;
--col SQL_TEXT for a50
--select t.SQL_TEXT,t.VERSION_COUNT,t.SHARABLE_MEM from v\$sqlarea t where t.VERSION_COUNT>6;
spool off;
eof
df -m >>/home/oracle/tablespace.log
#!/bin/bash
echo -e "\n\n*********~~~~~~~~~~~~~~~~~~~~~~~~~~~~DATE:" `date '+%Y/%m/%d %T'` "~~~~~~~~~~~~~~~~~~~~~~~*********" >>/home/oracle/tablespace.log
export PATH=/opt/oracle/1102/db01/bin:$PATH
export ORACLE_HOME=/opt/oracle/1102/db01/
sqlplus -S /nolog <
spool /home/oracle/tablespace.log append
set line 200;
set feedback off;
set pagesize 50000;
col member for a45;
select a.tablespace_name,a.summary,b.free,b.maxf "MAX_FREE_EXTENT",b.free_exts "FREE_EXTENTS",
100-b.free/a.summary*100 "USED%"
from
(select tablespace_name,sum(bytes/1024/1024) "SUMMARY" from dba_data_files
group by tablespace_name) a,
(select tablespace_name,sum(bytes/1024/1024) "FREE",max(bytes/1024/1024)
"MAXF" ,count(*) free_exts
from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by 6 desc;
--col SQL_TEXT for a50
--select t.SQL_TEXT,t.VERSION_COUNT,t.SHARABLE_MEM from v\$sqlarea t where t.VERSION_COUNT>6;
spool off;
eof
df -m >>/home/oracle/tablespace.log
exit;
######################################################
将上述内容保存到/tmp/tablespace.sh中
然后通过crontab -l -u oracle命令新建计划任务如下:
1 * * * * /bin/bash tmp/tablespace.sh
则每小时将会执行一次脚本,结果将会保存到home/oracle/tablespace.log中
######################################################
以上为在redhat6.4中验证
脚本
任务
内容
命令
小时
结果
验证
空间
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
中国网络安全检查小组组长
家庭服务器黄灯闪烁怎么办
国际服使用什么服务器
ensp网络安全实验报告
郑州软件开发岗位
数据库表行数据删除不掉
辽宁机械软件开发技巧
俄罗斯网络安全监控系统
河源管理软件开发价格
服务器设备安装方案
锐思数据库有哪些数据
常规软件开发排名靠前
互联网科技大奖都有哪些公司
新车强制实时网络安全法规
网络安全工作周小节
数据库安装时用的默认序列号
网络技术到
北京果蔬软件开发
附近有软件开发公司吗
软件开发主流模式
nosql 数据库设计
服务器外网连接方法
公安部网络安全保卫局王瑛玮
tplink 服务器映射
网络安全漫画4格
太原网络安全工程师培训班
欧盟网络安全数据
软件开发的岗位职责
网络技术选修3总结
服务器对电脑要求高吗