Difference between revisions of "RMAN"
From dbawiki
| Line 1: | Line 1: | ||
| − | == | + | ==Check the status of the database backups for the past 7 days== |
| + | Run this one from sys on the database server | ||
<pre> | <pre> | ||
| − | col operation | + | set pages 100 |
| − | col | + | set lines 200 |
| − | col start_time for a17 | + | col operation for a12 |
| − | col end_time | + | col backup_type for a27 |
| − | col duration | + | col start_time for a17 |
| + | col end_time for a17 | ||
| + | col duration for 90.99 | ||
| + | col days_ago for 90 | ||
select vrbsd.operation | select vrbsd.operation | ||
| − | , vrbsd.command_id | + | , vrbsd.command_id backup_type |
, to_char(vrbsd.start_time,'DD-MON-YY HH24:MI') start_time | , to_char(vrbsd.start_time,'DD-MON-YY HH24:MI') start_time | ||
, to_char(vrbsd.end_time,'DD-MON-YY HH24:MI') end_time | , to_char(vrbsd.end_time,'DD-MON-YY HH24:MI') end_time | ||
, vrbsd.status status | , vrbsd.status status | ||
, (vrbd.elapsed_seconds/3600) duration | , (vrbd.elapsed_seconds/3600) duration | ||
| + | , trunc(sysdate)-trunc(vrbsd.start_time) days_ago | ||
from v$rman_backup_job_details vrbd | from v$rman_backup_job_details vrbd | ||
, v$rman_backup_subjob_details vrbsd | , v$rman_backup_subjob_details vrbsd | ||
| Line 18: | Line 23: | ||
and vrbd.session_key = vrbsd.session_key | and vrbd.session_key = vrbsd.session_key | ||
and vrbd.input_type='DB INCR' | and vrbd.input_type='DB INCR' | ||
| + | and vrbsd.start_time > sysdate -8 | ||
order by vrbsd.start_time desc | order by vrbsd.start_time desc | ||
</pre> | </pre> | ||
| − | == | + | ==Check the status of the database backups from the RMAN catalog== |
| + | Run this one from the RMAN catalog server | ||
select s.db_name | select s.db_name | ||
, s.status | , s.status | ||
| Line 28: | Line 35: | ||
, max(round((end_time-start_time)*60*24)) "duration(min)" | , max(round((end_time-start_time)*60*24)) "duration(min)" | ||
, trunc(sysdate)-trunc(s.start_time) days_since_last_backup | , trunc(sysdate)-trunc(s.start_time) days_since_last_backup | ||
| − | from | + | from rc_rman_status s |
where 1=1 | where 1=1 | ||
and lower(s.operation) = 'backup' | and lower(s.operation) = 'backup' | ||
| Line 35: | Line 42: | ||
( | ( | ||
select max(md.start_time) | select max(md.start_time) | ||
| − | from | + | from rc_rman_status md |
where 1=1 | where 1=1 | ||
and lower(md.operation) = 'backup' | and lower(md.operation) = 'backup' | ||
Revision as of 09:28, 1 February 2013
Contents
Check the status of the database backups for the past 7 days
Run this one from sys on the database server
set pages 100 set lines 200 col operation for a12 col backup_type for a27 col start_time for a17 col end_time for a17 col duration for 90.99 col days_ago for 90 select vrbsd.operation , vrbsd.command_id backup_type , to_char(vrbsd.start_time,'DD-MON-YY HH24:MI') start_time , to_char(vrbsd.end_time,'DD-MON-YY HH24:MI') end_time , vrbsd.status status , (vrbd.elapsed_seconds/3600) duration , trunc(sysdate)-trunc(vrbsd.start_time) days_ago from v$rman_backup_job_details vrbd , v$rman_backup_subjob_details vrbsd where 1=1 and vrbd.session_key = vrbsd.session_key and vrbd.input_type='DB INCR' and vrbsd.start_time > sysdate -8 order by vrbsd.start_time desc
Check the status of the database backups from the RMAN catalog
Run this one from the RMAN catalog server
select s.db_name
, s.status
, max(s.start_time) start_time
, max(round(s.mbytes_processed/1024)) "processed_data(GB)"
, max(round((end_time-start_time)*60*24)) "duration(min)"
, trunc(sysdate)-trunc(s.start_time) days_since_last_backup
from rc_rman_status s
where 1=1
and lower(s.operation) = 'backup'
and lower(s.object_type) ='db full'
and s.start_time =
(
select max(md.start_time)
from rc_rman_status md
where 1=1
and lower(md.operation) = 'backup'
and lower(md.object_type) ='db full'
and md.db_name = s.db_name
)
group by s.db_name
, s.object_type
, s.operation
, s.status
, trunc(sysdate)-trunc(s.start_time)
order by trunc(sysdate)-trunc(s.start_time) desc
Which tapes are the backups on?
Not really necessary as RMAN can work it out but if you need to know...
select media , to_char(completion_time,'DD-MON-YYYY HH24:MI:SS') backed_up from rc_backup_piece where 1=1 and db_id = 4053457814 and completion_Time > sysdate - 2 order by 2
Get rid of an agent that won’t go away in the Grid screens:
emctl stop agent
exec mgmt_admin.cleanup_agent('<myserver>:<port>')
emctl start agent
Get rid of targets that won’t go away in the Grid screens:
exec mgmt_admin.delete_target('target_name','target_type’)
See mgmt_targets table in sysman schema for list of known targets.