- 论坛徽章:
- 0
|
先介绍一下系统的基本情况
1.两台集群SUN4800服务器,RAC oracle
2.每天凌晨利用Veritas软件对数据库进行全备份。
3。磁带机为L20
以前数据库备份正常,但是最近把磁带机那去修理后,备份几天工作正常。
但是现在的情况是,每次快备份到Veriats软件自已要备份的时候,就退出。
导致arch1,arch2的目录不自动清除!
本人在这方面也不太懂,如果哪介紹还不太清楚,希望大侠们指出!
附上每次调用的脚本语句。看看也没有错误!
hot_database_backup.sh
# $Header: hot_database_backup_level1_differential.rcv,v 1.5 2000/02/17 21:40:12 integ Exp $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2000 VERITAS Software Corporation, All Rights Reserved $ *
#***************************************************************************
#ecpyrght
#
# ---------------------------------------------------------------------------
# hot_database_backup_level1_differential.rcv
# ---------------------------------------------------------------------------
#
# Backs up only the blocks which have been modified since the last
# level 0 backup was performed. (note, the controlfile is always backed
# up in it's entirety i.e. control file backups are never compressed).
#
# Typically, a level 1 backup would be done at least once in between
# level 0 backups.
#
# The scenario assumes:
# o you want to perform a differential level 1 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 already have valid backups of read-only tablespaces, and
# offline datafiles so we skip backing up these files
# o you want the backup to continue if any files are inaccessible.
# o you are not using a Recovery Catalog
# o you want to archive the current log and then back up all the
# archive logs, putting a maximum of 20 logs in a backup set and
# deleting them once the backup is complete.
# 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 hot_database_backup_level1_differential.rcv
#
# ---------------------------------------------------------------------------
connect target / ;
run {
# Hot database level 1 differential incremental backup
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
backup
incremental level 1
skip offline
skip readonly
skip inaccessible
tag hot_db_bk_level1_cum
filesperset 5
# recommended format
format 'bk_%s_%p_%t'
(database);
sql 'alter system archive log current';
# backup all archive logs
backup
filesperset 20
format 'al_%s_%p_%t'
(archivelog from time 'sysdate-1' thread 1
delete input);
}
hot_database_backup_level1_differential.rcv
# $Header: hot_database_backup_level1_differential.rcv,v 1.5 2000/02/17 21:40:12 integ Exp $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2000 VERITAS Software Corporation, All Rights Reserved $ *
#***************************************************************************
#ecpyrght
#
# ---------------------------------------------------------------------------
# hot_database_backup_level1_differential.rcv
# ---------------------------------------------------------------------------
#
# Backs up only the blocks which have been modified since the last
# level 0 backup was performed. (note, the controlfile is always backed
# up in it's entirety i.e. control file backups are never compressed).
#
# Typically, a level 1 backup would be done at least once in between
# level 0 backups.
#
# The scenario assumes:
# o you want to perform a differential level 1 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 already have valid backups of read-only tablespaces, and
# offline datafiles so we skip backing up these files
# o you want the backup to continue if any files are inaccessible.
# o you are not using a Recovery Catalog
# o you want to archive the current log and then back up all the
# archive logs, putting a maximum of 20 logs in a backup set and
# deleting them once the backup is complete.
# 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 hot_database_backup_level1_differential.rcv
#
# ---------------------------------------------------------------------------
connect target / ;
run {
# Hot database level 1 differential incremental backup
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
backup
incremental level 1
skip offline
skip readonly
skip inaccessible
tag hot_db_bk_level1_cum
filesperset 5
# recommended format
format 'bk_%s_%p_%t'
(database);
sql 'alter system archive log current';
# backup all archive logs
backup
filesperset 20
format 'al_%s_%p_%t'
(archivelog from time 'sysdate-1' thread 1
delete input);
}
hot_database_backup_level0.rcv
# $Header: hot_database_backup_level0.rcv,v 1.5 2000/02/17 21:40:06 integ Exp $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2000 VERITAS Software Corporation, All Rights Reserved $ *
#***************************************************************************
#ecpyrght
#
# ---------------------------------------------------------------------------
# hot_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 continue if any files are inaccessible.
# o you are not using a Recovery Catalog
# o you want to archive the current log and then back up all the
# archive logs, putting a maximum of 20 logs in a backup set and
# deleting them once the backup is complete.
# 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 hot_database_backup_level0.rcv
#
# ---------------------------------------------------------------------------
#connect target 'sys/';
connect target /;
run {
# Hot database level 0 whole backup
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
backup
incremental level 0
skip inaccessible
tag hot_db_bk_level0
filesperset 5
# recommended format
format 'bk_%s_%p_%t'
(database );
sql 'alter system archive log current';
# backup all archive logs
backup
filesperset 20
format 'al_%s_%p_%t'
(archivelog all
delete input);
release channel t1;
release channel t2;
}
hot_database_backup_level1_cumulative.rcv
# $Header: hot_database_backup_level1_cumulative.rcv,v 1.5 2000/02/17 21:40:09 integ Exp $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2000 VERITAS Software Corporation, All Rights Reserved $ *
#***************************************************************************
#ecpyrght
#
# ---------------------------------------------------------------------------
# hot_database_backup_level1_cumulative.rcv
# ---------------------------------------------------------------------------
#
# Backs up only the blocks which have been modified since the last
# level 0 backup was performed. (note, the controlfile is always backed
# up in it's entirety i.e. control file backups are never compressed).
#
# Typically, a level 1 backup would be done at least once in between
# level 0 backups.
#
# The scenario assumes:
# o you want to perform a cumulative level 1 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 already have valid backups of read-only tablespaces, and
# offline datafiles so we skip backing up these files
# o you want the backup to continue if any files are inaccessible.
# o you are not using a Recovery Catalog
# o you want to archive the current log and then back up all the
# archive logs, putting a maximum of 20 logs in a backup set and
# deleting them once the backup is complete.
# 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 hot_database_backup_level1_cumulative.rcv
#
# ---------------------------------------------------------------------------
connect target 'internal/oracle@productionDB'
run {
# Hot database level 1 cumulative incremental backup
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
backup
incremental level 1
cumulative
skip offline
skip readonly
skip inaccessible
tag hot_db_bk_level1_cum
filesperset 5
# recommended format
format 'bk_%s_%p_%t'
(database);
sql 'alter system archive log current';
# backup all archive logs
backup
filesperset 20
format 'al_%s_%p_%t'
(archivelog all
delete input);
} |
|