Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN help
On Wed, 10 May 2006 15:53:15 -0700, newbie wrote:
> Do I restore cold backup of Sunday and then start to roll forward with
> rman backup of monday, tuesday, wednesday and thursday?
First of all, in addition to backing up database, it is advisable to back
up archived redo logs. Second, the commands to perform recovery is
extremely complicated:
rman target=/ nocatalog
rman> recover database;
In order to work comfortably, you should configure some defaults, like this:
RMAN> show all
2> ;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/orabck/backup/ctrl%F.ctl';
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
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 '/data/orabck/backup/dbs%U.bak';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/10g/dbs/snapcf_10G.f'; # default
Then, you can simply do backup, like this: RMAN> backup database;
Starting backup at 10-MAY-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=53 devtype=DISK channel ORA_DISK_1: starting compressed full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/oracle/ORACLE/datafile/o1_mf_system_22scjjbr_.dbf input datafile fno=00003 name=/oradata/oracle/ORACLE/datafile/o1_mf_sysaux_22sckr51_.dbf input datafile fno=00002 name=/oradata/oracle/ORACLE/datafile/o1_mf_undotbs1_22sckkxo_.dbfinput datafile fno=00004 name=/oradata/oracle/ORACLE/datafile/o1_mf_users_22sclhpz_.dbf input datafile fno=00005 name=/oradata/oracle/ORACLE/datafile/o1_mf_indx_230blkrf_.dbf channel ORA_DISK_1: starting piece 1 at 10-MAY-06 channel ORA_DISK_1: finished piece 1 at 10-MAY-06 piece handle=/data/orabck/backup/dbs06hiod9b_1_1.bak tag=TAG20060510T203554 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56 Finished backup at 10-MAY-06
Starting Control File and SPFILE Autobackup at 10-MAY-06 piece handle=/data/orabck/backup/ctrlc-1459558253-20060510-00.ctl comment=NONE Finished Control File and SPFILE Autobackup at 10-MAY-06
RMAN> After that, you can backup your archived logs, by doing something similar to this:
RMAN> backup archivelog all delete input;
Starting backup at 10-MAY-06
current log archived
using channel ORA_DISK_1
skipping archive log file /data/orabck/arch/arch1_34_586480813.arch; already backed up 1 time(s)
channel ORA_DISK_1: starting compressed archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=35 recid=2 stamp=589780290 input archive log thread=1 sequence=36 recid=3 stamp=589930196 input archive log thread=1 sequence=37 recid=4 stamp=590099990channel ORA_DISK_1: starting piece 1 at 10-MAY-06 channel ORA_DISK_1: finished piece 1 at 10-MAY-06 piece handle=/data/orabck/backup/dbs08hiodgn_1_1.bak tag=TAG20060510T203950 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:17 channel ORA_DISK_1: deleting archive log(s)
archive log filename=/data/orabck/arch/arch1_35_586480813.arch recid=2 stamp=589780290 archive log filename=/data/orabck/arch/arch1_36_586480813.arch recid=3 stamp=589930196 archive log filename=/data/orabck/arch/arch1_37_586480813.arch recid=4 stamp=590099990channel ORA_DISK_1: deleting archive log(s) archive log filename=/data/orabck/arch/arch1_34_586480813.arch recid=1 stamp=589684378 Finished backup at 10-MAY-06
Starting Control File and SPFILE Autobackup at 10-MAY-06 piece handle=/data/orabck/backup/ctrlc-1459558253-20060510-01.ctl comment=NONE Finished Control File and SPFILE Autobackup at 10-MAY-06
RMAN> And, at the end, if you don't really love Seagate enough to keep buying their excellent products over and over again, you should clean up:
RMAN> delete force obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle -------------------- ------ ------------------ -------------------- Backup Set 1 05-MAY-06 Backup Piece 1 05-MAY-06 /data/orabck/backup/dbs02hibg8c_1_1.bak Backup Set 2 05-MAY-06 Backup Piece 2 05-MAY-06 /data/orabck/backup/ctrlc-1459558253-20060505-00.ctl Backup Set 3 06-MAY-06 Backup Piece 3 06-MAY-06 /data/orabck/backup/dbs04hibnkr_1_1.bak Backup Set 4 06-MAY-06 Backup Piece 4 06-MAY-06 /data/orabck/backup/ctrlc-1459558253-20060506-00.ctl Backup Set 6 10-MAY-06 Backup Piece 6 10-MAY-06 /data/orabck/backup/ctrlc-1459558253-20060510-00.ctl
Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece
backup piece handle=/data/orabck/backup/dbs02hibg8c_1_1.bak recid=1 stamp=589676813
deleted backup piece
backup piece handle=/data/orabck/backup/ctrlc-1459558253-20060505-00.ctl recid=2 stamp=589676870
deleted backup piece
backup piece handle=/data/orabck/backup/dbs04hibnkr_1_1.bak recid=3 stamp=589684380
deleted backup piece
backup piece handle=/data/orabck/backup/ctrlc-1459558253-20060506-00.ctl recid=4 stamp=589684388
deleted backup piece
backup piece handle=/data/orabck/backup/ctrlc-1459558253-20060510-00.ctl recid=6 stamp=590099812
Deleted 5 objects
RMAN> This concludes our RMAN session for today. There is a gentleman by the name Robert Freeman who is a karate master and in addition to that has written the best RMAN book on the market. Rob's book can be found in any bookshop deserving that name.
-- http://www.mgogala.comReceived on Wed May 10 2006 - 19:47:40 CDT
![]() |
![]() |