RMAN Cold level0 backup

posted Sep 17, 2010, 8:11 AM by Sachchida Ojha   [ updated Sep 17, 2010, 8:14 AM ]
# $Header: cold_database_backup_level0.rcv,v 1.5 2000/02/17 21:39:45 integ Exp $
# ---------------------------------------------------------------------------
#               cold_database_backup_level0.rcv
# ---------------------------------------------------------------------------
#
#  Backs up the whole database.  This backup is part of the incremental
#  strategy (this means it can have incremental backups of levels > 0
#  applied to it).
#
#  We do not need to explicitly request the control file to be included
#  in this backup, as it is automatically included each time file 1 of
#  the system tablespace is backed up (the inference: as it is a whole
#  database backup, file 1 of the system tablespace will be backed up,
#  hence the controlfile will also be included automatically).
#
#  Typically, a level 0 backup would be done at least once a week.
#
#  The scenario assumes:
#     o you want to perform a level 0 backup
#     o you are backing your database up to two tape drives
#     o you want each backup set to include a maximum of 5 files
#     o you wish to include offline datafiles, and read-only tablespaces,
#       in the backup
#     o you want the backup to terminate if any files are not
#       accessible
#     o you want to open the database after the backup completes
#     o you are not using a Recovery Catalog
#     o you are using a TNS alias name for the target database
#
#  Note that the format string is constructed to guarantee uniqueness and
#  to enhance NetBackup for Oracle backup and restore performance.
#
#  The connect statements could be part of the rman command line in the
#  Oracle script file that calls this script. They were put here so that
#  the passwords could be protected by setting file permissions to only
#  allow the Oracle dba access.
#
#  Add the following connect statement if using a Recovery Catalog.
#      connect rcvcat '<user>/<passwd>@<TNS alias>'
#
#  Modify the target connect statement according to the following syntax:
#      connect target '<user>/<passwd>@<TNS alias>'
#
#  Script run by:
#      rman nocatalog cmdfile cold_database_backup_level0.rcv
#
# ---------------------------------------------------------------------------

connect target internal/oracle
connect rcvcat rman/rman@admindb

run {
# Cold database level 0 backup
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
allocate channel t3 type 'SBT_TAPE';
allocate channel t4 type 'SBT_TAPE';
backup
  incremental level 0
  tag cold_db_bk_level0
  filesperset 5
  # Recommended format
  format 'bk_%s_%p_%t'
    (database);

# now that the backup is complete, open the db.
sql 'alter database open';
}

Comments