Thursday, April 16, 2009

RMAN BACKUPS

RMAN BACKUPS
CH # 11
Backup of Control file
RMAN> Backup current controlfile tag=Sunday
RMAN> Backup device type disk tablespace users include current controlfile;
RMAN> Backup datafile 2 include current controlfile;
RMAN> Backup current control file;
Backup Piece Size
RMAN> Run {
Allocate channel c1 type disk
Maxpiecesize= 4G;
Backup
Format =’c:\backup\df_%t_%s_%p’ filesperset 2
(tablespace users );}
The Backup Command
RMAN> Backup
Format =’c:\backup\df_%d_%s_%p.bus’
Database filesperset = 3;
Parallelization of Backup Sets
(Multiple channels working for multi files)
RMAN> Run {
Allocate channel c1 type disk;
Allocate channel c2 type disk;
Allocate channel c3 type disk;
Backup database
Format =’c:\backup\df_%d_%s_p.bak’
(datafile 1,2,3 channel c1 tag=DF1)
(datafile 4,5,6 channel c2 tag=DF1)
(datafile 7,8,9 channel c3 tag=DF1)
Sql ‘ alter system archive log current’; }

Duplexed Backup Sets
RMAN> Backup copies 2 datafile 1,2
Format =’c:\backup\%U’,’d:\backup\%U’;
Backup of Backupset
RMAN> Backup backupset 1
Archived Redo Log File Backup
RMAN> Run {
Allocate channel c1 device type disk ;
Backup archivelog
Sequence between 31 and 40 thread 1
Delete input ;}
First select sequence number from v$archived_log view;
RMAN> Backup archivelog all
RMAN> Backup archivelog all not backed up 2 times
RMAN> Backup archivelog all from scn=1 until scn=20;
RMAN> Backup
Format =’c:\backup\ar_%t_%s_%p’
Archivelog all delete all input;
Image Copy (1 by 1 relationship means each file will be copied separatly )
RMAN> Copy
Datafile ‘c:\oracle\oradata\orcl\users01.dbf’ to ‘c:\backup\users01.dbf’
Archivelog ‘c:\oracle\ora92\rdbms\arch_001.arc’ to ‘c:\backup\arch_01.arc’
RMAN> Copy
Datafile 1 to ‘c:\backup\file1.dbf’,
Datafile 2 to ‘c:\backup\file2.dbf’
Image Copy Parallelization (Multiple server process will write multifiles at same time)
RMAN> Configure device type disk parallelism 4 ; (if not configure )
RMAN> Copy (3 files copied in parallel means 3 server process write parallel)
Datafile 1 to ‘c:\backup\df1.dbf’,
Datafile 2 to ‘c:\backup\df2.dbf’,
Datafile 3 to ‘c:\backup\df3.dbf’;
RMAN> Copy (second copy command will write by 4th server process in single form)
Datafile 4 to ‘c:\backup\df4.dbf’;

Copying the whole database
RMAN> Startup mount
RMAN> Report schema;
RMAN> Copy datafile1 to ‘c:\backup\df1.cpy’,
Datafile 2 to ‘c:\backup\df2.cpy’, etc…
RMAN> List copy
Incremental Backups (according to company policy of backup)
RMAN> Backup incremental level 0 database;
RMAN> Backup incremental level 3 database;
RMAN> Backup incremental level 3 database;
RMAN> Backup incremental level 3 database;
RMAN> Backup incremental level 3 database;
RMAN> Backup incremental level 3 database;
RMAN> Backup incremental level 2 database;
Cumulative backup
RMAN> Backup incremental level 2 cumulative database;
Backing up the SPfile
RMAN> Backup copies 2 device type disk spfile;

No comments: