これは InterSystems FAQ サイトの記事です。
こちらの記事では、非ミラー環境にミラー環境でオンラインバックアップしたバックアップファイルをリストアする方法をご紹介します。
手順は大きく分けて2つになります。
1.バックアップファイルからリストアを行う
以下は、^DBREST ユーティリティによる対話形式のリストア方法になります。
%SYS>do ^DBREST
Cache DBREST Utility
Restore database directories from a backup archive
Restore: 1. All directories
2. Selected and/or renamed directories
3. Display backup volume information
4. Exit the restore program
1 => 2 // <-- <Enter> ミラー環境でバックアップしたバックアップファイルを、ミラー環境ではない環境にリストアする場合は、2 を選択する必要があります
// ※『1. All directories』を選択した場合、リストア対象はミラーデータベースのみになるため、ミラーでなければリストアはされません
Do you want to set switch 10 so that other processes will be
prevented from running during the restore? Yes => // <-- <Enter>
// Yes の場合、リストア中に他のプロセスがグローバルデータにアクセスできないように制御するスイッチ10を設定します。
Specify input file for volume 1 of backup 1
(Type STOP to exit)
Device: C:\Backup\FullDBList_20250402_001.cbk // <-- バックアップファイルパス
This backup volume was created by:
IRIS for Windows (x86-64) 2024.1
The volume label contains:
Volume number 1
Volume backup APR 2 2025 09:50AM Full
Previous backup DEC 23 2024 12:21PM Full
Last FULL backup DEC 23 2024 12:21PM
Description Full backup of all databases that are in the backup database list.
Buffer Count 0
Mirror name TESTMIRROR
Failover Member MACHINEA
Is this the backup you want to start restoring? Yes => // <-- <Enter>
Restoring a mirror backup but this system is not a mirror member
For each database included in the backup file, you can:
-- press RETURN to restore it to its original directory;
-- type X, then press RETURN to skip it and not restore it at all.
-- type a different directory name. It will be restored to the directory
you specify. (If you specify a directory that already contains a
database, the data it contains will be lost).
c:\intersystems\iris\mgr\mirrordata\ (:mirror:TESTMIRROR:MIRRORDATA) => // <-- 同じで良ければ <Enter>
Directory c:\intersystems\iris\mgr\mirrordata\ does not contain a database
or it can't be accessed.
Do you want to create this database? Yes => // <-- <Enter> IRIS.datがないときは作成する
Do you want to change this list of directories? No => // <-- <Enter>
Restore will overwrite the data in the old database. Confirm Restore? No => y // <-- y+<Enter>
***Restoring c:\intersystems\iris\mgr\mirrordata\ at 10:22:10
84 blocks restored in 0.0 seconds for this pass, 84 total restored.
***Restoring c:\intersystems\iris\mgr\mirrordata\ at 10:22:10
2 blocks restored in 0.0 seconds for this pass, 86 total restored.
***Restoring c:\intersystems\iris\mgr\mirrordata\ at 10:22:10
2 blocks restored in 0.0 seconds for this pass, 88 total restored.
Specify input file for volume 1 of backup following APR 2 2025 09:50AM
(Type STOP to exit)
Device: STOP <-- STOP+<Enter>
Do you have any more backups to restore? Yes => N // <-- 他になければ N+<Enter>
Mounting c:\intersystems\iris\mgr\mirrordata\ which is a mirrored DB
c:\intersystems\iris\mgr\mirrordata\ ... (Mounted)
There are mirrored DBs restored, please make sure the mirror
journal files are copied to a specific directory in order to
let system restore the journal records.
Please enter the directory contains the mirror journal files:
<C:\InterSystems\IRIS\mgr\journal\>? // <-- 特になければ <Enter>
*** WARNING **** Failed to restore the journal records for the mirrored DBs
// バックアップからリストアした後、さらに現時点のDBまでミラージャーナルファイルを使用してキャッチアップするかどうかの選択
// バックアップ時点までで良ければ、そのまま<Enter>するとディレクトリ内にリストア対象のミラージャーナルがないため、上記Warningが出てリストアは終了する
%SYS>
2.データベースファイルのミラー属性を削除する
ミラー環境で取得したバックアップを、非ミラー環境にリストアすると、そのままではDB書き込みができません。
これは、リストアされたデータベースは、読み取り専用でマウントされるためです。
(ミラーデータベースについては、別ミラー環境やミラー構成でない環境にリストアすると読み取り専用になります)
この為、リストア完了後に以下の操作にてデータベースファイルのミラー属性を削除する必要があります。
手順は、以下のようになります。
%SYS>do ^MIRROR
This instance is not initialized as a mirror member
1) List mirrored databases
2) Remove one or more mirrored databases
3) Create a Mirror
4) Join Mirror as Failover Member // ミラーが有効になっている場合、この設定が表示されます
5) Join Mirror as Async Member // ミラーが有効になっている場合、この設定が表示されます
Option? 2 // Mirror DBからMirror 属性を削除します
There are xxx mirrored databases on this system
Remove (O)ne mirrored database, (A)ll mirrored databases or (Q)uit? <quit> A // A + <Enter> すべてのMirror DBを対象とします
// ミラーDBが1つしかないときは以下のようになります。Yでミラー属性を削除します
// There is one mirrored database on this system
// Remove it? <No> // Y + <Enter>
Removing c:\intersystems\iris\mgr\mirrordata\ ...succeeded
:
Press <enter> to return to the main menu... // <Enter> で抜けます
1) List mirrored databases
2) Remove one or more mirrored databases
3) Enable Mirror Service
:
Option?
%SYS>
これで、リストアは完了です。
詳細は以下のドキュメントをご覧ください。
ミラーリングされたデータベースのフルバックアップ・リストア