Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90333950
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: DB2/Informix

2008-05-31 17:21:49

监视和调试备份和恢复过程

在使用 ontape 时,只能监视控制台和日志消息。

OnBar 实用程序为监视和调试备份和恢复操作提供了更多选项。可以监视 BAR_ACT_LOG 和 BAR_DEBUG_LOG 指定的日志,还可以设置其他配置参数。

BAR_PERFORMANCE

这个新特性可以报告 OnBar 备份和恢复的性能。可以使用新的配置参数 BAR_PERFORMANCE 设置写入 OnBar 活动日志的报告级别。可以让报告包含 OnBar 活动的次秒级(sub-second)时间戳,OnBar 和存储管理器以及 OnBar 和 IDS 实例之间的传输速率。

要想显示 IDS 实例和存储管理器之间传输数据花费的时间,就将这个参数设置为 1。

要想显示次秒级精度的时间戳,就将这个参数设置为 2。

要想同时显示时间戳和传输统计数据,就将这个参数设置为 3。

BAR_PROGRESS_FREQ

以分钟为单位指定备份或恢复消息在活动日志中出现的频率。

在调试 OnBar 的问题时,最有价值的工具是 BAR_ACT_LOG 和 BAR_DEBUG_LOG。将 BAR_DEBUG 设置为 9,就会开始跟踪 OnBar 和 XBSA 调用,并在 BAR_DEBUG_LOG 生成消息,可以使用这些消息了解哪些调用失败了,或者返回遇到的错误。

可以以 ontape(Standalone)和 onbar(Integrated)模式使用 archecker 实用程序:

  • 检验备份
  • 执行表级恢复
  • 从存档中提取特定的页面

archecker 实用程序无法检查逻辑日志备份。archecker 实用程序不执行恢复。

设置 archecker 并不复杂,但是需要创建一个 archecker 配置文件:

  • 这个文件包含 archecker 需要的所有设置。
  • 默认的文件名是 $INFORMIXDIR/etc/ac_config.std。
  • 如果不使用默认的 archecker 配置文件,那么将环境变量 AC_CONFIG 设置为指向 archecker 配置文件的文件名(完整或相对路径名)。
  • archecker 用户必须对 AC_CONFIG 文件有读权限。
  • 文件中的参数如下(括号中是默认值):
    • AC_STORAGE —— 临时存储的路径(/tmp)。如果没有指定 AC_STORAGE,默认目录是当前目录
    • AC_MSGPATH —— 消息日志的文件名(/tmp/ac_msg.log)
    • AC_VERBOSE —— 详细输出 [默认情况下关闭](0)
    • AC_CLEANUP —— 清除以前运行 archecker 产生的旧信息(0)
    • AC_TAPEDEV —— 磁带设备的路径(onconfig:TAPEDEV;无默认值)
    • AC_TAPEBLOCK —— 磁带的块大小(对于 ontape,onconfig:TAPEBLK;无默认值)。对于 OnBar,要达到最大 bar 传输大小,在 2k 页面系统上 AC_TAPEBLOCK 是 62,在 4k 页面系统上是 60。
    • AC_IXBAR —— 在使用 OnBar 时使用。
    • AC_SCHEMA —— 用于表级恢复(不使用 -f)

运行 archecker 的步骤如下:

  1. 设置 ac_config 文件中的参数。
  2. 导出环境变量 AC_CONFIG。
  3. 在 standalone 模式中执行 archecker -tvs 命令,检查 ontape 存档。如果使用 OnBar,可以执行命令 archecker -bvs 或使用 onbar -v

应该会看到下面这样的输出。



                    
Program Name:   archecker
Version:        8.0
Released:       2007-04-19 23:00:58
CSDK:           IBM Informix CSDK Version 2.91
ESQL:           IBM Informix-ESQL Version 2.91.UN220
Compiled:       04/19/07 23:01  on SunOS 5.9 Generic_118558-28

AC_STORAGE               /space/products/v11.Beta.6/arch_storage
AC_MSGPATH               /home/informix/ac_msg.log
AC_VERBOSE               on
AC_TAPEDEV               /space/TAPE/v11backup/
AC_TAPEBLOCK             32 KB
AC_LTAPEDEV              /space/TAPE/v11backup/
AC_LTAPEBLOCK            32 KB
AC_TIMEOUT               300
AC_SESSION
Archive file /space/TAPE/v11backup/blazer_110_L0
Tape type:      Archive Backup Tape
OnLine version: IBM Informix Dynamic Server Version 11.10.UB6TL
Archive date:   Sun May  6 15:29:41 2007
Archive level:  0
Tape blocksize:  32768
Tape size:  2147483647
Tape number in series:  1

Scan PASSED
Control page checks PASSED
Reserve page validation PASSED
Checking rootdbs:TBLSpace

Checking sysmaster:sysdatabases

Checking sysmaster:systables
.......
.......     

Table checks PASSED
Tables/Fragments validated:     293
Archive Validation PASSED.

ontape 和 OnBar 都支持外部备份和恢复。

