RMAN备份时会记录每一次备份的状态信息,例如COMPLETED,FAILED等,但是使用下面脚本查询数据库时,偶尔你会看到有些备份的状态为COMPLETED WITH WARNINGS 那么如果你发现备份的状态为COMPLETED WITH WARNINGS,怎么找出RMAN备份的具体告警信息呢?一个方法是从RMAN备份
的日志中可以搜索到具体的告警信息,还有一种方式,如下所示,找到RMAN备份记录的SESSION_STAMP的值 然后使用下面SQL就能从V$RMAN_OUTPUT中找出备份抛出的告警信息了。当然,你可能还是要看看这些告警信息的上下文,多了解一些具体信息。SET LINESIZE 1080;
COL STATUS FORMAT A9;
COL START_TIME FOR A20;
COL END_TIME FOR A20;
COL INPUT_TYPE FOR A8;
COL OUTPUT_DEVICE_TYPE FOR A8;
COL TIME_HR FOR 999.9
COL IO_IN_RATE FOR A10;
COL IO_OUT_RATE FOR A10;
SELECT CON_ID
, TO_CHAR(START_TIME, 'YYYY-MM-DD HH24:MI:SS') START_TIME
, TO_CHAR(END_TIME, 'YYYY-MM-DD HH24:MI:SS') END_TIME
, SESSION_STAMP
, ROUND (ELAPSED_SECONDS/3600, 1) TIME_HR
, INPUT_TYPE
, STATUS
, INPUT_BYTES/1024/1024/1024 IN_GB
, INPUT_BYTES_PER_SEC_DISPLAY IO_IN_RATE
, OUTPUT_BYTES/1024/1024/1024 OUT_GB
, OUTPUT_BYTES_PER_SEC_DISPLAY IO_OUT_RATE
, OUTPUT_DEVICE_TYPE
FROM V$RMAN_BACKUP_JOB_DETAILS
WHERE START_TIME > SYSDATE - 14
ORDER BY START_TIME ASC;SELECT OUTPUT FROM V$RMAN_OUTPUT
WHERE SESSION_STAMP=1132686012 AND OUTPUT LIKE '%warning%'