设为首页 加入收藏

TOP

oracle巡检脚本-部分(四)
2015-07-24 11:22:48 来源: 作者: 【 】 浏览:25
Tags:oracle 巡检 脚本 -部分
The result set format:""tablespace_name","status" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 33.txt
echo
rm -rf 33.txt


#3.4 all datafile Status

sqlplus -S "${ora_user}/${ora_pass} as sysdba" </dev/null #禁止sqlplus执行结果回显
set heading off;
set feedback off;
set termout off;
set pagesize 0;
set verify off;
set echo off;
spool 34.txt
select name,status from v\$datafile;
spool off
exit;
!01


cechon "3.4 all datafile Status : " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "The result set format:""name","status" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 34.txt
echo
rm -rf 34.txt

#3.5 invalid objects

sqlplus -S "${ora_user}/${ora_pass} as sysdba" </dev/null #禁止sqlplus执行结果回显
set heading off;
set feedback off;
set termout off;
set pagesize 0;
set verify off;
set echo off;
spool 35.txt
select owner,object_name,object_type from dba_objects where status!='VALID' and owner!='SYS' and owner!='SYSTEM';
spool off
exit;
!01


cechon "3.5 invalid objects is : " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "The result set format:""owner","object_name","object_type" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 35.txt
echo
rm -rf 35.txt

#3.6 undo segment status

sqlplus -S "${ora_user}/${ora_pass} as sysdba" </dev/null #禁止sqlplus执行结果回显
set heading off;
set feedback off;
set termout off;
set pagesize 0;
set verify off;
set echo off;
spool 36.txt
select segment_name,status from dba_rollback_segs;
spool off
exit;
!01


cechon "3.6 undo segment status : " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "The result set format:""segment_name","status" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 36.txt
echo
rm -rf 36.txt


#3.7 Tables and indexes in the same space object

sqlplus -S "${ora_user}/${ora_pass} as sysdba" </dev/null #禁止sqlplus执行结果回显
set heading off;
set feedback off;
set termout off;
set pagesize 0;
set verify off;
set echo off;
spool 37.txt
select a.owner,
a.tablespace_name tbsname ,
a.table_name tname,
b.index_name iname
from
dba_tables a
,dba_indexes b
where
a.tablespace_name=b.tablespace_name
and b.table_name=a.table_name
and a.owner=b.owner
and b.owner NOT in
('SYS','SYSTEM','XDB','WMSYS','SYSMAN',
'ORDSYS','OUTLN','ORDDATA')
and a.tablespace_name not in('SYSTEM','SYSAUX','UNDOTBS1','USERS'
)
order by owner;
spool off
exit;
!01


cechon "3.7 Tables and indexes in the same space object is: " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "The result set format:""owner","tablespace_name","tablename","index_name" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 37.txt
echo
rm -rf 37.txt

cechon "******

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 4/12/12
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Sybase查询表结构的方法(类似于O.. 下一篇oracle学习入门系列之三Unix、Lin..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·你必须要弄懂的多线 (2025-12-25 04:22:35)
·如何在 Java 中实现 (2025-12-25 04:22:32)
·Java【多线程】单例 (2025-12-25 04:22:29)
·C++中智能指针的性能 (2025-12-25 03:49:29)
·如何用智能指针实现c (2025-12-25 03:49:27)