免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1065 | 回复: 1
打印 上一主题 下一主题

请教关于数据库的备份问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-08-18 19:17 |只看该作者 |倒序浏览
先介绍一下系统的基本情况
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);
}

论坛徽章:
0
2 [报告]
发表于 2004-08-22 10:01 |只看该作者

请教关于数据库的备份问题

有没有略懂一二的人?
说说有哪些可能性,导致问题的存在?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP