Difference between revisions of "RMAN"

From dbawiki
Jump to: navigation, search
(Query to check the status of the database backups)
Line 36: Line 36:
 
  and    completion_Time > sysdate - 2
 
  and    completion_Time > sysdate - 2
 
  order  by 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.

Revision as of 22:35, 22 November 2011

Query to check the status of the database backups

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   rman.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   rman.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.