在操作系统级执行数据备份的方法如下:

  • UNIX 命令:
    • cpio
    • tar
    • dd
  • 文件系统快照
  • 第三镜像终止
  • 存储管理器 “原始” 备份

在外部备份期间,必须使用 onmode -c block 命令阻塞数据库服务器。OnBar 和 ontape 的外部备份/恢复特性都支持逻辑复原。

优点

  • 可用性和速度。可以更快地备份和恢复数据,让数据更快地变为可用。
  • 可以保存相同数据的多个拷贝。
  • 能够复制原始物理设备。
  • 如果与 ontape 或 OnBar 外部恢复结合使用,就可以执行逻辑恢复。

缺点

  • 第三镜像终止或其他解决方案有额外的开销。
  • IDS 不对外部备份执行介质跟踪。



                    

To set up ISM to run on UNIX, follow these steps:
	
	1.  Log in as informix to the machine where your engine is installed. 
	Set up your environment to use the engine.
	
	2.  Create a directory in which to store the savesets for logical log backup.
	This step is only needed if you want to be able to save storage spaces
	or logical logs to files.
	
	3.  In the ONCONFIG configuration file of the engine, 
	specify the volume pool names for storage spaces and logical logs
	by adding the following:
	
	
	ISM_DATA_POOL    datapool
	ISM_LOG_POOL     logpool
	
	
	datapool
	If you are going to archiving your storage spaces to tape devices
	then use the value ISMData here.
	
	If you are going to archiving your storage spaces to files
	then use the value ISMDiskData here.
	
	logpool
	If you are going to be backing up your logical logs to tape devices
	then use the value ISMLogs here.
	
	If you are going to be backing up your logical logs to files
	then use the value ISMDiskLogs here.
	
	
	Example:
	
	These parameters are for a system where devices will be used
	to archive storage spaces but the logical logs will be backed up to files.
		
	ISM_DATA_POOL    ISMData
	ISM_LOG_POOL     ISMDiskLogs
	
	4.  Set the LTAPEDEV parameter in the ONCONFIG file
	to anything but /dev/null.
	
	5.  Log in as root.  Set up your environment to use the engine.
	
	6.  From the command line type:
	
	ism_startup -init
	
	
	7.  Add user informix as an administrator by using
	the ism_add command with the following syntax:
	
	
	ism_add -admin informix@machine_name
	
	
	machine_name
	Host machine name. The name should be the fully qualified name for the machine
	of which include the domain name. 
	
	
	8.   Add the storage devices to the ISM server by using the
	ism_add command with the following syntax:
	
         ism_add -device device_name -type Media_type_name

        device_name
	Full path to the device.
	
	media_type_name
	Type of media used by the storage device.
	Check ISM user guide for list of valid devices.

	Example:
	
	This command adds an 8mm DAT as a storage device.
	The device is located at /dev/rmt/0mn in the file system.

	ism_add -device /dev/rmt/0mn -type 8mm
	
	This command adds the directory /tmp/logfiles.bak as a storage device.
	ism_add -device /tmp/logfiles.bak -type file

	9.  Label the devices by using the ism_op command with this syntax:

	ism_op -label device_name -volume volume_name 
	 -pool pool_name

	device_name
	Full path name to the device.
	
	pool_name
	The name of the volume pool to which the storage volume will belong. 
	You must assign at least one device to each volume pool that you used in step 3.

	volume_name
	Volume name. Any descriptive name for this volume. 
	
	
	Examples:
	
	This command labels the device /dev/rmt/0mn with a volume name of ISMData
	and puts it in the pool ISMData.
	
	ism_op -label /dev/rmt/0mn -pool 
	ISMData -volume ISMData
	
	This command labels the directory /tmp/logfiles.bak with a volume name
	of ISMLogs and puts it in the pool ISMDiskLogs.
	
	ism_op -label /tmp/logfiles.bak -pool 
	ISMDiskLogs -volume ISMLogs 
	
	
	10.  Mount the devices by using ism_op command with this syntax: 
	
	
	ism_op -mount device_name
	
	device_name
	Full path name to the device.
	
	Example:
	To mount the device /dev/rmt/0mn use this command:
	
	ism_op -mount /dev/rmt/0mn 
	
	To mount the device /tmp/logfiles.bak use this command:
	
	
	ism_op -mount /tmp/logfiles.bak
	
	
	The set up is complete. Test the backup and restore using onBar commands.
				

现在,您应该已经掌握了本教程讨论的内容:

  • 建立恢复策略和备份计划所需的概念(包括全系统备份、dbspace 备份、顺序备份、并行备份、逻辑日志备份、冷恢复、热恢复、混合恢复、物理恢复、逻辑恢复和时间点恢复)。
  • IDS 备份和恢复实用程序及其功能(OnBar、ontape、archecker 和 ISM)。
  • 备份和恢复实用程序的配置参数和文件,以及存储设备选项和需求。
  • OnBar 备份和恢复的性能优化和监视方法,以及诊断存档问题所需的调试日志。
  • 执行备份、恢复、存档检验和 ISM 设置所需的命令。
阅读(1947) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~