Wednesday, 25 March 2009

How does one backup and restore archived log files?

One can backup archived log files using RMAN or any operating system backup utility.

Remember to delete files after backing them up to prevent the archive log directory from filling up.

If the archive log directory becomes full,your database will hang! Look at this simple RMAN backup script:

RMAN> run {
2> allocate channel dev1 type disk;
3> backup
4> format '/app/oracle/archback/log_%t_%sp%p'
5> (archivelog all delete input);
6> release channel dev1;
7> }

The "delete input" clause will delete the archived logs as they as backed-up.

Here is a restore example:

RMAN> run {
2> allocate channel dev1 type disk;
3> restore (archivelog low logseq 78311 high logseq 78340 thread 1 all);
4> release channel dev1;
5> }

No comments:

Post a Comment