In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
DB2_PureScale backup and recovery is what, for this problem, this article describes the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
perform online backups
db2 backup database sampledb online to /gpfs1nsd/backup include logs
db2 list history backup all for sampledb
Database Create test tables and insert data
db2 "create table test1 (name varchar(32))"
db2 "insert into test1 values ('Jack')"
Check Tablespace Status
db2 list tablespaces | grep State
restore database
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.
database roll forward
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.
Or specify the point in time to roll forward
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>
View Test Sheet Data
###Activity Log ##
Each member of PureScale has its own activity log file. You can see that the activity logs of the two members are stored in LOGSTREAM0000 and LOGSTREAM0001 respectively.
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
###Archive logs ##
Each member of PureScale has its own archive log file. You can see that the archive logs of the two members are stored in LOGSTREAM0000 and LOGSTREAM0001 respectively.
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
###Redirect recovery between two Purescale databases ###
backup execution
cd /db2sd_20170116165543/backup
db2 "restore database sampledb from /db2sd_20170116165543/backup into sampledb redirect generate script sampledb.clp without rolling forward"
Edit ESBDBFE.clp
(1)-- LOGTARGET ''for LOGTARGET '/db2sd_20170116165543/backup'
(2)-- DBPATH ON '' to DBPATH ON '/db2sd_20170116165543/SAMPLEDB'
2) without rolling forward
create a directory
mkdir data1
mkdir data2
mkdir data3
mkdir data4
mkdir data5
mkdir data6
mkdir data7
mkdir data8
mkdir db2log
mkdir db2logmir
mkdir db2arch
Set DB Path
db2 attach to db2sdin1
db2 update dbm cfg using DFTDBPATH '/db2sd_20170116165543/SAMPLEDB'
Execute restore command
db2 terminate
db2 -tvf /db2sd_20170116165543/backup/sampledb.clp
View Database Recovery Status
db2 list utilities show detail
View Roll Forward Status
db2 rollforward db sampledb query status
Perform a roll forward operation
db2 "rollforward db sampledb to end of logs and stop overflow log path ('/db2sd_20170116165543/backup')"
About DB2_PureScale backup and recovery is how the answer to the question shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more about knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.