Thursday, 7 April 2011

RMAN Hands On

Summary :

This hands on practice is organized into 4 chapters
  • CATALOG
  • ADMINISTRATION
  • BACKUP
  • RESTORE AND RECOVERY

RMAN Check List
This check list provides a quick overview of items that are important to consider when working with RMAN

  • Define a backup retention policy
  • Setup CONTROLFILE AUTOBACKUP ON
  • Setup ARCHIVELOG DELETION POLICY to a number of ‘backed up’ times that satisfy your recovery needs
  • Generate logs of backup jobs and monitor them for errors
  • Execute periodically administrative scripts to clean up the backup repository from obsolete and expired backups
  • Use a Flash Recovery Area to maintain an online staging area of your last backups. That will enable fast restore and recovery in case of need
  • Use a change tracking file and incremental backups that satisfy your recovery needs.
  • Prepare and test a complete set of recovery scenarios and train the DBA team on them, they should include at least the following scenarios:
- System Tablespace loss
- Online Redolog loss
- Controlfile loss
- Data Tablespace loss
- Single/multiple datafile loss
- Archived log sequences loss- Block corruptions recovery
- Total loss (database)
- Total loss (server = database/software/parameter files)

The Hands-On Environment
· 11g RDBMS software
· 11g ASM storage configured with 2 disk groups:
§ DATADG, for the databases, and
§ FRADG, for the flash recovery area, for storing some of the backups and
   for archived log destination.
· 1 catalog database
· 1 test database
· 1 file system for storing other backups outside ASM

Two general setup scripts are used to set the environment, they are run from within most other scripts.

#!/usr/bin/tcsh
# set-environment
setenv ORACLE_HOME /oradisk/oracle/app/product/11.1.0/db_1
setenv PATH $ORACLE_HOME/bin:/usr/local/bin:/usr/bin:/bin
setenv rmanuser rman # the rman catalog owner
setenv rmanpwd cat # the rman catalog owner password
setenv dbauser sys # the dba user
setenv dbapwd oracle # the dba user password
setenv rmandb rmancat # the rman catalog database
setenv datadb redpanda # the test database
clear
echo
# eof script


-- sqlenv.sql
set echo off head off feed off
alter session set nls_date_format='dd/mm/yy hh24:mi:ss';
set pages 50000 lines 120 echo on head on veri on time on ti on
-- eof script



CATALOG

This chapter show how to create the Rman catalog, how to register a database with it and how to review some of the information contained in the catalog.

The Catalog chapter covers the following topics:
1-set-catalog
2-create-catalog
3-register-database
4-verify-registration
5-manual-backup-registration
6-create-scripts
7-export-catalog
8-query-catalog
9-get-catalog-version
10-upgrade-catalog
11-unregister-database
12-drop-catalog


ADMINISTRATION
This chapter show how execute the most common administrative tasks within rman. They are important in order to maintain a catalog that reflects the real backups we have.
Maintaining a clean updated catalog will help to simplify restore operations.

The Administration chapter cover the following topics:
1-crosscheck
2-list
3-report
4-delete

BACKUP
Rman provides numerous and flexible ways to backup a database or parts of a database, in this chapter a few of the several options are shown.

The following scripts are part of this chapter:
0-make-io
1-change_tracking
2-backup-backupset-compressed
3-backup-as-copy
4-incremental-backup-and-tags
5-backup-plus-archived-logs
6-backup-controlfile
7-incremental-for-backup-recover
8-incremental-for-quick-recover


RECOVERY
Restore and recovery are the critical ends of the Backup and Recovery policies, in this chapter we simulate critical failures and we execute the restore and recovery using the backups implemented on the previous chapter.

The following scenarios are implemented:
1-system-tablespace-loss //////1b-recover-system-tablespace
2-user-datafile-loss ///// ///////2b-recover-users-tablespace
3-online-redo-loss //////////////3b-recover-from-redo-loss
4-controlfile-loss ////////////////4b-recover-from-controlfile-loss
5-database-loss /////////////////5b-recover-from-total-loss


No comments:

Post a Comment