中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

DB2_PureScale備份與恢復是怎樣的

發布時間:2021-11-30 10:36:36 來源:億速云 閱讀:173 作者:柒染 欄目:數據庫

DB2_PureScale備份與恢復是怎樣的,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

執行在線備份
db2 backup database sampledb online to /gpfs1nsd/backup include logs
db2 list history backup all for sampledb

數據庫創建測試表,并插入數據
db2 "create table test1 (name varchar(32))"
db2 "insert into test1 values ('Jack')"

檢查表空間狀態
db2 list tablespaces | grep State

restore數據庫
db2 list active databases
db2inst1@psnode1:/gpfs1nsd/backup>  db2 restore database sampledb from /gpfs1nsd/backup taken at 20170117141422
SQL2539W  The specified name of the backup image to restore is the same as the
name of the target database.  Restoring to an existing database that is the
same as the backup image database will cause the current database to be
overwritten by the backup version.
Do you want to continue ? (y/n) y
DB20000I  The RESTORE DATABASE command completed successfully.

數據庫前滾
db2inst1@psnode1:/gpfs1nsd/backup> db2 rollforward db sampledb query status

                                Rollforward Status

Input database alias                   = sampledb
Number of members have returned status = 2

Member ID    Rollforward                 Next log             Log files processed        Last committed transaction
             status                      to be read
-----------  --------------------------  -------------------  -------------------------  --------------------------
          0  DB  pending                 S0000000.LOG                     -              2017-01-17-06.14.26.000000 UTC
          1  DB  pending                 S0000000.LOG                     -              2017-01-17-06.14.26.000000 UTC

db2inst1@psnode1:/gpfs1nsd/backup> db2 list utilities show detail
SQL1611W  No data was returned by Database System Monitor.  SQLSTATE=00000
db2inst1@psnode1:/gpfs1nsd/backup> db2 rollforward db sampledb to end of logs and stop

                                Rollforward Status

Input database alias                   = sampledb
Number of members have returned status = 2

Member ID    Rollforward                 Next log             Log files processed        Last committed transaction
             status                      to be read
-----------  --------------------------  -------------------  -------------------------  --------------------------
          0  not pending                                      S0000000.LOG-S0000000.LOG  2017-01-17-06.22.58.000000 UTC
          1  not pending                                                  -              2017-01-17-06.14.26.000000 UTC

DB20000I  The ROLLFORWARD command completed successfully.

或者指定前滾的時間點
db2inst1@psnode1:/gpfs1nsd/backup> db2 "rollforward database sampledb to  2017-01-17-14.14.26.000000 using local time and complete overflow log path ('/gpfs1nsd/backup')"

                                Rollforward Status

Input database alias                   = sampledb
Number of members have returned status = 2

Member ID    Rollforward                 Next log             Log files processed        Last committed transaction
             status                      to be read
-----------  --------------------------  -------------------  -------------------------  --------------------------
          0  not pending                                                  -              2017-01-17-14.14.26.000000 Local
          1  not pending                                                  -              2017-01-17-14.14.26.000000 Local

DB20000I  The ROLLFORWARD command completed successfully.


db2inst1@psnode1:/gpfs1nsd/backup> db2 rollforward db sampledb query status

                                Rollforward Status

Input database alias                   = sampledb
Number of members have returned status = 2

Member ID    Rollforward                 Next log             Log files processed        Last committed transaction
             status                      to be read
-----------  --------------------------  -------------------  -------------------------  --------------------------
          0  not pending                                      S0000000.LOG-S0000000.LOG  2017-01-17-06.22.58.000000 UTC
          1  not pending                                                  -              2017-01-17-06.14.26.000000 UTC

db2inst1@psnode1:/gpfs1nsd/backup>

查看測試表數據

###活動日志###
PureScale每個member成員有自己的活動日志文件,可以看到兩個member的活動日志分別存放在LOGSTREAM0000和LOGSTREAM0001中;
db2inst1@psnode2:/gpfs1nsd/db2log/NODE0000/LOGSTREAM0001> cd /gpfs1nsd/db2log/NODE0000/
db2inst1@psnode2:/gpfs1nsd/db2log/NODE0000> ls -rlt
total 0
drwxr-x--- 4 db2inst1 db2grp 4096 Jan 17 14:42 LOGSTREAM0000
drwxr-x--- 2 db2inst1 db2grp 4096 Jan 17 14:42 LOGSTREAM0001


###歸檔日志###
PureScale每個member成員有自己的歸檔日志文件,可以看到兩個member的歸檔日志分別存放在LOGSTREAM0000和LOGSTREAM0001中;
db2inst1@psnode2:/gpfs1nsd/db2arch/db2inst1/SAMPLEDB/NODE0000> ls -rlt
total 0
drwxr-x--- 5 db2inst1 db2grp 4096 Jan 17 14:40 LOGSTREAM0000
drwxr-x--- 5 db2inst1 db2grp 4096 Jan 17 14:42 LOGSTREAM0001



###兩套Purescale數據庫間進行重定向恢復###

備庫執行
cd /db2sd_20170116165543/backup
db2 "restore database sampledb from /db2sd_20170116165543/backup into sampledb redirect generate script sampledb.clp without rolling forward"

編輯 ESBDBFE.clp
    (1)-- LOGTARGET '<directory>'為      LOGTARGET '/db2sd_20170116165543/backup'
    (2) -- DBPATH ON '<target-directory>' 改為DBPATH ON  '/db2sd_20170116165543/SAMPLEDB'
    (2)注釋掉without rolling forward

創建目錄
mkdir data1
mkdir data2
mkdir data3
mkdir data4
mkdir data5
mkdir data6
mkdir data7
mkdir data8
mkdir db2log
mkdir db2logmir
mkdir db2arch

設置DB路徑
db2 attach to db2sdin1
db2 update dbm cfg using DFTDBPATH '/db2sd_20170116165543/SAMPLEDB'

執行restore命令
db2 terminate
db2 -tvf /db2sd_20170116165543/backup/sampledb.clp

查看數據庫恢復狀態
db2 list utilities show detail

查看前滾狀態
db2 rollforward db sampledb query status

執行前滾操作
db2 "rollforward db sampledb to end of logs and stop overflow log path ('/db2sd_20170116165543/backup')"

關于DB2_PureScale備份與恢復是怎樣的問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業資訊頻道了解更多相關知識。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

安陆市| 凤翔县| 卓资县| 九江市| 商水县| 长沙县| 乌鲁木齐市| 山阴县| 会宁县| 奉化市| 策勒县| 林州市| 徐汇区| 合作市| 图们市| 广元市| 宁夏| 古交市| 民勤县| 庆城县| 锡林郭勒盟| 红桥区| 绍兴市| 广昌县| 诏安县| 巫溪县| 揭东县| 乳山市| 绍兴县| 循化| 德清县| 襄垣县| 平谷区| 甘谷县| 桂平市| 牡丹江市| 滦平县| 大方县| 如东县| 临潭县| 缙云县|