December 08, 2012

Database Health Check



@OS level
---------

ORACLE_SID=`ps -ef | grep asm_smon | grep -v 'grep' | grep -v 'sed' | awk '{printf $8}' | awk 'BEGIN{FS="_"}

{printf $3}'`

date
env
uptime
who -b
last | grep -i boot
ps -ef | grep pmon
ps -ef | grep tns
ps -ef | grep d.bin
df -h or df -g
uname
/etc/oratab or /etc/var/oracle/oratab
sqlplus
alert log errors
tnsping
load average
top

@DB LEVEL
---------
export ORACLE_SID

sqlplus "/as sysdba"

set pages 9999 lines 300
col OPEN_MODE for a10
col HOST_NAME for a10
select

name,INSTANCE_NAME,HOST_NAME,OPEN_MODE,DATABASE_STATUS,DATABASE_ROLE,PROTECTION_LEVEL,CONTROLFILE_TYPE,LOGINS,to_

char(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') "UP TIME"from v$database,gv$instance;

select * from v$recover_file;

select distinct status from v$datafile;

select distinct status from v$datafile_header;

alter system checkpoint;

alter system switch logfile;

ASM
---
1.ACFS Filesystem Mount Status
2.crsctl stat res -t

DATAGUARD
---------
1.DR Data SYNC Status.

OTHER
-----
select value from v$parameter where name='log_archive_dest_1';
alert log errors
blocking sessions
sessions/process count

No comments:

Post a Comment