IBM Maximo: Migrate MAXDB to RH OpenShift: Difference between revisions

From Wiki
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 13: Line 13:
Paste inside yaml form and click on create
Paste inside yaml form and click on create


= Restore MAXDB76 backup file into Container =
= Copy backup file into Container =


Define db2 project on openshift
Define db2 project on openshift
Line 55: Line 55:
This command is generate the following file: [[IBM Maximo: Migrate MAXDB to RH OpenShift (db2ckbkp.out)]]
This command is generate the following file: [[IBM Maximo: Migrate MAXDB to RH OpenShift (db2ckbkp.out)]]


= Restore MAXDB76 backup file into Container =
This command will export data from backup file
su - db2inst1
cd /mnt/backup
db2 restore database MAXDB76 redirect generate script restoresql.sql
This command is generate the following file: [[IBM Maximo: Migrate MAXDB to RH OpenShift (restoresql.sql)]]
This can help to change parameters on restore.
Prepare db2
db2 force applications all
db2 terminate
db2 deactivate database MAXDB
db2 drop database MAXDB
Create directories
mkdir -p /mnt/bludata0/MAXDB
mkdir -p /mnt/tempts/c-db2ucmas76-05-db2u/MAXDB
Start RESTORE with REDIRECT
<nowiki>db2 "RESTORE DATABASE MAXDB76 FROM '/mnt/backup' TAKEN AT 20220913055916 INTO MAXDB REPLACE HISTORY FILE REPLACE EXISTING REDIRECT WITHOUT ROLLING FORWARD WITHOUT PROMPTING"</nowiki>
Configure Storage Group
db2 "SET STOGROUP PATHS FOR IBMSTOGROUP ON '/mnt/bludata0'"
Continue the RESTORE
db2 "RESTORE DATABASE MAXDB76 CONTINUE"
= Checking restored database =
Connect to database
db2 connect to MAXDB
Verify tablespaces
db2 list tablespaces show detail
Verify containers
db2 list tablespace containers for 0 show detail
db2 list tablespace containers for 5 show detail
db2 list tablespace containers for 6 show detail
Verify storage group
db2 "select * from syscat.stogroups"
db2 "select * from syscat.storagepaths"
Verify data (tables)
db2 "select count(*) from syscat.tables"
db2 "select tabschema, tabname, card from syscat.tables where tabschema not like 'SYS%' fetch first 10 rows only"


= Ver também =
= Ver também =

Latest revision as of 00:17, 8 April 2026


Create MAXDB database

1) Install DB2 Operator

2) Create a New instance of DB2.

Open the DB2 Operator -> DB2 Cluster -> New cluster.

Get yaml file on this Article IBM Maximo: Migrate MAXDB to RH OpenShift (db2ucmas76-01.yaml)

Paste inside yaml form and click on create

Copy backup file into Container

Define db2 project on openshift

oc project db2u

Check pods

oc get pods

Copy backup file

oc cp MAXDB76.0.___.001.zip c-db2ucmas76-02-db2u-0:/mnt/backup/MAXDB76.0.___.001.zip

Login on container

oc rsh c-db2ucmas76-02-db2u-0

Extract file

cd /mnt/backup
unzip MAXDB76.0.___.001.zip
chmod a+rw MAX*

List

ls -l
total 7121740
-rw-rw-rw-. 1 db2uadm db2iadm1 7095119872 Sep 13  2022 MAXDB76.0.ctginst1.DBPART000.20220913055916.001
-rw-rw-rw-. 1 db2uadm db2iadm1  197538909 Apr  7 21:15 MAXDB76.0.ctginst1.DBPART000.20220913055916.001.zip

Change user

su - db2inst1

Check backup

db2ckbkp -H /mnt/backup/MAXDB76.0.ctginst1.DBPART000.20220913055916.001

This command is generate the following file: IBM Maximo: Migrate MAXDB to RH OpenShift (db2ckbkp.out)

Restore MAXDB76 backup file into Container

This command will export data from backup file

su - db2inst1 

cd /mnt/backup

db2 restore database MAXDB76 redirect generate script restoresql.sql

This command is generate the following file: IBM Maximo: Migrate MAXDB to RH OpenShift (restoresql.sql)

This can help to change parameters on restore.

Prepare db2

db2 force applications all
db2 terminate
db2 deactivate database MAXDB
db2 drop database MAXDB

Create directories

mkdir -p /mnt/bludata0/MAXDB
mkdir -p /mnt/tempts/c-db2ucmas76-05-db2u/MAXDB

Start RESTORE with REDIRECT

db2 "RESTORE DATABASE MAXDB76 FROM '/mnt/backup' TAKEN AT 20220913055916 INTO MAXDB REPLACE HISTORY FILE REPLACE EXISTING REDIRECT WITHOUT ROLLING FORWARD WITHOUT PROMPTING"

Configure Storage Group

db2 "SET STOGROUP PATHS FOR IBMSTOGROUP ON '/mnt/bludata0'"

Continue the RESTORE

db2 "RESTORE DATABASE MAXDB76 CONTINUE"


Checking restored database

Connect to database

db2 connect to MAXDB

Verify tablespaces

db2 list tablespaces show detail

Verify containers

db2 list tablespace containers for 0 show detail
db2 list tablespace containers for 5 show detail
db2 list tablespace containers for 6 show detail

Verify storage group

db2 "select * from syscat.stogroups"
db2 "select * from syscat.storagepaths"

Verify data (tables)

db2 "select count(*) from syscat.tables"
db2 "select tabschema, tabname, card from syscat.tables where tabschema not like 'SYS%' fetch first 10 rows only"

Ver também