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 "