Informix IDS 11零碎管理(918测验)认证指南,第6部分:IDS备份和光复(7)

光复号令和语法

OnBar 光复号令和语法

清单 16. OnBar 光复号令和语法

                    
$onbar -r       # Full dbspace restore (salvages logs automatically). 
                # Parallel restore.(unless BAR_MAX_BACKUP is set to 1).
		# To speed up restores, you can add additional CPU virtual processors.
		# In a warm restore, the -r option restores all down storage spaces and logical
		# logs, and skips online storage spaces. A down storage space means it is offline
		# or a chunk in it is inconsistent.
$onbar -r -p    # physical-only dbspace restore (no log salvage). 
		Can be used to setup a secondary server for an HDR pair.
$onbar -r dbspaces  # restore dbspaces from a system backup.
		# Restore particular storage spaces (for example, a dbspaces named fin_dbspace1 
		# and fin_dbspace2)$onbar -r fin_dbspace1 fin_dbspace2.
		# You can also specify the storage spaces to restore by listing them in a text 
		# file and passing the pathname of the file to OnBar with the -f option.
$onbar -r -t time # point-in-time restore onbar -r -t time.


执行全零碎光复(IDS)

全零碎光复必需是冷光复,并且它必需光复完整绝对存储空间。全零碎光复不必要光复逻辑日记。全零碎光复必要全零碎备份。然则,可以用全零碎备份执行普通的光复。如果运用 onbar -b -w 执行全零碎备份,那么可以运用以下任何号令执行光复:

清单 17. OnBar 全零碎光复号令和语法

                    
onbar -r -w         # whole-system restore (salvages logs automatically)
onbar -r -p -w      # physical-only whole-system restore (no log salvage)
onbar -r            # parallel restore of the whole-system backup
onbar -r dbspaces   # restore dbspaces from a whole-system backup
onbar -r -t time    # point-in-time restore
onbar -r -t time -w # whole-system point-in-time restore


如果运用 onbar -r -p -w,在光复完成时,数据库供职器就处于快速光复形式。再执行逻辑光复(onbar -r -l)或运用 onmode -m 让数据库供职器进入在线形式。 细致:从 11.10 版本入部动手,OnBar 全零碎备份和光复举动爆发了转变。

将数据光复到某个工夫点

OnBar 支持光复到工夫点(-t 选项)或光复到特定的日记号(-n 选项)。指定工夫点光复的举动是在 OnBar 号令中包含 -t 选项。

工夫点光复必需是冷光复。

示例:执行冷工夫点光复:

要想将数据库供职器的数据光复到特定日期和工夫的形态,应该输出下面如许的号令,其中运用您的 GLS 地区的日期和工夫格局:

onbar -r -t "2004-05-10 11:35:57"

在这个示例中,光复进程会从头使用在指定的工夫之前提交的事变,包含在 11:35:57 提交的任何事变。在 11:35:57 还未提交的事变被回滚。

日记点光复

日记点光复是一种不凡的工夫点光复。在日记点光复中,必需光复完整绝对存储空间,如许数据才华僵持不合性。如果在指定的日记后面另有任何日记,OnBar 不会光复它们,它们的数据会丧掉。

示例:

onbar -r -n 1522 (这里的 1522 是日记的分心 id)

从比拟旧的备份执行光复

在默许景遇下,OnBar 会光复最新的备份。如果不断顿光复这个备份(譬喻,由于这个备份没有经由历程检验,或许备份介质丧掉了),那么可以从更旧的备份执行光复。要想从比拟旧的备份执行物理工夫点光复,应该运用以下号令。

清单 18. 从比拟旧的备份执行光复

                    
Find the time of the older backup in the message log or OnBar activity log
or from the storage manager.
To restore all or specific storage spaces, issue the following commands:
onbar -r -p -t time [dbspaces_from_older_backup] 
onbar -r -p [remaining_dbspaces]
onbar -r -l


运用以下号令执行逻辑光复。

清单 19. 分阶段执行冷光复

                    
   1. Optionally, salvage the logical logs manually:
	onbar -b -l -s
   2. Perform a physical restore:
	onbar -r -p
   3. Perform a logical restore:
	onbar -r -l


Ontape 光复号令和语法

在运用 ontape 时,除了后面会商的重定名选项之外,还要细致以下选项。

清单 20. Ontape 光复号令选项

                    
ontape -r  	# Full system restore.  
ontape -p	# Physical restore only and intended for a secondary setup in HDR pair.
ontape -p -e   	# External ontape restore.


在执行 ontape -r 号令时,会提醒您挂载 0 级备份磁带,您必要从这里光复。挂载这个磁带并按回车键之后,ontape 将读取磁带头,并显露备份磁带的相关信息和它包含的 dbspace。

要光复的 dbspace 的完整绝对块途径名、大小和偏移量必需在供职器上存在。

在光复完成之前,会讯问可否停顿备份磁盘上确当前日记。备份磁盘上当前的日记称为逻辑日记接济。如果回覆 y,就会提醒您挂载一个磁带来备份日记。

在供职器处理完 0 级备份磁带之后,它会讯问可否停顿光复 1 级或 2 级备份。回覆 yn,并依据必要挂载要光复的下一个磁带。

着末,讯问可否停顿光复任何逻辑日记。如果要光复逻辑日记(如果停顿将零碎光复到迩来的事变之后的形态,就必需这么做),那么回覆 y。挂载逻辑日记磁带并鄙人一个提醒中按 return。

向前回滚日记文件之后,光复进程完成,零碎进入在线形式。

如果不光复逻辑日记,那么光复进程在完成物理光复之后就终晓畅,应该能够发出 onmode -m 号令,让数据库供职器进入在线形式。

关于 ontape 光复的要点:

  • 使用的光复观点与 OnBar 光复相同(物理、逻辑、冷、热和混淆光复)。
  • ontape 备份老是按次的全零碎备份。
  • ontape 光复不必要逻辑光复。
  • 固然还不克不及用 ontape 备份特定的 dbspace,然则 ontape 赞成经由历程热光复光复特定的 dbspace。




版权声明: 原创作品,赞成转载,转载时请务必以超链接体式格局标明文章 原始出处 、作者信息和本声明。否则将清查法则责任。

原文地址:https://www.cnblogs.com/zgqjymx/p/1973014.html