RMAN
RMAN
COM RMAN What is Rman Why use Rman Understanding The Rman Architecture Taking Backup in Non archive Backup Mode Taking Backup in archive Mode Enhancement in 10g For Rman 9i Enhancement For Rman Other Commands for Rman Conclusion
What is Rman?
Recovery Manager is a tool that manages the process of creating backup and also manages the process of restoring and recovering them. In addition to RMAN repository records, the recovery catalog can also hold RMAN stored scripts, sequences of RMAN commands for common backup tasks. Centralized storage of scripts in recovery catalog can be more convenient than working with command files
CPISOLUTION.COM
Backups in Rman
Oracle backup in RMAN are the following type RMAN complete backup RMAN incremental backup These backup are of RMAN proprietary nature
Image copy
The advantage of image copy is it is not in RMAN proprietary format
BackupFormat
RMAN backup is not in oracle format but in RMAN format. Oracle backup comprises of backup sets and consists of backup peices Backup sets are logical entity In Oracle 9i it gets stored in default locations There are two type of backup sets Datafile backup sets, Archivelog Backup sets One more important point of data file backup sets is it donot include empty blocks, A backup set will contain many backup pieces A single backup piece consists of physical files which are in RMAN proprietary format.
Backups in Rman
Oracle Backup in RMAN are thefollowingtype Backup complete backup ; Image Copy Backup Format Example of Using Backup Using Rman..
CPISOLUTION.COM
Taking RMAN backup In non archive mode in dos prompt type RMAN - You get the RMAN prompt RMAN > Connect Target Connect to target database : Magic < Dbid= 129283912> Using target database controlfile instead of recovery catalog
Restoring Database
Restoring database has been made very simple in 9i . It is just restore database. Rman is intelligent to identify which dataifiles has to be restored and the locations of backed up file.
Oracle Enhancement for Rman in 10g Flash Recovery Area Incrementally Updated Backups Faster Incremental Backups SWITCH DATABASE COMMAND. Binary Compression Global Scripting Duration Clause Configure This Oracle Enhancement for Rman in 10g Automatic Channel Failover Compress Backup Sets Recovery Through Reset Logs Cross Backup Sets Flash Backup and Recovery Area With ever decreasing cost of disk in the market place ,disk based backups are more feasible. A The major advantage of flash backup and recovery area is once when the hard disk gets filled Automatically obslete backups are deleted reducing the need of DBA to do such tasks. Or backups whose archive logs have been already been backed up are automatically deleted
The flash Recovery area notifies the administrator when the disk space
CPISOLUTION.COM consumption is nearing the defined quota and there is no more files to purge. Incrementally Updated Backups
You can apply incremental backups to your datafile image copies when you use the RMAN. This takes much less time then performing a full image copy of datafiles every day. This is applied through two phases. Apply the incremental backup to datafile image copies .This is done at database block level. Then apply the archive logs since the last incremental backup only .This is done at transaction level (Slower than previous phase) Below you can see the example of incrementally updated Backups Backup incremental level 0 tag = weekly database; -- This takes a full database backup . The remaining days .. The below script works which creates a incremental backup (Note the speed of incremental backup could be increased by using block change tracking file which is mentioned below ) and the recover copy with tag weekly database is used to add the incremental to the full backup . Backup incremental level 1 For recover of copy With tag weekly database; Recover copy of database With tag weekly;
Global Scripting
RMAN> print script full_backup to file 'my_script_file.txt' Oracle Database 10g provides a new concept of global scripts, which you can execute against any database registered in the recovery catalog, as long as your RMAN client is connected to the recovery catalog and a target database simultaneously.
CPISOLUTION.COM
RMAN> create global script global_full_backup { backup database plus archivelog; delete obsolete; delete global script full_backup; List Script Names; Run { Execute Global Script global_backup_db;} Global RMAN Scripts
Duration Clause
BACKUP DURATION 4:00 PARTIAL MINIMIZE TIME DATABASE FILESPERSET 1; You can limit the time the backup is going to takeplace by this command
Compressed BackupSets
Backup as compressed backupset database; Note that only backupsets can be compressed ( eg database,tablespace and datafile backups) Specially image copies cannot be compressed.
Rman > configure device type disk backup type to compressed backupset; Binary compression technique reduces backup space usage 50-75 % Recoverey Through ResetLogs Prior to Oracle Database 10g it is recommended practice to make a full database backup following resetlogs. This is no longer required since backup can be used before resetlogs.
Oracle 9i New Features Persistent Rman Configuration Configure This Configure Retention Policty To Recovery Window of 5 days
CPISOLUTION.COM
Retention Policy determines the length of time a backup is retained for use in a potential restore. A recovery window is a period of time that begins with the current time and extends backward in time to point of recoverability.
Trial Recovery
You can determine the outcome of a recovery before actually doing it for real by appending the work "test" to any recover command. The following command will
CPISOLUTION.COM cause Oracle to perform a dry-run of a recovery without actually changing any data: SQL> recover database until cancel test; Oracle Enterprise Manager
has also been configured in such a manner that it makes it easy to manage all rman backups and restore operations. It has buttons for quick crosschecks, showing current backups, implementing fast recovery ,changing basic rman configuration ,etc Archive Log Failover Archive log failover allows RMAN can take advantage of multiple archive logs destinations such that, if a corrupt log is detected it can read the log from the alternate destination Obselete Delete obselete; will delete all obselege backups. Expired are those backups which donot exist in the media.
Observation
Introduced in Oracle 8i it has become more powerful and simpler with the newer version of Oracle9 and Oracle 10g .. So if you really dont want to miss something critical please start using RMAN. Paul Johny Ocp 8 8i 9i 10g DBA WWW.CPISOLUTOIN.COM