Thursday, April 16, 2009

BACKUP USING RMAN

BACKUP USING RMAN
CH # 9

To connect RMAN type c:\rman target sys/oracle
Automatic channel allocation
RMAN> Configure default device type to disk or sbt;
RMAN> Configure device type to disk parallelism 3 (3 server process will be started)
RMAN> Configure channel device type disk
Format =’c:\backup\%U’; (Backup destination is set now)
RMAN> Configure channel device type disk
Maxpiecesize 2G; ( the size of a piece is 2G in a set)
Manual Channel Allocation
RMAN> Run {
2> Allocate channel c1 type disk
3> Format =’c:\backup\users01.bak’
4> Backup datafile ‘c:\oracle\oradata\orcl\users01.dbf’;}

Backing up a tablespace

RMAN> Backup tablespace system ;
Backing up Archived logs
RMAN> Backup archivelog all
RMAN> Backup archivelog all delete input( Current destination archive file will be
backed up and delete)
RMAN> Backup archivelog all delete all input(All archivefiles backed up and delete)
RMAN> List backup (To check backup detail)
RMAN> Restore database validate (to check that backup is valid or not)
Additional RMAN Command Line Arguments
First Create a notepad file like:
Backup database;
Save this file with script.rcv .
Now run this file on command line like:
C:\ rman target sys/oracle@’c:\backup\script.rcv log=logfile.log
JOB COMMAND
RMAN> RUN {
Backup
Incremental level 0
Format =’c:\backup\%d_%s_%p’
Filesperset 2
(database include current controlfile);
Sql ‘ alter database archive log current’;}
SIMPLE backup command
RMAN> Backup database
RMAN> Backup datafile
Use LIST command to check database and datafiles .
RMAN> List backup of database;
RMAN> List backup of datafile 4;
RMAN> List copy of tablespace “SYSTEM”
RMAN> List expired backup
RMAN> List backup summary
RMAN> List backup by File
RMAN> List backupset 1
REPORT COMMAND
RMAN> Report schema
RMAN> Report obsolete (which backup can be deleted)
RMAN> Report need backup incremental 3 database ;
RMAN> Report need backup days 3 tablespace system;(what system files have not been
backed up for three days)
Mirror backup in RMAN
RMAN> RUN {
Set backup copies 2;
Backup database
Format =’c:\backup\%U’,’d:\backup\%U’;}

No comments: