Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle RMAN Number of Days Since Last Backup

Oracle Database Tips by Donald BurlesonOctober 26, 2015

Question:  How can I see the number of days since my last backup? 

It is easy to see the number of days since the last backup in MSSQL, but I need to know how to see the backup frequency in Oracle.

Answer:  There are many ways to see the number of days since your last Oracle backup. 

Unlike MS-SQL, Oracle provides many backup methods:

  • RMAN
  •  OS backups
  •  3rd party backup tools (Symantec, Veritas, Omniback etc.)

If you are using RMAN for your backups, there is a catalog database you can query with as set of RMAN commands:

RMAN> list archivelog all backed up 1 times to device type xxx;

You can see the frequency and dates of backups using the RMAN catalog tables:

  •  rc_backupset_summary
  • rc_backup_set

Or query the v$ views for RMAN backup completion details:

  • v$rman_status
  •  v$backup_set

These RMAN SQL queries will all find the number of days since the last database backup:

 -- *****************************************
-- SQL for v$backup_set to see last backup
-- *****************************************

select *
    from
    v$backup_set
where
    completion_time > sysdate-7
order by
    completion_time desc;

-- *****************************************
-- SQL for rc_backup_set to see most recent backup
-- *****************************************

select *
from
    rc_backup_set
where
    completion_time > sysdate-7
order by
    completion_time desc;

-- *****************************************
-- Display most recently completed RMAN backup
-- *****************************************

select *
from
    rc_backup_set
where
    backup_type = 'D'
and
    controlfile_included = 'BACKUP'
order by
    completion_time desc

-- *****************************************
-- Display newest_backupset_time for RMAN backup
-- *****************************************

select
    db_name,
    newest_backup_time
from
    rman.rc_backupset_summary  
where
    dn_name = 'MKYSID';

-- *****************************************
-- You can also outer join rc_backupset_summary
-- into rc_database to see the RMAN latest backup start time:
-- *****************************************

select
    name,
    max(start_time)
from
    rman.rc_database     d,
    rman.rc_backup_set  s
where
    db_id(+) = dbid
group by
    name
order by 2 desc;

-- *****************************************
-- Display RMAN backupo status start and end times:
-- *****************************************

select
    operation,
    status,
    object_type,
    to_char(start_time,'mm/dd/yyyy:hh:mi:ss') as start_time,
    to_char(end_time,'mm/dd/yyyy:hh:mi:ss') as end_time
from
    v$rman_status
where
    start_time > SYSDATE -1
and
    operation = 'BACKUP'
and
    object_type = 'DB FULL'
order by
    start_time desc;

There are many more permutations of RMAN queries to see the latest backup details, see the Oracle RMAN book for details.

 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster