{AJS運用}付録B.1 システムログを使用しない運用でのバックアップとリカバリー

  • 物理ホスト

 


(1) 確認用データ作成

export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtadd -a mmm184 -c 00:00-00:00=5
/opt/jp1ajs2/bin/ajsagtshow -l

/opt/jp1ajs2/bin/ajsprint -F AJSROOT1 -s yes "/*"

/opt/jp1ajs2/bin/ajsleave -F AJSROOT1 /jg1/jobnet1
/opt/jp1ajs2/bin/ajsentry -F AJSROOT1 -n /jg1/jobnet1
/opt/jp1ajs2/bin/ajsshow -F AJSROOT1 -R /jg1/jobnet1

 

(2) バックアップファイルの取得

1.JP1/AJS3サービス停止

/opt/jp1ajs2/bin/jajs_spmd_stop
/opt/jp1ajs2/bin/jajs_spmd_status

2.組み込みDB起動
/opt/jp1ajs2/tools/ajsembdbidlist
/opt/jp1ajs2/tools/ajsembdbstart -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0

3.バックアップファイル取得

mkdir -p /root/dbbackup
/opt/jp1ajs2/tools/ajsembdbbackup -d /var/opt/jp1ajs2/embdb/_JF0/dbarea/ajssys02 -b /root/dbbackup -id _JF0
ls -ltr /root/dbbackup

/opt/jp1ajs2/tools/ajsembdbstatus -c -id _JF0 > /root/dbbackup/_JF0_`date "+%Y%m%d_%H%M%S"`.txt
cat /root/dbbackup/_JF0_*.txt


4.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbidlist
/opt/jp1ajs2/tools/ajsembdbstop -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0


5.JP1/AJSサービス起動
/opt/jp1ajs2/bin/jajs_spmd
/opt/jp1ajs2/bin/jajs_spmd_status

 


(3) バックアップ取得後のデータ追加
export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtadd -a mmm185 -c 00:00-00:00=5
/opt/jp1ajs2/bin/ajsagtshow -l

 


(4) データベースの回復

1.JP1/AJS3サービス停止

/opt/jp1ajs2/bin/jajs_spmd_stop
/opt/jp1ajs2/bin/jajs_spmd_status


2.データベース環境を削除


/opt/jp1ajs2/tools/ajsembdbunset -e -id _JF0


3.データベース環境を再構築
/opt/jp1ajs2/tools/ajsembdbbuild -s -d /var/opt/jp1ajs2/embdb/_JF0/dbarea -p 22220 -id _JF0


4.スケジューラーデータベースをセットアップ

/opt/jp1ajs2/tools/ajsembdbsetup -F AJSROOT1 -ru s -id _JF0

 


5.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0

6.システム領域を回復するモードで組み込みDBを起動

/opt/jp1ajs2/tools/ajsembdbstart -r -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0


7.system領域を回復
/opt/jp1ajs2/tools/ajsembdbrstr -M -d /var/opt/jp1ajs2/embdb/_JF0/dbarea/ajssys02 -bf /root/dbbackup/BACK_MST_201911232017.bk -e /root -id _JF0

8.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0

9.組み込みDB起動
/opt/jp1ajs2/tools/ajsembdbstart -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0


10.スケジューラーデータベースの回復
/opt/jp1ajs2/tools/ajsembdbrstr -d /var/opt/jp1ajs2/embdb/_JF0/dbarea/ajssys02 -bf /root/dbbackup/BACK_MST_201911232017.bk -e /root -id _JF0

11.バックアップファイル取得
mkdir -p /root/dbbackup
/opt/jp1ajs2/tools/ajsembdbbackup -d /var/opt/jp1ajs2/embdb/_JF0/dbarea/ajssys02 -b /root/dbbackup -id _JF0
ls -ltr /root/dbbackup

/opt/jp1ajs2/tools/ajsembdbstatus -c -id _JF0 > /root/dbbackup/_JF0_`date "+%Y%m%d_%H%M%S"`.txt
cat /root/dbbackup/_JF0_*.txt

 

12.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF0
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF0


13.JP1/AJSサービス起動
/opt/jp1ajs2/bin/jajs_spmd
/opt/jp1ajs2/bin/jajs_spmd_status

 

(5) 回復後の確認
export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtshow -l
/opt/jp1ajs2/bin/ajsprint -F AJSROOT1 -s yes "/*"
/opt/jp1ajs2/bin/ajsshow -F AJSROOT1 -R /jg1/jobnet1

→アンロードログを使用しないの場合
バックアップ取得後に追加したデータは消失

/opt/jp1ajs2/bin/ajsleave -F AJSROOT1 /jg1/jobnet1
/opt/jp1ajs2/bin/ajsentry -F AJSROOT1 -n /jg1/jobnet1
/opt/jp1ajs2/bin/ajsshow -F AJSROOT1 -R /jg1/jobnet1

 

 

  • 論理ホスト


(1) 確認用データ作成

export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtadd -h mmm190 -a mmm195 -c 00:00-00:00=5
/opt/jp1ajs2/bin/ajsagtshow -h mmm190 -l

/opt/jp1ajs2/bin/ajsprint -F AJS3SCHEDULE001 -s yes "/*"

/opt/jp1ajs2/bin/ajsleave -F AJS3SCHEDULE001 /jg1/jobnet1
/opt/jp1ajs2/bin/ajsentry -F AJS3SCHEDULE001 -n /jg1/jobnet1
/opt/jp1ajs2/bin/ajsshow -F AJS3SCHEDULE001 -R /jg1/jobnet1

 

