Difference between revisions of "hidden:Restore Test System 7.4.3p1 from DB2 OfflineBackup"

From Lsdf
Line 1: Line 1:
 
1. '''Make a Bare Metal backup before starting restore'''
 
1. '''Make a Bare Metal backup before starting restore'''
   
/usr/sbin/rear mkbackup
+
/usr/sbin/rear mkbackup
/opt/hpss/bin/lshpss -all > /db2_backup/lshpss-hpss7.4.3p3/lshpss-7.4.3p3_before_downgrade_to_7.4.3p2.txt
 
hpssadm> server shutdown -all
 
/opt/hpss/bin/rc.hpss -d stop
 
/opt/hpss/bin/rc.hpss -m stop
 
   
  +
2. '''List HPSS current configuration'''
/opt/hpss/bin/rc.hpss stop (stop db2 , and resratrt it in order to close all active connections. Alternatively
 
  +
db2 quiesce instance <inst_name> restricted access immediate force connections....take a closer look at db2 documentation ...it was not tested here...
 
  +
/opt/hpss/bin/lshpss -all > /db2_backup/lshpss-hpss7.4.3p3/lshpss-7.4.3p3_before_downgrade_to_7.4.3p2.txt
http://www-01.ibm.com/support/docview.wss?uid=swg21636292)
 
su - hpssdb
 
. /var/hpss/hpssdb/sqllib/db2profile
 
db2start
 
db2 backup db hcfg to /db2_backup/offline/hcfg compress
 
db2 backup db hsubsys1 to /db2_backup/offline/hsubsys1 compress
 
   
  +
3. '''Stop HPSS'''
db2stop
 
   
  +
hpssadm> server shutdown -all
restore db2 from an offline backup
 
  +
/opt/hpss/bin/rc.hpss -d stop
su - hpssdb
 
. /var/hpss/hpssdb/sqllib/db2profile
+
/opt/hpss/bin/rc.hpss -m stop
db2start
 
db2 list history backup since 20151201 for hcfg
 
db2 "restore db hcfg from /db2_backup/offline/hcfg taken at 20151221154752"
 
   
  +
4. '''Stop db2 and restar it in order to close all active connections.
db2 "restore db hsubsys1 from /db2_backup/offline/hsubsys1 taken at 20151221154835"
 
  +
Alternatively db2 quiesce instance <inst_name> restricted access immediate force connections....take a closer look at db2 documentation ...it was not tested here...
db2 "rollforward db hcfg to end of logs and complete"
 
  +
http://www-01.ibm.com/support/docview.wss?uid=swg21636292)
   
  +
/opt/hpss/bin/rc.hpss stop
db2 "rollforward db hsubsys1 to end of logs and complete"
 
  +
su - hpssdb
  +
. /var/hpss/hpssdb/sqllib/db2profile
  +
db2start
   
  +
5. '''Make DB offline backup'''
db2 activate db hcfg
 
  +
db2 backup db hcfg to /db2_backup/offline/hcfg compress
db2 activate db hsubsys1
 
  +
db2 backup db hsubsys1 to /db2_backup/offline/hsubsys1 compress
rm /opt/hpss
 
ln -s /hpss_src/hpss-7.4.3.1-0.el6 /opt/hpss
 
/opt/hpss/bin/rc.hpss start
 
make a link to 7.4.3p2 on test mover
 
delete disk devices: delete files, delete cos, delete hierarchy, delete storage class. delete resource, export volume, delete disk/device
 
   
  +
6. '''Stop DB2'''
SCSI Library and drives
 
library scan drive address on caore
 
/opt/hpss/bin/device_scan
 
   
  +
db2stop
   
  +
7. '''Restore db2/HPSS /7.4.3p1/ from an offline backup'''
scan scsi drive address on mover
 
  +
sg_map -st -x -i ----> take generic drive /dev/sgXX
 
  +
su - hpssdb
/opt/hpss/bin/device_scan -t tape -s /dev/sgXX
 
  +
. /var/hpss/hpssdb/sqllib/db2profile
  +
db2start
  +
db2 list history backup since 20151201 for hcfg
  +
db2 "restore db hcfg from /db2_backup/offline/hcfg taken at 20151221154752"
  +
db2 "restore db hsubsys1 from /db2_backup/offline/hsubsys1 taken at 20151221154835"
  +
db2 "rollforward db hcfg to end of logs and complete"
  +
db2 "rollforward db hsubsys1 to end of logs and complete"
  +
db2 activate db hcfg
  +
db2 activate db hsubsys1
   
  +
8. '''Make hpss linkk to version 7.4.3p1'''
  +
  +
rm /opt/hpss
  +
ln -s /hpss_src/hpss-7.4.3.1-0.el6 /opt/hpss
  +
/opt/hpss/bin/rc.hpss start
   
  +
9. '''7.4.3p2 needs no DB2 conversion, simply make the link'''
STK Library and drive
 
   
  +
rm /opt/hpss
take device address from acsls maschine
 
  +
ln -s /hpss_src/hpss-7.4.3.2-0.el6 /opt/hpss
   
  +
10. '''Make a link to 7.4.3p2 on test mover'''
/opt/hpss/tools/unsupported/bin/removesegs -i1 -v TK0528 --delete-segments (twice)
 
   
  +
11. '''Reconfigure HPSS'''
new cartridges in library iu1 hpss_test_01:
 
TS0213JC
 
TS0214JC
 
   
  +
Delete disk devices: delete files, delete cos, delete hierarchy, delete storage class.
new cartridges in stk hpsst partition:
 
  +
Delete resource, export volume, delete disk/device
TK024300
 
TK024400
 
   
  +
12. '''SCSI Library and drives'''
write some files with patch 2
 
set cartridges on read only
 
upgrade to patch3 (see hawto Upgrade from p2 to p3)
 
read this file with patch 3 and compare the checksums
 
   
  +
library scan drive address on core
create new tape storage class 110 PrimaryCopySTK_T10KD E2EDP and 111 SecondaryCopyIUT1_TS1140 E2EDP with BP enabled
 
  +
/opt/hpss/bin/device_scan
crteate new hierarchies 110,111,112
 
create new COSs 110,111,112 with "hash algorithm"=MD5
 
   
import new cartridges in SC110
 
   
  +
scan scsi drive address on mover
TK024500
 
  +
sg_map -st -x -i ----> take generic drive /dev/sgXX
TK024600
 
  +
/opt/hpss/bin/device_scan -t tape -s /dev/sgXX
TK024800
 
TK024900
 
   
import new cartridges in SC 111
 
TS024600
 
TS024700
 
TS024800
 
TS024900
 
   
  +
13. '''STK Library and drive'''
import new cartridges in old SC100 for migrate force tests
 
TK052100
 
TK052200
 
import new cartridges in old sc101 foe migrate force tests
 
TS024400
 
TS024500
 
   
  +
take device address from acsls maschine and define STK library in HPSS
tK0521 set readonly
 
ts0245 set readonly
 
   
  +
14. '''If a tape volume cannot be removed do this:'''
set p2 cartridges on read only TS0213,TS0214,TK0243,TK0244
 
   
  +
/opt/hpss/tools/unsupported/bin/removesegs -i1 -v TK0528 --delete-segments (twice)
Migration does not run ([IBM][CLI Driver][DB2/LINUXX8664] SQL0551N The statement failed because the authorization ID does not have the required authorization or privilege to perform the operation. Authorization ID: "HPSS". Operation: "SELECT". Object: "HPSS.BFMIGRRECBITFILEVIEW". SQLSTATE=42501)
 
   
  +
15. '''New cartridges in library iu1 hpss_test_01:'''
(Conversion Guide 10.5.1)
 
  +
  +
TS0213JC
  +
TS0214JC
   
  +
16. '''New cartridges in stk hpsst partition:'''
stop hpss
 
   
  +
TK024300
[root@hpsstcr03 ~]# . /var/hpss/hpssdb/sqllib/db2profile
 
  +
TK024400
[root@hpsstcr03 ~]# /opt/hpss/tools/convert743/hpss/hpss_convertdb743
 
HPSS_DB_INSTANCE_OWNER is set - Using 'hpssdb' for database connections.
 
Password for hpssdb:
 
cnvt> mpsforcemigrategrant
 
DB20000I The SQL command completed successfully.
 
DB20000I The SQL command completed successfully.
 
cnvt> quit
 
   
  +
17. '''Write some files with patch 2'''
start hpss
 
   
  +
18. '''Set cartridges on read only'''
(it had no effect!!!!!)
 
   
  +
19. '''Upgrade to patch3 (see hawto Upgrade from p2 to p3)
try the following:
 
  +
su - hpssdb
 
  +
read the files written with patch 2 and compare the checksums
db2 connect to hsubsys1
 
  +
bash-4.1$ db2 grant control on table hpss.BFMIGRRECBITFILEVIEW to user hpss
 
  +
20. '''Create new tape storage classes and enable Block Protection'''
DB20000I The SQL command completed successfully.
 
  +
  +
110 PrimaryCopySTK_T10KD E2EDP
  +
111 SecondaryCopyIUT1_TS1140 E2EDP with BP enabled
  +
  +
21. '''Create new hierarchies 110,111,112'''
  +
  +
22. '''Create new COSs 110,111,112 with "hash algorithm"=MD5'''
  +
  +
23. '''Import new cartridges in SC110'''
  +
  +
TK024500
  +
TK024600
  +
TK024800
  +
TK024900
  +
  +
24. '''Import new cartridges in SC 111'''
  +
  +
TS024600
  +
TS024700
  +
TS024800
  +
TS024900
  +
  +
25. '''Import new cartridges in old SC100 for migrate force tests'''
  +
  +
TK052100
  +
TK052200
  +
26. '''Import new cartridges in old sc101 for migrate force tests'''
  +
  +
TS024400
  +
TS024500
  +
  +
TK0521 set readonly
  +
TS0245 set readonly
  +
  +
27. '''Set p2 cartridges as read only TS0213,TS0214,TK0243,TK0244'''
  +
  +
28. '''Problem'''
  +
  +
Migration does not run
  +
IBM][CLI Driver][DB2/LINUXX8664] SQL0551N The statement failed because the authorization ID does not have the required authorization or privilege to perform the operation.
  +
Authorization ID: "HPSS". Operation: "SELECT". Object: "HPSS.BFMIGRRECBITFILEVIEW". SQLSTATE=42501)
  +
  +
29. '''This step was of no use'''
  +
  +
See Conversion Guide 10.5.1)
  +
Stop hpss
  +
[root@hpsstcr03 ~]# . /var/hpss/hpssdb/sqllib/db2profile
  +
[root@hpsstcr03 ~]# /opt/hpss/tools/convert743/hpss/hpss_convertdb743
  +
HPSS_DB_INSTANCE_OWNER is set - Using 'hpssdb' for database connections.
  +
Password for hpssdb:
  +
cnvt> mpsforcemigrategrant
  +
DB20000I The SQL command completed successfully.
  +
DB20000I The SQL command completed successfully.
  +
cnvt> quit
  +
start hpss
  +
  +
30. '''Grant hpss user the required privileges'''
  +
  +
su - hpssdb
  +
db2 connect to hsubsys1
  +
bash-4.1$ db2 grant control on table hpss.BFMIGRRECBITFILEVIEW to user hpss
  +
DB20000I The SQL command completed successfully.
  +
  +
'''Migrations runs'''

Revision as of 10:19, 11 July 2016

1. Make a Bare Metal backup before starting restore

/usr/sbin/rear mkbackup

2. List HPSS current configuration

/opt/hpss/bin/lshpss -all > /db2_backup/lshpss-hpss7.4.3p3/lshpss-7.4.3p3_before_downgrade_to_7.4.3p2.txt

3. Stop HPSS

hpssadm> server shutdown -all
/opt/hpss/bin/rc.hpss -d stop
/opt/hpss/bin/rc.hpss -m stop

4. Stop db2 and restar it in order to close all active connections.

Alternatively db2 quiesce instance <inst_name> restricted access immediate force connections....take a closer look at db2 documentation ...it was not tested here...
http://www-01.ibm.com/support/docview.wss?uid=swg21636292)
/opt/hpss/bin/rc.hpss stop
su - hpssdb
.  /var/hpss/hpssdb/sqllib/db2profile
db2start

5. Make DB offline backup

db2 backup db hcfg to /db2_backup/offline/hcfg compress
db2 backup db hsubsys1 to /db2_backup/offline/hsubsys1 compress

6. Stop DB2

db2stop

7. Restore db2/HPSS /7.4.3p1/ from an offline backup

su - hpssdb
.  /var/hpss/hpssdb/sqllib/db2profile
db2start
db2 list history backup since 20151201 for hcfg
db2 "restore db hcfg from /db2_backup/offline/hcfg taken at 20151221154752"
db2 "restore db hsubsys1 from /db2_backup/offline/hsubsys1 taken at 20151221154835"
db2 "rollforward db hcfg to end of logs and complete"
db2 "rollforward db hsubsys1 to end of logs and complete"
db2 activate db hcfg
db2 activate db hsubsys1

