Home » RDBMS Server » Backup & Recovery » Rman Incremental backup (daily comulative, hourly differential) (oracle Enterprise, 10g, debian gnu-linux)
icon1.gif  Rman Incremental backup (daily comulative, hourly differential) [message #332443] Tue, 08 July 2008 09:32 Go to next message
riccardo
Messages: 3
Registered: July 2008
Junior Member
First, sorry for my english

My question is about my backup settings

the idea is

a complete weekly backup (compressed backupset level 0)
a daily (comulative) incremental backup (same, level 1)
a hourly (differential) incremental backup (level1)



could you please tell me if the following examples will fit my needs,
thanks to you all




using crontab:
# m h dom mon dow user      command
55 4 * * 7        oracle    /usr/local/oracle/scripts/weekly.sh &> /usr/local/oracle/scripts/weekly.log
05 6 * * *        oracle    /usr/local/oracle/scripts/daily.sh &> /usr/local/oracle/scripts/daily.log
35 * * * *        oracle    /usr/local/oracle/scripts/hourly.sh &> /usr/local/oracle/scripts/hourly.log



for script like:
# /usr/local/oracle/scripts/weekly.sh
rman @/usr/local/oracle/scripts/weekly_full.rman LOG /usr/local/oracle/scripts/weekly_full.rman.log

# /usr/local/oracle/scripts/daily.sh
rman @/usr/local/oracle/scripts/daily_comulative.rman LOG /usr/local/oracle/scripts/daily_comulative.rman.log

# /usr/local/oracle/scripts/hourly.sh
rman @/usr/local/oracle/scripts/hourly_incremental.rman LOG /usr/local/oracle/scripts/hourly_incremental.rman.log






WEEKLY :

#*** Weekly RMAN Script weekly_full.rman
CONNECT TARGET /

#*** Weekly full controlfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'WEEKLY_CONTROLFILE'
FORMAT '/srv/oradata/backups/weekly_controlfile_%d_t%t_s%s_p%p'
CURRENT CONTROLFILE;

#*** Weekly full spfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'WEEKLY_SPFILE'
FORMAT '/srv/oradata/backups/weekly_spfile_%d_t%t_s%s_p%p'
SPFILE;

#*** Weekly full database plus archivelog backup
BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 0
DEVICE TYPE DISK
TAG = 'WEEKLY_DATABASE'
FORMAT '/srv/oradata/backups/weekly_database_%d_t%t_s%s_p%p'
DATABASE;

#*** Weekly full archivelog backup
change archivelog all validate;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 0
DEVICE TYPE DISK
TAG = 'WEEKLY_ARCHIVELOG'
FORMAT '/srv/oradata/backups/weekly_archivelog_%d_t%t_s%s_p%p'
ARCHIVELOG FROM TIME 'SYSDATE-7';

#*** Remove old backups and archivelogs
# probabile il backup dell'archivelog lo considera in delete backup,
# quindi per avere 2 copie di weekly e daily (sia bkp che arc) basta sysdate-10 (>7) a backup
# e bastera' un sysdate-3 per gli archivelog che stanno sul flash-recovery-area
# un occhio a 'LIST COPY' 'LIST ARCHIVELOG ALL' mostra lo stesso risultato, ovvero gli arc sulla flash
DELETE BACKUP COMPLETED BEFORE 'SYSDATE-10' DEVICE TYPE DISK;
DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE-3';

#*** Maintenance steps
CROSSCHECK COPY;
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED COPY;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

EXIT;








DAILY :

#*** Daily RMAN Script daily_comulative.rman
CONNECT TARGET /

#*** Daily full database backup
BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 1 CUMULATIVE
DEVICE TYPE DISK
TAG = 'DAILY_COMULATIVE_DATABASE'
FORMAT '/srv/oradata/backups/daily_comulative_database_%d_t%t_s%s_p%p'
DATABASE;

#*** Daily full archivelog backup
change archivelog all validate;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 1 CUMULATIVE
DEVICE TYPE DISK
TAG = 'DAILY_COMULATIVE_ARCHIVELOG'
FORMAT '/srv/oradata/backups/daily_comulative_archivelog_%d_t%t_s%s_p%p'
ARCHIVELOG FROM TIME 'SYSDATE-3';

#*** Maintenance steps
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED COPY;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

EXIT;








HOURLY :

#*** Hourly RMAN Script hourly_incremental.rman
CONNECT TARGET /

#*** Hourly incremental database backup
BACKUP CHECK LOGICAL
AS BACKUPSET
INCREMENTAL LEVEL 1
DEVICE TYPE DISK
TAG = 'HOURLY_INCREMENTAL_DATABASE'
FORMAT '/srv/oradata/backups/hourly_incremental_database_%d_t%t_s%s_p%p'
DATABASE;

#*** Hourly incremental archivelog backup
BACKUP CHECK LOGICAL
AS BACKUPSET
INCREMENTAL LEVEL 1
DEVICE TYPE DISK
TAG = 'HOURLY_INCREMENTAL_ARCHIVELOG'
FORMAT '/srv/oradata/backups/hourly_incremental_archivelog_%d_t%t_s%s_p%p'
ARCHIVELOG FROM TIME 'SYSDATE-1';

EXIT;

Re: Rman Incremental backup (daily comulative, hourly differential) [message #332455 is a reply to message #332443] Tue, 08 July 2008 10:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above


Quote:

could you please tell me if the following examples will fit my needs,



Since you did not specify your needs, your question remains unanswered.

Do you have documented & tested Recovery Procedures?

[Updated on: Tue, 08 July 2008 10:11] by Moderator

Report message to a moderator

Re: Rman Incremental backup (daily comulative, hourly differential) [message #332457 is a reply to message #332443] Tue, 08 July 2008 10:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Hourly backup! Why?

Regards
Michel
Re: Rman Incremental backup (daily comulative, hourly differential) [message #332470 is a reply to message #332457] Tue, 08 July 2008 11:14 Go to previous messageGo to next message
riccardo
Messages: 3
Registered: July 2008
Junior Member
It's for a internet card game server, a committent request :\




The Query can be:


I'm not sure that the "hourly differential backup" is the one who increase compared with the "incremental backup" or the "daily cumulative backup"



Another dubt:
the scripts above generate these files:
-rw------- 1 oracle oinstall  12M 2008-07-08 17:28 block_tracking.dbf
-rw------- 1 oracle oinstall  31K 2008-07-08 15:47 daily_comulative_archivelog_SALES_t659548038_s129_p1
-rw------- 1 oracle oinstall 392K 2008-07-08 15:47 daily_comulative_database_SALES_t659548031_s127_p1
-rw------- 1 oracle oinstall 1.2M 2008-07-08 15:47 daily_comulative_database_SALES_t659548035_s128_p1
-rw------- 1 oracle oinstall 8.0K 2008-07-08 15:47 hourly_incremental_archivelog_SALES_t659548075_s132_p1
-rw------- 1 oracle oinstall 4.0M 2008-07-08 16:35 hourly_incremental_archivelog_SALES_t659550912_s135_p1
-rw------- 1 oracle oinstall 112K 2008-07-08 15:47 hourly_incremental_database_SALES_t659548072_s130_p1
-rw------- 1 oracle oinstall 3.4M 2008-07-08 15:47 hourly_incremental_database_SALES_t659548073_s131_p1
-rw------- 1 oracle oinstall 4.5M 2008-07-08 16:35 hourly_incremental_database_SALES_t659550903_s133_p1
-rw------- 1 oracle oinstall 3.4M 2008-07-08 16:35 hourly_incremental_database_SALES_t659550910_s134_p1

-rw------- 1 oracle oinstall 3.3M 2008-07-08 16:35 snapshot.ctr
-rw------- 1 oracle oinstall 114M 2008-07-08 15:46 weekly_archivelog_SALES_t659547949_s126_p1
-rw------- 1 oracle oinstall 3.2M 2008-07-07 18:43 weekly_controlfile_SALES_t659472210_s75_p1
-rw------- 1 oracle oinstall 3.3M 2008-07-08 15:44 weekly_controlfile_SALES_t659547853_s122_p1
-rw------- 1 oracle oinstall 125M 2008-07-08 15:45 weekly_database_SALES_t659547858_s124_p1
-rw------- 1 oracle oinstall 1.2M 2008-07-08 15:45 weekly_database_SALES_t659547943_s125_p1
-rw------- 1 oracle oinstall  96K 2008-07-08 15:44 weekly_spfile_SALES_t659547855_s123_p1


I can see the files inherent to the backup twice. why's that?
( for example 2 weekly_database_SALES_*)

More than this, I can see that the second hourly backup of the archivelogs is very small (in size) while the first is not, and this is ok. I expect this to happen for the second file of database backup. And this is not happening...

This makes me doubt about the procedure i'm following and that I did something wrong about, for example, the hourly incremental backup or the daily backup.

I'm reading several pages of documentation but the troubles still remain Confused
Thanks for the answers
Re: Rman Incremental backup (daily comulative, hourly differential) [message #333083 is a reply to message #332470] Thu, 10 July 2008 08:34 Go to previous message
riccardo
Messages: 3
Registered: July 2008
Junior Member
Sorry for my insistance but i really would like to understand and be sure to create incremental backups of a specific backup.

the instruction "FOR RECOVER OF TAG "WEEKLY_DATABASE" should be useful to my purpose but I really can't find an example suitable to my case.

An application would be:

#*** Daily comulative database backup
BACKUP
CHECK LOGICAL
INCREMENTAL LEVEL 1
CUMULATIVE
FOR RECOVER OF TAG 'WEEKLY_DATABASE'
TAG 'DAILY_COMULATIVE_DATABASE'
DEVICE TYPE DISK
FORMAT '/srv/oradata/backups/daily_comulative_database_%d_t%t_s%s_p%p'
AS COMPRESSED BACKUPSET
DATABASE;


Clearly an incremental cumulative backup of a specific weekly backup. But after this, is it possible to do an incremental differential hourly backup froma a daily cumulative backup?

Maybe I'm doing this too much complicated and there's another suitable solution. A small hint would be really helpful and appreciated! Thanks in advance.
Previous Topic: RMAN backup
Next Topic: Database recovery
Goto Forum:
  


Current Time: Fri Nov 22 13:28:57 CST 2024