设为首页 加入收藏

TOP

oracle巡检脚本-部分(三)
2015-07-24 11:22:48 来源: 作者: 【 】 浏览:26
Tags:oracle 巡检 脚本 -部分
tus,
instance_role from v\$instance;
spool off
exit;
!01


cechon "2.3 oracle instance information is : " red
echo
cat 3.txt |xargs |awk '{print "instance_name:"$1,"\nhostname:"$2, \
"\nversion:"$3,"\nstartup_time:"$4" "$5,"\nstatus:"$6,"\ndatabase_status:"$7,"\ninstance_role:"$8}'
echo
rm -rf 3.txt


#2.4 数据库非缺省初始化参数

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 4.txt
SELECT name ,value FROM V\$PARAMETER where ISDEFAULT='FALSE' order by name;
spool off
exit;
!01


cechon "2.4 Database non-default initialization parameters is : " red
echo
cat 4.txt
echo
rm -rf 4.txt


#2.5 database default temp tempspace

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 25.txt
select property_value from database_properties
where property_name='DEFAULT_TEMP_TABLESPACE';
spool off
exit;
!01


cechon "2.5 database default temp tempspace is : " red
echo
cat 25.txt
echo
rm -rf 25.txt


#2.6 database trace position

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 26.txt

SELECT P1.VALUE||''||P2.VALUE||'_ORA_'||P.SPID FILENAME
FROM
V\$PROCESS P,
V\$SESSION S,
V\$PARAMETER P1,
V\$PARAMETER P2
WHERE P1.NAME = 'user_dump_dest'
AND P2.NAME = 'db_name'
AND P.ADDR = S.PADDR
AND S.AUDSID = USERENV ('SESSIONID');

spool off
exit;
!01


cechon "2.6 database trace position is : " red
echo
cat 26.txt
echo
rm -rf 26.txt

cechon "***********************************************************************" yellow
echo
cechon "3.Check the database object stauts:" green
echo
cechon "***********************************************************************" yellow
echo

#3.1 control file

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 31.txt
select name from v\$controlfile;
spool off
exit;
!01


cechon "3.1 Database control file is : " red
echo
cat 31.txt
echo

rm -rf 31.txt

#3.2 Online Redo Logfiles 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 32.txt
select group#,status,type,member from v\$logfile;
spool off
exit;
!01


cechon "3.2 Online Redo Logfiles Status : " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "The result set format:""group#","status","type","member" green
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cat 32.txt
echo
rm -rf 32.txt

#3.3 tablespace 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 33.txt
select tablespace_name,status from dba_tablespaces;
spool off
exit;
!01


cechon "3.3 tablespace Status : " red
echo
cechon "-------------------------------------------------------------------------------------------------" yellow
echo
cechon "

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 3/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)