Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Query for RESTORE DATABASE PREVIEW

PS_orclNerdJan 19 2023

Hi all,
I am searching a way how to generate a list of backup files which are necessary to be copied to a long term backup. The simplest way to get the data is by running a simple
run {
set until time 'SYSDATE-1' ;
restore database preview ;
}
and grep these files out, but I would like to do it in a prettier way. This means I have to search first for the most recent INC0 and then INC1 and then Archivelogs, and Controlfile Backup of course too.
The problem which here arrises is Backup Optimisation. If there is a datafile read only. There might be a backupset even older than the most recent INC0. With that approach, I could not restore the database to a point in time from the archived backup files.

It's a simple requirement for a customer, I need a function for a gold backup to a specific point in time stored for 6 months, every month reoccuring, after the workload from app layer finished, by simply calling something as easy as
exec archive_backup(tag=>'BILLING_20230101_090023', '01.01.2023 09:00:23') ;
But it's a 3TB database and when I check an INC0 backup that's like 200 files in sum because of section size 10GB. 2TB of backup files, which need to be moved to another storage.
Restoring it somewhere to that point in time and backup is wasted time? Maybe even building a database system (VM) and storing that restored database would be a good option. Simply by storing the VM. It's anyway storage used, in case of need it would be already prepared. I don't know.

What ideas do you have, please?

This post has been answered by AJ on Jan 19 2023
Jump to Answer
Comments
Post Details
Added on Jan 19 2023
2 comments
724 views