Sunteți pe pagina 1din 7

Configuring for Rman:

Rman target:
Rman> show all; (it will show all configuration data)
Rman> show device type;
Rman>show maxsetsize;
Rman>show retention policy;
Rman> configure default device type to disk;
Rman> configure default device type to sbt;
Rman> configure device type disk parallelism 2; (parallel it will take 2 backups)
Rman> configure channel 1 device type disk format /d01//./backup_%U;
Rman> configure channel 2 device type disk format /d02//./backup_%U;
Rman> configure channel 1 device type disk maxpiecesize 100m;
Rman>Configure maxsetsize to 7500k
Rman>Configure maxsetsize clear;
Rman>Configure channel 1 device type disk clear;
Rman>Configuredatafile backup copies for device type disk to 2;
Rman>Configure snapshot controlfile name to /d01//.;
Rman>Configurebackup optimization on;
Rman>Configure controlfile autobackup on;
Rman>Configure retention policy to redundancy 3;
Giving tag name to the backup:
Rman> Backup database tag=DB_BACKUP;
Set max size to take backup:
Rman> backup database maxsetsize=100m tag=db_backup;
Rman> backup database keep forever;
Rman> backup database keep until time =sysdate+time;
Rman> backup database noexclude keep forever tag= db_backup;
Validate database backup after backup:
Rman> backup validate database tag=db_backup;
Skipping readonly datafile when db backup:
Rman> backup database skip readonly;
Rman> backup database skip offline;
Rman> backup database skip inaccessible;
Rman> backup database skip readonly skip offline skip inaccessible;
Forcing a backup of readonly datafile:
Rman> backup database force;
Backup only newly added datafile:
Rman> backup database not backedup;
Rman> backup database not backedup since time=. Sysdate = ..;
Checking for logical corruption during backup:
Rman> backup check logical database;
Rman> backup validate check logical database;
Taking copies of backup:
Rman> backup database copies=2;
Taking backup into devices;
Rman> backup database device type disk;
Rman> backup database device type sbt;
Backup database with current control file also:
Rman> backup database device type disk include current controlfile;
Backup database with archivelogs (Hot backup):
Rman> backup database plus archivelog;
Taking tablespace backup:
Rman> backup tablespace tbs_name;
Rman> backup tablespace tbs_name plus archivelog;
Rman> backup tablespace tbs_name include current controlfile;
Taking particular datafile backup:
Rman> backup datafile 2;
Rman> backup datafile path of datafile;
Rman> backup datafile plus archivelog;
Taking backup of archivelogs:
Rman> backup archivelog all;
Rman> backup archivelog from time sysdate -1;
Rman> backup archivelog from sequence 223(no);
Rman> backup archivelog all delete input;
Rman> backup archivelog from sequence 223 delete input;
Rman> backup archivelog not backed up 3 times;
Backup of current controlfile:
Rman> backup current controlfile;
Backupsets:
Rman> backup backupset all;
Rman> copy datafile 3 to path;
Rman>copy datafile to .;
Rman> backup datafile copy .. delete input;
Rman>Copy current controlfile to .;
Incremental backups:
Rman>backup incremental level=0 database;
Rman>backup incremental level=2 cumulative database;
Rman>backup incremental level=0 tablespace tbs_name;
Rman>backup incremental level=2 tablespace tbs_name;
Rman>backup incremental level=0 datafile no;
Rman>backup incremental level=3 datafile no;
Rman>backup incremental level=0 database plus archivelog;
Restore & Recovery (in mount state only):
Rman> restore spfile to pfile ..Path;
Rman> restore controlfile from autobackup;
Rman> restore controlfile from autobackup max seq 200 max days 100;
Rman> restore database;
Rman> recover database;
Rman> sql alter database open resetlogs;
Rman>> sql startup nomount;
Rman> set DBID =enter database id;
Rman> restore controlfile from autobackup;
Rman> alter database mount;
Rman> restore database;
Rman> recover database;
Rman> sql alter database open resetlogs;
Recover of tablespace:
Rman>sql alter tablespace users offline;
Rman> restore tablespace users;
Rman> recover tablespace users;
Rman> sql alter tablespace users online;
Recover of datafile:
Rman> sql alter database datafile 3 offline;
Rman> restore datafile 3;
Rman> recover datafile 3;
Rman> sql alter database datafile 3 online;
Point to recover:
Rman>Set untiltime to_date(date:time,dd/mm/yy hh:mm:ss);
Rman> restore database;
Rman> recover database;
Rman> sql alter database open resetlogs;
SCN BASED RECOVERY:
Rman>sql startup mount;
Rman> restore database until scn 125680;
Rman> recover database until scn 125680;
Rman> sql alter database open resetlogs;
Log sequenced based Recovery:
Rman> sql startup mount ;
Rman> restore database until sequence 233 thread 1;
Rman> recover database until sequence 233 thread 1;
Rman> sql alter database open resetlogs;
Readonly tablespace Recovery:
Rman> restore database check readonly;
Archive Redo logs restores & Recovery:
Rman> restore archivelog all;
Rman scripts looks like this:
rman target internal/kernel@prod1 rcvcat rman/rman@rcat
RMAN> run {
allocate channel c1 type disk;
copy datafile 5 to `/u01/backup/prod1/prod1_tab7.dbf';
}
Backup to media
Rman>run {
allocate channel t1 type `SBT_TAPE';
backup
format `df_%s_%t'
(datafile 10);
}

Creating and running stored scripts:
RMAN>replace script script1 {
allocate channel c1 type disk;
backup full filesperset 3
(database format %p%d.%s);
}
In order to run a stored script, you must use the execute script command, as

RMAN> run {
execute script script1;
}

S-ar putea să vă placă și