Skipping files backed up already [message #200716] |
Wed, 01 November 2006 01:19 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
Hi,
How can we skip files being backed up already?? I tried the following:
rman> configure backup optimization on;
Retention policy is set to redundancy 1
run
{
allocate channel c1 type disk format 'c:\backup2\%d_%u';
backup datafile 9 ;
}
It backed up the datafile for the first time. Then,I executed the above script 2-3 times and every time it created a new backupset without skipping the duplicate. What is missing?Please help.
Regards,
Reena
[Updated on: Wed, 01 November 2006 01:20] Report message to a moderator
|
|
|
|
|
|
Re: Skipping files backed up already [message #200747 is a reply to message #200716] |
Wed, 01 November 2006 03:02 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
The document is very informative. Thanks for that. However, the optimization is still not working. I am backing up database on noarchivelog mode , with retention policy of redundancy 1, optimization set to on ,on disk. Can you please try at your side and send me the the sample ?? I would really appreciate.Thanks.
Reena
|
|
|
|
Re: Skipping files backed up already [message #200749 is a reply to message #200716] |
Wed, 01 November 2006 03:15 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
rman>show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'C:\backup1\backup%d_DB__%u_%s_%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO C:\ORACLE\ORA92\DATABASE\SNCFOPTIVA.ORA'; # default
|
|
|
|
Re: Skipping files backed up already [message #200778 is a reply to message #200716] |
Wed, 01 November 2006 05:13 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
I have checked the conditions mentioned in the document where optimization would work. But still it is backing up files which should be skipped otherwise ,after satisfying all the required conditions given in the document. Can you please give example which is working and that i can check at my end?? Thanks... would really appreciate.
Reena
[Updated on: Wed, 01 November 2006 05:14] Report message to a moderator
|
|
|
|
|
|
Re: Skipping files backed up already [message #200815 is a reply to message #200783] |
Wed, 01 November 2006 07:51 |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |
|
|
C:\>rman target sys/oracle
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1133047245)
RMAN> configure retention policy to none;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=161 devtype=DISK
...
channel c1: starting piece 1 at 01-NOV-06
channel c1: finished piece 1 at 01-NOV-06
piece handle=C:\DATAPUMP\DATA\0MI1APDR comment=NONE
channel c1: backup set complete, elapsed time: 00:01:06
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 01-NOV-06
channel c1: finished piece 1 at 01-NOV-06
piece handle=C:\DATAPUMP\DATA\0NI1APFT comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
Finished backup at 01-NOV-06
released channel: c1
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
allocated channel: c1
channel c1: sid=161 devtype=DISK
Starting backup at 01-NOV-06
skipping datafile 1; already backed up 1 time(s)
skipping datafile 2; already backed up 1 time(s)
skipping datafile 3; already backed up 1 time(s)
skipping datafile 4; already backed up 1 time(s)
skipping datafile 5; already backed up 1 time(s)
Finished backup at 01-NOV-06
released channel: c1
RMAN>
Database is No archive log mode.
Database is currently in Mount mode.
Retention policy is disable.
Between Both bkp there is not change is datafile.
Default Retention policy is redundancy 1.
Effect of Retention Policies on Backup Optimization
The retention policy influences backup optimization. Because the retention policy defaults to REDUNDANCY=1, a retention policy is always in place unless it is explicitly disabled with CONFIGURE RETENTION POLICY TO NONE.
2nd Method. with Retention policy to redundancy 2 with database database configuration specified above.;
C:\>rman target sys/oracle
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1133047245)
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
using target database controlfile instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION OFF;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
RMAN> configure retention policy to redundancy 1;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
new RMAN configuration parameters are successfully stored
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
...
channel c1: starting piece 1 at 01-NOV-06
channel c1: finished piece 1 at 01-NOV-06
piece handle=C:\DATAPUMP\DATA\0CI1AOGT comment=NONE
channel c1: backup set complete, elapsed time: 00:01:06
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 01-NOV-06
channel c1: finished piece 1 at 01-NOV-06
piece handle=C:\DATAPUMP\DATA\0DI1AOIV comment=NONE
channel c1: backup set complete, elapsed time: 00:00:05
Finished backup at 01-NOV-06
released channel: c1
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
...
piece handle=C:\DATAPUMP\DATA\0FI1AOLJ comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 01-NOV-06
released channel: c1
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
allocated channel: c1
channel c1: sid=161 devtype=DISK
Starting backup at 01-NOV-06
skipping datafile 1; already backed up 2 time(s)
skipping datafile 2; already backed up 2 time(s)
skipping datafile 3; already backed up 2 time(s)
skipping datafile 4; already backed up 2 time(s)
skipping datafile 5; already backed up 2 time(s)
Finished backup at 01-NOV-06
released channel: c1
Note : Optimization cmd only work below type of bkp.
You run BACKUP DATABASE, BACKUP ARCHIVELOG with ALL or LIKE options, or BACKUP BACKUPSET ALL.
Note. Right now i have no 9i database so test is based on 10g. but all documentation is based on 9.2.
Hope this helps.
[Updated on: Wed, 01 November 2006 07:52] Report message to a moderator
|
|
|
Re: Skipping files backed up already [message #200817 is a reply to message #200815] |
Wed, 01 November 2006 07:56 |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |
|
|
Before You learn about "optimization" plz. go through about
retention policy of recovery windows or redundancy.
You have two mutually exclusive options for implementing an retention policy: specifying a recovery window, or specifying redundancy (the default type of retention policy). The retention policy commands are as follows:
[B]Recovery Window[/B]
A recovery window is a period of time that begins with the current time and extends backward in time to the point of recoverability. The point of recoverability is the earliest time for a hypothetical point-in-time recovery, that is, the earliest point to which you can recover following a media failure. For example, if you implement a recovery window of one week, then this window of time must extend back exactly seven days from the present so that you can restore a backup and recover it to this point. You implement this retention policy as follows:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
This command ensures that for each datafile one backup that is older than the point of recoverability must be retained. For example, if the recovery window is 7, then there must always exist one backup of each datafile that satisfies the following condition:
SYSDATE - (SELECT CHECKPOINT_TIME FROM V$DATAFILE) >= 7
Also go through below link
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmconc1.htm#477319
************************
[B]Backup Redundancy[/B]
Besides RECOVERY WINDOW, the CONFIGURE command has another mechanism for controlling how long backups should be retained: the REDUNDANCY parameter. The REDUNDANCY parameter specifies that any number of backups or copies beyond a specified number need not be retained. For example, you can specify:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
Although the recovery window is the best practice for specifying an retention policy, you choose not to specify it because the number of backups that must be kept by the recovery window is not constant and depends on the backup schedule. Use the CONFIGURE RETENTION POLICY TO REDUNDANCY command to implement a retention policy that maintains a constant number of backups of each datafile. The RECOVERY WINDOW option is mutually exclusive with the REDUNDANCY option.
By default, the retention policy is configured to REDUNDANCY = 1 to maintain compatibility with the behavior of REPORT OBSOLETE in earlier RMAN releases. If you run the following command, then RMAN returns the retention policy to the default value:
CONFIGURE RETENTION POLICY CLEAR;
for more info go through above mention link
******************
[b]What is effect On Optimization with Retention policy[/b]
Backup Optimization Algorithm
If you enable backup optimization, then the BACKUP command skips the backup of a file when the identical file has already been backed up to the allocated device type. Table 5-4 describes criteria that RMAN uses to determine whether a file is identical to a file that it already backed up.
[b]Criteria to Determine an Identical File[/B]
For DATAFILE only.
1.Datafile
Same DBID, checkpoint SCN, and RESETLOGS SCN and time. The datafile must be offline-normal, read-only, or closed normally.
****
(If RMAN determines that a file is identical and it has already been backed up, then it is a candidate for skipping. However, RMAN must do further checking to determine whether to skip the file, because both the retention policy feature and the backup duplexing feature influence the algorithm that determines whether RMAN has "enough" backups on the specified device type.)
2.Datafile
If you configured a recovery window, then RMAN skips a datafile backup only if the latest backup of a file is earlier than the earliest point in the window.
If you did not configure a recovery window, then RMAN sets n=1 and searches for values of n in this order of precedence (that is, values higher on the list override values lower on the list):
If CONFIGURE RETENTION POLICY TO REDUNDANCY r is enabled, then RMAN only skips datafiles when n=r+1 backups exist.
BACKUP ... COPIES n
SET BACKUP COPIES n
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE ... TO n
RMAN skips backup only if at least n backups of an identical file exist on the specified device. If RMAN does not skip the backup, then it makes the backup exactly as specified.
HOPE THIS HELPS.
[Updated on: Wed, 01 November 2006 10:35] Report message to a moderator
|
|
|
Re: Skipping files backed up already [message #200924 is a reply to message #200716] |
Wed, 01 November 2006 22:49 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
Hi,
First of all , Thanks a lot for your time in this. I really appreciate it. I tried the same sequence of steps in 9i with retention policy first set to none and then 1 , but it did not work. Then i noticed, that your test used controlfile instead of the recovery catalog as the repository where as i had been using the recover catalog always. Then, i tried the optimization with controlfile as repository this time . And to my surprise.. It worked!!! And it skipped the file on the very first run(As backup was taken earlier with recovery catalog). Please check the run below. It seems that the the optimization works in 9i when controlfile is used as the repsoitory and not with recovery catlog or there some would other way of doing(other parameters to be set /sequence of steps). What do you say??Please Please check and suggest. Thanks.
TEST RUN
RMAN> show all
2> ;
using target database controlfile instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO NONE;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # de
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\backup1\%u';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\ORA92\DATABASE\SNCFOPTIV
; # default
RMAN> configure retention policy to none;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\backup1\%u';
4> backup database;
5> }
allocated channel: c1
channel c1: sid=9 devtype=DISK
Starting backup at 02-NOV-06
skipping datafile 1; already backed up 4 time(s)
skipping datafile 2; already backed up 4 time(s)
skipping datafile 3; already backed up 4 time(s)
skipping datafile 4; already backed up 4 time(s)
skipping datafile 5; already backed up 4 time(s)
skipping datafile 6; already backed up 4 time(s)
skipping datafile 7; already backed up 4 time(s)
skipping datafile 8; already backed up 4 time(s)
skipping datafile 9; already backed up 4 time(s)
skipping datafile 10; already backed up 4 time(s)
skipping datafile 11; already backed up 4 time(s)
skipping datafile 12; already backed up 4 time(s)
Finished backup at 02-NOV-06
released channel: c1
Thanks and Regards
Reena
|
|
|
|
|
|
Re: Skipping files backed up already [message #200938 is a reply to message #200716] |
Thu, 02 November 2006 00:25 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
I could not get this. Why cannot we create recovery catalog in a different database? If it is so, then the purpose of maintaining respository in catalog would not be met. what if the datafile maintaining the catalog is corrupted??
Thanks
Reena
|
|
|
|
Re: Skipping files backed up already [message #200950 is a reply to message #200939] |
Thu, 02 November 2006 01:03 |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |
|
|
I will try in my workshop.
based on 10.2.0.1.0
SQL> select ts#,name,status
2 from v$tablespace, dba_tablespaces
3 where v$tablespace.name = dba_tablespaces.tablespace_name
4 and dba_tablespaces.status = 'OFFLINE';
TS# NAME STATUS
---------- ------------------------------ ---------
4 USERS OFFLINE
C:\>rman catalog=rman/rman@catdb target=sys/admin@orcl
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database (not started)
connected to recovery catalog database
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO NONE;
CONFIGURE BACKUP OPTIMIZATION ON;
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
allocated channel: c1
channel c1: sid=160 devtype=DISK
Starting backup at 02-NOV-06
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF
input datafile fno=00003 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBF
input datafile fno=00005 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\EXAMPLE01.DB
F
input datafile fno=00002 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DB
F
input datafile fno=00006 name=C:\DATAPUMP\DATA\RMAN01.DBF
input datafile fno=00004 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF
channel c1: starting piece 1 at 02-NOV-06
channel c1: finished piece 1 at 02-NOV-06
piece handle=C:\DATAPUMP\DATA\13I1CLG1 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:17
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 02-NOV-06
channel c1: finished piece 1 at 02-NOV-06
piece handle=C:\DATAPUMP\DATA\14I1CLIE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:10
Finished backup at 02-NOV-06
released channel: c1
RMAN> run
2> {
3> allocate channel c1 type disk format 'c:\datapump\data\%u';
4> backup database;
5> }
allocated channel: c1
channel c1: sid=160 devtype=DISK
Starting backup at 02-NOV-06
skipping datafile 4; already backed up 1 time(s)
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF
input datafile fno=00003 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBF
input datafile fno=00005 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\EXAMPLE01.DB
F
input datafile fno=00002 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DB
F
input datafile fno=00006 name=C:\DATAPUMP\DATA\RMAN01.DBF
channel c1: starting piece 1 at 02-NOV-06
channel c1: finished piece 1 at 02-NOV-06
piece handle=C:\DATAPUMP\DATA\15I1CLK8 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:16
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 02-NOV-06
channel c1: finished piece 1 at 02-NOV-06
piece handle=C:\DATAPUMP\DATA\16I1CLMK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
Finished backup at 02-NOV-06
released channel: c1
Hope this helps
Mohammad Taj.
|
|
|
|
|
|
|
Re: Skipping files backed up already [message #200978 is a reply to message #200716] |
Thu, 02 November 2006 02:08 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
That is fine. But, in our test where we used the controlfile as repository, i did not put any datafile offline. The database was in mount state. And still it skipped. Then, why not when we use recovery catalog? Also, the datafiles are still closed when we open database in mount state. Isn't it?Then, shouldn't it work??
Regards,
reena
|
|
|
|
|
|