Re: incremental rman backup using image copy

  • From: "Anil Goel" <agoel01@xxxxxxxxxxx>
  • To: sjaffarhussain@xxxxxxxxx
  • Date: Mon, 26 Mar 2007 08:57:15 -0500

Thanks for your response, Jaffar. As I mentioned in my initial post, client is using 'BACKUP AS COPY DATAFILE ..' syntax to perform image copy backup but this involves custom code outside of RMAN to supply the file names to RMAN which we like to eliminate.

Since my original post, I have figured out incremental image copy backup in RMAN 10g using 'Incremented Updated backup'.  Here is how it would work:

Step1 .

RUN {
   allocate channel c1 device type disk format '/rman/tltlaw8/backupset/%U';
   BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY DATAFILECOPY      FORMAT='/rman/tltlaw8/image_cp/%d.%N.%f'
   WITH TAG 'incr_testbkup' DATABASE;
   RECOVER COPY OF DATABASE WITH TAG 'incr_testbkup';
   Release channel c1;
   }
Datafile backup will be created as TEST10G.USERS.1

Step2: Create a file to have commands for renaming all datafiles after the backup

spool rename_rman_files.ksh

select 'mv '||d.name||'.'||f.tablespace_name||'.'||file_id rman_name
       , substr(file_name,instr(file_name,'/',-1)+1) file_name
  from dba_data_files f, v$database d;

spool off

Out out will be like :  mv TEST10G.USERS.1 users_01.dbf

Since RMAN still does not provide a format to create file name as they are named in database, step 2 was necessary. Step2 is only needed to be used for copy/cloning a database. RMAN wouldn't need that to recover the database/file.

As far as performance of "Image Copy" backup goes, initial base backup took about 2 hours(about 300GB) and incremental backup takes about an hour. I also tested the 'Change Tracking' mechanism which makes incremental backup much faster since it only backs up the changed blocks. So, timing could vary(seconds to few minutes) based on number of blocks changed since last backup.

Why client uses "Image Copy", it's just handy/convenient if you need to copy/clone databases(old fashioned way) and do not have to worry about rman to restore.

Anil Goel


From:  "Syed Jaffar Hussain" <sjaffarhussain@xxxxxxxxx>
To:  agoel01@xxxxxxxxxxx
CC:  oracle-l@xxxxxxxxxxxxx
Subject:  Re: incremental rman backup using image copy
Date:  Sat, 24 Mar 2007 11:07:13 +0300

>>
I read some documentation and did limited testing but sounds like we still can't backup the datafiles as it is.  RMAN backups the datafile using it's own naming convention(format command) e.g. datafile users_01.dbf can not be backed up as users_01.dbf in backup destination. >>
If you are not using FRA (Flash Recovery Area), it is very well possible to have the same name using the format with BACKUP AS .
 
BACKUP AS COPY DATAFILE 'user01.dbf' FORMAT 'user01.dbf';
 
Anil, just a though, why dont the client wants to have backupsets rather than image copies? I know that Oracle first perfers to the image copies compare to incremental or backupsets.
 
But, you know, image copy is just a block to block copy, no compression. It would take good considerable time to finish the backup.
 
10g RMAN has very rich features, like BTC, binary compression and etc.
 
 
Jaffar


 
On 3/20/07, Anil Goel <agoel01@xxxxxxxxxxx> wrote:

I am no expert on RMAN, so, I thought I post it here to get some possible solution for a client of mine.

Currently, they are taking "image copy' of rman backups for 9i/10g databases, they are not using rman catalog. As RMAN 9i did not allow image copy, they wrote custom code to generate statement like below for "rman" to execute for all datafiles within a database:

COPY DATAFILE '/opt/oradata/test10g/users_01.dbf' TO
'/rman/test10g/users_01.dbf';

That's how they accomplished rman 9i "image copy". They want to continue the same path on rman 10g but want to get rid of custom code as 10g now allows "image copy". I read some documentation and did limited testing but sounds like we still can't backup the datafiles as it is.  RMAN backups the datafile using it's own naming convention(format command)

e.g. datafile users_01.dbf can not be backed up as users_01.dbf in backup destination.

Is there a way to do that and also would incremental backup be possible using the same approach.

I will appreciate any response.

Thanks,

Anil Goel. 



Get a FREE Web site, company branded e-mail and more from Microsoft Office Live! --
//www.freelists.org/webpage/oracle-l



--
Best Regards,
Syed Jaffar Hussain
Oracle ACE
8i,9i & 10g OCP DBA

http://jaffardba.blogspot.com/

http://www.oracle.com/technology/community/oracle_ace/ace1.html#hussain
----------------------------------------------------------------------------------

"Winners don't do different things. They do things differently."



The average US Credit Score is 675. The cost to see yours: $0 by Experian. -- //www.freelists.org/webpage/oracle-l

Other related posts: