SELECT TRIM(START_TIME||'#'),
TRIM(END_TIME||'#'),
TRIM(CASE OUTPUT_DEVICE_TYPE
WHEN 'DISK' THEN
'DISK'
WHEN 'SBT_TAPE' THEN
'SBT_TAPE'
ELSE
'Others'
END||'#') AS BACKUP_DEVICE,
TRIM(STATUS||'#'),
TRIM(CASE INPUT_TYPE
WHEN 'DB FULL' THEN
'DB_FULL'
WHEN 'DB INCR' THEN
'DB_INCR'
WHEN 'ARCHIVELOG' THEN
'DB_ARCH'
ELSE
'Others'
END||'#') AS BACKUP_TYPE,
TRIM(ROUND(ELAPSED_SECONDS / 60 / 60, 2)||'#') AS T,
TRIM(OUTPUT_BYTES_DISPLAY||'#') AS DB_SIZE
FROM V\\$RMAN_BACKUP_JOB_DETAILS
WHERE START_TIME = (SELECT MAX(START_TIME) FROM V\\$RMAN_BACKUP_JOB_DETAILS);
---11G 使用SYS 用户可以直接查询结果;12C 需要在CDB 使用SYS用户查询,否则没有结构。