诊断数据库

RMAN>
list failure 显示数据库错误信息(默认列出优先级为高的优先级)

[ ALL | CRITICAL | HIGH | LOW | CLOSED | failnum[,failnum,…] ]
[ EXCLUDE FAILURE failnum[,failnum,…] ]
[ DETAIL ]

list failure all;

list failure detail;查看数据库错误明细

advise failure ; 对list failure的错误提供处理建议

repair failure;修复错误

repair failure preview;预览修复会产生什么动作,不真正执行修复

change failure 5(错误号) priority low; 改变错误的优先级

validate database;对数据库进行一个全面的检查

ORA-01578块出错

块介质修复
 有0级或全备,开启归档

run{
set maxcorrupt for datafile 6 to 100; 在有100个坏块内 也能备份
backup database;
}

recover datafile 6 block 140;修复坏块140

操作系统下输入  adrci 事件管理

show incident 查看事件

show home查看报警日志文件
set home 指定到数据库的报警日子文件
show alert -tail -f 查看文件信息


SQL> SELECT * FROM V$DIAG_INFO;

NAME                  VALUE
-------------------   -------------------------------------------------
Diag Enabled          TRUE
ADR Base              /u01/app/oracle
ADR Home              /u01/app/oracle/diag/rdbms/orcl/orcl
Diag Trace            /u01/app/oracle/diag/rdbms/orcl/orcl/trace
Diag Alert            /u01/app/oracle/diag/rdbms/orcl/orcl/alert
Diag Incident         /u01/app/oracle/diag/rdbms/orcl/orcl/incident
Diag Cdump            /u01/app/oracle/diag/rdbms/orcl/orcl/cdump
Health Monitor        /u01/app/oracle/diag/rdbms/orcl/orcl/hm
Default Trace File    /u01/app/oracle/diag/.../trace/orcl_o
ra_11424.trc
Active Problem Count  3
Active Incident Count 8


表健康信息检查

sql>
执行检查
exec dbms_hm.run_check('Dictionary Integrity Check',
                                            'mycheck',0,'TABLE_NAME=tab$');

查看检查结果

select dbms_hm.get_run_report('mycheck') from dual;

set long 2000;(加上这句才能看到完整的报告)


select * from v$hm_check  查看可以report的结果

select * from v$hm_check_param


使用adrci
adrci>>show hm_run 查看所有的

----------------------------------------------------------
RUN_ID                        11081
RUN_NAME                      HM_RUN_11081
CHECK_NAME                    Database Cross Check
NAME_ID                       2
MODE                          2
START_TIME                    2007-04-13 03:20:31.161396 -07:00
RESUME_TIME
END_TIME                      2007-04-13 03:20:37.903984 -07:00
MODIFIED_TIME                 2007-04-17 01:16:37.106344 -07:00
TIMEOUT                       0
FLAGS                         0
STATUS                        5
SRC_INCIDENT_ID               0
NUM_INCIDENTS                 0
ERR_NUMBER                    0
REPORT_FILE

adrci>>create report hm_run HM_RUN_11081 单独看
Adrci>>show report hm_run HM_RUN_11081

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28889722/viewspace-1246428/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28889722/viewspace-1246428/

你可能感兴趣的:(诊断数据库)