Operating System - HP-UX
1751712 Members
5569 Online
108781 Solutions
New Discussion юеВ

Re: Hot backups with fbackup

 
SOLVED
Go to solution
Randy Hagedorn
Regular Advisor

Hot backups with fbackup

Hi:
I found on Oracle Metallink that you cannot do a hot backup with fbackup because it loses inodes changes that occur during a backup.

Why do some of you tell me that fbackup is working for them while the Oracle datafiles are in backup mode?
Are your datafiles being accessed while your backup is running?

Thanks,

Dewy
16 REPLIES 16
Martin Johnson
Honored Contributor

Re: Hot backups with fbackup

We use oracle to dump the data prior to using fbackup to backup the data. Trying to backup the data directly using fbackup usually results in corrupted data.

HTH
Marty
Juan Gonz├бlez
Trusted Contributor

Re: Hot backups with fbackup

Hi Dewy,
AFAIK once the datafiles are in backup mode you can do the backup of these files with whatever tool: cp, dd, fbackup, ...

Could you write down the link within Metalink?

Best regards,
Juan
Jeanine Kone
Trusted Contributor

Re: Hot backups with fbackup

I have said that we were able to use fbackup for hot backups. We did do them in the middle of the night, so I doubt that anyone was actually using the data at the time. We are not using it right now because we found other problems with fbackup that we have not yet been able to fix while backing up large files.
R. Allan Hicks
Trusted Contributor

Re: Hot backups with fbackup

This perhaps more detail than what the others have said, but it's basically the same thing so no points are expected.

I have been using fbackup for about 5 years from Oracle 7.3.x to 8.1.6. I have also successfully recovered databases using fbackup tapes.

We do things alittle differently in that I put the tablespace into hotbackup and copy and compress the datafiles to another volumne. That volume is copied with fbackup.

When a tablespace is placed into hot backup mode, it is basically frozen and all updates that dbwr would send to the datafiles are sent to the redo log files instead. This keeps the datafile from changing. Should you try to backup a file without it being in hot backup mode, then you are correct you will get a corrupt backup. (I've done it).

The reason we do ours during low activity is that you are filling your redo logs more quickly in hot backup mode because more information go into to them.

From my notes on the backup and recovery workshop (which I highly recommend. It's one of the best oracle classes ever) Pages 4-16 and 17....

1. Put tablespace into backup mode

alter tablespace yourspacehere begin backup;

2. In unix,
cp /users/disk1/users01.dbf /users/backup/user01.dbf

3. alter tablespace yourspacehere end backup;

4. force a checkpoint to synchronize all of the headers with

alter system switch logfile;


I like the disk to disk copy because it's faster than disc to tape and I don't want the tablespaces in hot backup mode any longer than necessary. I also like to compress the file so I don't have to change tapes.

I'd like to see the metalink doc id too.

Oracle has made some improvements to RMAN under 9i and I plan to look into that more and possibly give up my fbackup scheme.
"Only he who attempts the absurd is capable of achieving the impossible
Yogeeraj_1
Honored Contributor

Re: Hot backups with fbackup

Hi,

The best way is to use Oracle Recovery Manager (RMAN). Do your backups to disk then use fbackup if you wish to sent the files to tape.

RMAN has lots of parameters that you may wish to customise for your own environment.

RMAN is the future in Oracle Backup.

We do only hot backups using RMAN.

Hope this helps!

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Juan Gonz├бlez
Trusted Contributor

Re: Hot backups with fbackup

Hi again,
I've done some research and I find in Metalink what Dewy said:

Literally from Metalink:

**Can't HOT backup - fbackup loses inodes changes that occur during a backup

frecover -s causes sparse files causes paging for >1GB files

I understand the problem with frecover -s. Oracle datafiles can't be sparse files. Speaking quickly, a sparse file is a file where unused blocks doesn't use space on the filesystem, just a mark on the inode.

And from fbackup(1M):
Due to present file-system limitations, files whose inode data, but not their contents, are modified while a backup is in progress might be omitted from the next incremental backup of the same graph. Also, fbackup does not reset the inode change times of files to their original values.

I am not sure how this can affect the fbackup of the datafiles. When a datafile is turned on backup mode, Oracle still access the datafile, I supossed that only to read, so the inode has to be changed to reflect the change in the access time field. I don't know whether other field in the inode is changed.

fbackup first read the inode information and then the file's content, but i don't why is this a problem with a hot backup...

Indeed, I find more information about fbackup of datafiles, mostly from forums, and some of them afirm that they have no problems with fbackup.

Fortunately I use rman :-)

Best regards,
Juan
Simeon Fox
Advisor

Re: Hot backups with fbackup

Please note - oracle datafiles are NOT frozen when in hot backup mode. This is a common misconception. It is only the headers that are frozen. Oracle can write to the datafiles as they are being backed up, and hence fbackup cannot be used for the initial copy. I use "cp" to transfer the datafiles to a different disk, and apply fbackup to the copied and therefore "cold" files. I believe "tar" can be used to transfer directly to a backup device.

It is the freezing of the file headers that is the key to the hot backup mechanism. When restoring, the archive logs are applied from the start of the backup, leaving the restored file in a consistent state.
Juan Gonz├бlez
Trusted Contributor

Re: Hot backups with fbackup

Ok, so what makes the difference between cp and fbackup? If the datafile is being writen why can i use cp or tar but not fbackup?

Best regards
Juan
Simeon Fox
Advisor

Re: Hot backups with fbackup

Juan - the unix gurus might have a technical explanation. What I know is that fbackup may refuse to copy a file that is being written to (with fbackup(3007): WARNING: File number nnnn was active), making several attempts and eventually rejecting. Whereas tar and cp will copy the file without objecting. And the oracle recovery mechanism takes care of the inconsistent or "fuzzy" state of the copied file as explained above. ie fbackup is not guaranteed to actually copy the file so can't be used for a hot backup.


Regards
SMF