0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DB2 同一インスタンスのデータベースから取得したバックアップを別のデータベースへリストアする

Posted at

背景

  • アクティブログを消してしまったらしく(!)db2 activate sample_dbができない状況に陥る
  • 単純にリストアしようとするものの、各種パス指定などを書き換える必要がある

解決策

  • リストアのスクリプトを自動生成し、パスを書き換えることが可能

解決策(今回やらなかった方法)

  • db2lookでDDL作成
    • db2look -createdb -printcfg -l -x -e -o output_file_name
      • CREATE DATABASE文でDDL作成
      • CFGも出力(UPDATE文)
      • -l 表領域定義など
      • -x GRANTなど
      • -e SQLとして作成
      • -o eオプションと一緒に使うとouput_file_name.sqlとして出力される

あとがき

ログは安易に消さないようにしようね。
自動生成されるの便利。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?