Operating System - Linux
1756316 Members
3638 Online
108845 Solutions
New Discussion юеВ

Online Oracle backups using LVM snapshots

 
Adam Garsha
Valued Contributor

Online Oracle backups using LVM snapshots

Does anyone use LVM snapshots to grab online backups of their Oracle databases on Linux? Any hang-ups on Linux?

Would this work?:


For each tablespace in my database {
put the tablespace in backup-mode
}

Create a snapshot of the entire "data" filesystem and mount it

For each tablespace in my database {
take the tablespace out of backup-mode
}

Copy all files from snapshot mount point to the "backup" mount point
Unmount and remove the snapshot


Do you have an example script that I could look at for particulars?:

Oracle says this: "Oracle will stop updating file headers, but will continue to write data to the database files even if a tablespace is in backup mode."

Still ok to use filesystem snapshots, correct? Since the Oracle recovery mechanism should handle the possibility of partially written blocks?

Thanks for any input.
3 REPLIES 3
Bill Thorsteinson
Honored Contributor

Re: Online Oracle backups using LVM snapshots

If you are putting the tablespace in
backup mode you don't need a snapshot.
Oracle will recover all transactions
from the time you set the tablespace in
backup mode.

The database needs to be in archivelog mode.
For recovery you need all logs archived
from the beginning of the backup. I
would suggest forcing a log switch shortly
after completing the backup.

The attached file is a modified oraback.sh
script which does our backups.
Adam Garsha
Valued Contributor

Re: Online Oracle backups using LVM snapshots

Sounds like transactional integrity will be safe, but what about block-level integrity?
Adam Garsha
Valued Contributor

Re: Online Oracle backups using LVM snapshots

This gives me the warm fuzzy feeling I was looking for:

In backup mode, Oracle will write out complete changed blocks to the redo log files. Normally only deltas (changes) are logged to the redo logs. This is done to enable reconstruction of a block if only half of it was backed up (split blocks). Because of this, one should notice increased log activity and archiving during on-line backups.