(2) バックアップファイルの取得

1.JP1/AJS3サービス停止

/etc/opt/jp1ajs2/jajs_stop.cluster mmm190
/opt/jp1ajs2/bin/jajs_spmd_status -h mmm190

2.組み込みDB起動
/opt/jp1ajs2/tools/ajsembdbidlist
/opt/jp1ajs2/tools/ajsembdbstart -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1

3.バックアップファイル取得

mkdir -p /mnt/sdc2/dbbackup
/opt/jp1ajs2/tools/ajsembdbbackup -d /mnt/sdc2/jp1ajs/jp1ajs2/embdb/_JF1/dbarea/ajssys02 -b /mnt/sdc2/dbbackup -id _JF1
ls -ltr /mnt/sdc2/dbbackup

/opt/jp1ajs2/tools/ajsembdbstatus -c -id _JF1 > /mnt/sdc2/dbbackup/_JF1_`date "+%Y%m%d_%H%M%S"`.txt
cat /mnt/sdc2/dbbackup/_JF1_*.txt


4.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbidlist
/opt/jp1ajs2/tools/ajsembdbstop -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1


5.JP1/AJSサービス起動
/etc/opt/jp1ajs2/jajs_start.cluster mmm190
/opt/jp1ajs2/bin/jajs_spmd_status -h mmm190

 


(3) バックアップ取得後のデータ追加

export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtadd -h mmm190 -a mmm196 -c 00:00-00:00=5
/opt/jp1ajs2/bin/ajsagtshow -h mmm190 -l

 

(4) データベースの回復

1.JP1/AJS3サービス停止

/etc/opt/jp1ajs2/jajs_stop.cluster mmm190
/opt/jp1ajs2/bin/jajs_spmd_status -h mmm190


2.データベース環境を削除


/opt/jp1ajs2/tools/ajsembdbunset -e -id _JF1


3.データベース環境を再構築
/opt/jp1ajs2/tools/ajsembdbbuild -s -r -d /mnt/sdc2/jp1ajs/jp1ajs2/embdb/_JF1/dbarea -ld /opt/jp1ajs2/embdb/_JF1/dbarea \
-mh mmm190 -eh mmm191 -p 22201 -i /opt/jp1ajs2/embdb/_JF1 -ext_db -ext_log -id _JF1


4.スケジューラーデータベースをセットアップ

/opt/jp1ajs2/tools/ajsembdbsetup -mh mmm190 -F AJS3SCHEDULE001 -p 22201 -ru s -id _JF1

 


5.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1

6.システム領域を回復するモードで組み込みDBを起動

/opt/jp1ajs2/tools/ajsembdbstart -r -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1


7.system領域を回復
/opt/jp1ajs2/tools/ajsembdbrstr -M -d /mnt/sdc2/jp1ajs/jp1ajs2/embdb/_JF1/dbarea/ajssys02 -bf /mnt/sdc2/dbbackup/BACK_MST_201911232337.bk -e /mnt/sdc2 -id _JF1


8.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1

9.組み込みDB起動
/opt/jp1ajs2/tools/ajsembdbstart -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1


10.スケジューラーデータベースの回復
/opt/jp1ajs2/tools/ajsembdbrstr -d /mnt/sdc2/jp1ajs/jp1ajs2/embdb/_JF1/dbarea/ajssys02 -bf /mnt/sdc2/dbbackup/BACK_MST_201911232337.bk -e /mnt/sdc2 -id _JF1

11.バックアップファイル取得

mkdir -p /mnt/sdc2/dbbackup
/opt/jp1ajs2/tools/ajsembdbbackup -d /mnt/sdc2/jp1ajs/jp1ajs2/embdb/_JF1/dbarea/ajssys02 -b /mnt/sdc2/dbbackup -id _JF1
ls -ltr /mnt/sdc2/dbbackup

/opt/jp1ajs2/tools/ajsembdbstatus -c -id _JF1 > /mnt/sdc2/dbbackup/_JF1_`date "+%Y%m%d_%H%M%S"`.txt
cat /mnt/sdc2/dbbackup/_JF1_*.txt

 

12.組み込みDB停止
/opt/jp1ajs2/tools/ajsembdbstop -id _JF1
/opt/jp1ajs2/tools/ajsembdbstatus -s ust -id _JF1


13.JP1/AJSサービス起動
/etc/opt/jp1ajs2/jajs_start.cluster mmm190
/opt/jp1ajs2/bin/jajs_spmd_status -h mmm190

 

(5) 回復後の確認
export JP1_USERNAME=jp1admin
/opt/jp1ajs2/bin/ajsagtshow -h mmm190 -l
/opt/jp1ajs2/bin/ajsprint -F AJS3SCHEDULE001 -s yes "/*"
/opt/jp1ajs2/bin/ajsshow -F AJS3SCHEDULE001 -R /jg1/jobnet1

→アンロードログを使用しないの場合
バックアップ取得後に追加したデータは消失

/opt/jp1ajs2/bin/ajsleave -F AJS3SCHEDULE001 /jg1/jobnet1
/opt/jp1ajs2/bin/ajsentry -F AJS3SCHEDULE001 -n /jg1/jobnet1
/opt/jp1ajs2/bin/ajsshow -F AJS3SCHEDULE001 -R /jg1/jobnet1