DB2_PureScale備份與恢復(fù)是怎樣的,針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
10年的忠縣網(wǎng)站建設(shè)經(jīng)驗(yàn),針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。營銷型網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整忠縣建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)公司從事“忠縣網(wǎng)站設(shè)計”,“忠縣網(wǎng)站推廣”以來,每個客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
執(zhí)行在線備份
db2 backup database sampledb online to /gpfs1nsd/backup include logs
db2 list history backup all for sampledb
數(shù)據(jù)庫創(chuàng)建測試表,并插入數(shù)據(jù)
db2 "create table test1 (name varchar(32))"
db2 "insert into test1 values ('Jack')"
檢查表空間狀態(tài)
db2 list tablespaces | grep State
restore數(shù)據(jù)庫
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.
數(shù)據(jù)庫前滾
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.
或者指定前滾的時間點(diǎn)
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>
查看測試表數(shù)據(jù)
###活動日志###
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數(shù)據(jù)庫間進(jìn)行重定向恢復(fù)###
備庫執(zhí)行
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 '
(2) -- DBPATH ON '
(2)注釋掉without rolling forward
創(chuàng)建目錄
mkdir data1
mkdir data2
mkdir data3
mkdir data4
mkdir data5
mkdir data6
mkdir data7
mkdir data8
mkdir db2log
mkdir db2logmir
mkdir db2arch
設(shè)置DB路徑
db2 attach to db2sdin1
db2 update dbm cfg using DFTDBPATH '/db2sd_20170116165543/SAMPLEDB'
執(zhí)行restore命令
db2 terminate
db2 -tvf /db2sd_20170116165543/backup/sampledb.clp
查看數(shù)據(jù)庫恢復(fù)狀態(tài)
db2 list utilities show detail
查看前滾狀態(tài)
db2 rollforward db sampledb query status
執(zhí)行前滾操作
db2 "rollforward db sampledb to end of logs and stop overflow log path ('/db2sd_20170116165543/backup')"
關(guān)于DB2_PureScale備份與恢復(fù)是怎樣的問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。