8. Make hpss linkk to version 7.4.3p1

rm /opt/hpss
ln -s /hpss_src/hpss-7.4.3.1-0.el6 /opt/hpss
/opt/hpss/bin/rc.hpss start

9. 7.4.3p2 needs no DB2 conversion, simply make the link

rm /opt/hpss
ln -s /hpss_src/hpss-7.4.3.2-0.el6 /opt/hpss

10. Make a link to 7.4.3p2 on test mover

11. Reconfigure HPSS

Delete disk devices: delete files, delete cos, delete hierarchy, delete storage class. 
Delete resource, export volume, delete disk/device

12. SCSI Library and drives

library scan drive address on core
/opt/hpss/bin/device_scan


scan scsi drive address on mover
sg_map -st -x -i ----> take generic drive /dev/sgXX
/opt/hpss/bin/device_scan -t tape -s /dev/sgXX


13. STK Library and drive

take device address from acsls maschine and define STK library in HPSS

14. If a tape volume cannot be removed do this:

/opt/hpss/tools/unsupported/bin/removesegs -i1 -v TK0528 --delete-segments     (twice)

15. New cartridges in library iu1 hpss_test_01:

TS0213JC
TS0214JC

16. New cartridges in stk hpsst partition:

TK024300
TK024400

17. Write some files with patch 2

18. Set cartridges on read only

19. Upgrade to patch3 (see hawto Upgrade from p2 to p3)

read the files written with patch 2 and compare the checksums

20. Create new tape storage classes and enable Block Protection

110 PrimaryCopySTK_T10KD E2EDP  
111 SecondaryCopyIUT1_TS1140 E2EDP with BP enabled

21. Create new hierarchies 110,111,112

22. Create new COSs 110,111,112 with "hash algorithm"=MD5

23. Import new cartridges in SC110

TK024500
TK024600
TK024800
TK024900

24. Import new cartridges in SC 111

TS024600
TS024700
TS024800
TS024900

25. Import new cartridges in old SC100 for migrate force tests

TK052100
TK052200

26. Import new cartridges in old sc101 for migrate force tests

TS024400
TS024500
TK0521 set readonly
TS0245 set readonly

27. Set p2 cartridges as read only TS0213,TS0214,TK0243,TK0244

28. Problem

Migration does not run 
IBM][CLI Driver][DB2/LINUXX8664] SQL0551N  The statement failed because the authorization ID does not have the required authorization or privilege to  perform the operation.     
Authorization ID: "HPSS".  Operation: "SELECT". Object: "HPSS.BFMIGRRECBITFILEVIEW".  SQLSTATE=42501)

29. This step was of no use

See Conversion Guide 10.5.1)
Stop hpss
[root@hpsstcr03 ~]# .  /var/hpss/hpssdb/sqllib/db2profile
[root@hpsstcr03 ~]# /opt/hpss/tools/convert743/hpss/hpss_convertdb743
HPSS_DB_INSTANCE_OWNER is set - Using 'hpssdb' for database connections.
Password for hpssdb: 
cnvt> mpsforcemigrategrant
DB20000I  The SQL command completed successfully.
DB20000I  The SQL command completed successfully.
cnvt> quit
start hpss 

30. Grant hpss user the required privileges

su - hpssdb
db2 connect to hsubsys1
bash-4.1$ db2 grant control on table hpss.BFMIGRRECBITFILEVIEW to user hpss
DB20000I  The SQL command completed successfully.
Migrations runs