Friday, January 30, 2015

How to take the Backup of WebSphere & DB2


md D:\TSRMBKPSCRIPT
if already exists
del D:\TSRMBKPSCRIPT
md D:\TSRMBKPSCRIPT
db2cmd -i -w db2clpsetcp
echo %DB2CLP%
db2
CONNECT TO MAXDB71 USER db2admin USING <db2admin’s password>
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
CONNECT RESET
force applications all
BACKUP DATABASE MAXDB71 USER db2admin USING <db2admin’s password> TO “D:\TSRMBKPSCRIPT” WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
CONNECT TO MAXDB71 USER db2admin USING <db2admin’s password>
UNQUIESCE DATABASE
CONNECT RESET
cd “C:\Program Files\IBM\WebSphere\AppServer\bin\”
backupConfig.bat -username wasadmin -password <wasadmin’s password>
move WebSphereConfig_*.zip D:\TSRMBKPSCRIPT

Maximo Rebuild and Redploy EAR


1 Ensure that no database configuration changes are pending.
2 Shut down the Maximo application server.
3 Back up the database.
4 Back up the C:\IBM\SMP\maximo.
5 Take Comodo Snapshot backup
6 Extract the files to a folder
7 Copy all files to C:\IBM\SMP\maximo
8 When asked choose to overwrite all files new copied files
9 Open a DOS prompt:
i) cd \<maximo_root>\tools\maximo
ii) updatedb
10 Apply any manual updates listed in this readme.txt file. Manual changes if any are listed for each APAR in the section “Manual Changes”
11 Delete the application server cache
C:\Program Files\IBM\Websphere\AppServer\profiles\CtgApp01\temp\ctgNode01\MAXIMOSERVER
12 Rebuild and redeploy the EAR files, and then restart the application server
i) Backup existing ear file.
cd C:\ibm\SMP\maximo\deployment\
run buildmaximoear.cmd
ii)     cd C:\ibm\smp\maximo\tools\maximo
run encryptproperties.bat
iii) shutdown application server
iv) cd C:\ibm\SMP\jacl\solutions
v) DeployApplication.bat wasadmin WASADMIN_PASSWORD “MAXIMO” ctgNode01 MXServer “C:\ibm\SMP\maximo\deployment\default\maximo.ear” maximo_host webserver1
vi) Now try to start MXServer from WAS  admin console https://localhost:9043/ibm/console/
It should automatically start Maximo Enterprise Application as well.
vii) if MXServer starts but Maximo Enterprise application does not, then try running Maximo Enterprise Application again while MXServer is running.
If it fails saying Not synchronized
Then follow the following:
a. stop nodeagent service from services.msc
b. run this command
C:\Program Files\IBM\WebSphere\AppServer\profiles\ctgAppSrv01\bin>syncNode.bat TSRM_WAS_SERVER_NAME 8879 -username wasadmin -password WASADMIN_PASSWORD
(Note: If you face issues like unable to authenticate, check if TDS is running or not.)
output will be like below:
————————————–
ADMU0116I: Tool information is being logged in file C:\Program Files\IBM\WebSphere\AppServer\profiles\ctgAppSrv01\logs\syncNode.log
ADMU0128I: Starting tool with the ctgAppSrv01 profile
ADMU0401I: Begin syncNode operation for node ctgNode01 with Deployment Manager
<hostname>: 8879
ADMU0016I: Synchronizing configuration between node and cell.
ADMU0402I: The configuration for node ctgNode01 has been synchronized with Deployment Manager <hostname>: 8879
————————————–
c. after successful syncnode start nodeagent from services.msc
d. start maximo enterprise application in WAS
Database configuration is in progress message starting Maximo. Start fails
Technote (troubleshooting)
Problem(Abstract)
java.lang.Exception : Database Configuration is in process . ConfigDB and RestoreFromBackup must complete before MXServer can be booted .
at pdsi.server.MXServer.boot
Login receives Error 500: system#notboundexception
Resolving the problem
It is possible for configdb to leave a flag set, which can stop Maximo from starting.
Run the following SQL
select * from MAXVARS where varname=’CONFIGURING’;
Check the VARVALUE returned. It will be a ’1′ to signify that configdb is running . If it is not, then do not continue and call into support to report the error.
update MAXVARS set varvalue=’0′ where varname=’CONFIGURING’;
This will reset the flag that signifies configdb to be running.
Maximo should now start.

Add Tablespace in DB2 Database for Maximo


Symptom

You cannot save another record.
BMXAA4211E – There is a database error number -289 to operate longDescription Ldownertable Ldkey = 83,212 = Worklog Language = EN Ldownercol = DESCRIPTION. Unable to allocate new pages to the tablespace “MAXDATA”.

Resolving the problem

  1. Run –> cmd
  2. Type: db2cmd
  3. Another command prompt will open up
  4. type: db2
  5. you will now be at db2 prompt
  6. type: connect to maxdb71 user db2admin using <db2admin’s password>
  7. it will say you are connected
  8. type: set schema = maximo
  9. it will say command completed successfully
  10. type: LIST TABLESPACES show detail
  11. Locate/Find the “Tablespace ID” (TS ID) of the MAXDATA
  12. ie: MAXDATA is TSID of 3
  13. type: LIST TABLESPACE CONTAINERS FOR <TS ID of MAXDATA> SHOW DETAIL
  14. example: LIST TABLESPACE CONTAINERS FOR 3 SHOW DETAIL
  15. Output will be like below
Tablespace Containers for Tablespace 3
Container ID = 0
Name = C:\CTGINST1\NODE0000\SQL00001\CTGDAT\MAXDATA\container1
Type = File
Total pages = 152587
Useable pages = 152544
Accessible = Yes
16. Notice the containers already added (at the end of path, the file name). You can not use same container name for your new container.
17. Choose some new name. If already added one is container1, let’s name ours as container2
18. Add another container file. 
19. this command will add a 6.4GB file of space on your existing drive (200,000 pages of 32KB)
20. type: alter tablespace MAXDATA add ( file ‘container2′ 200000 )

Restore Database in DB2 to another instance


db2cmd -i -w db2clpsetcp
echo %DB2CLP%
db2
CONNECT TO MAXDB71 USER db2admin USING <db2admin’s password>
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
CONNECT RESET
force applications all
Restore DATABASE MAXDB71 USER db2admin USING <db2admin’s password> FROM “D:\TSRMBKPSCRIPT” WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
CONNECT TO MAXDB71 USER db2admin USING <db2admin’s password>
UNQUIESCE DATABASE
CONNECT RESET

How to recover a failed database configuration in Maximo



Run the following SQL
select * from MAXVARS where varname=’CONFIGURING’;
Check the VARVALUE returned. It will be a ’1′ to signify that configdb is running . If it is not, then do not continue and call into support to report the error.
update MAXVARS set varvalue=’0′ where varname=’CONFIGURING’;
This will reset the flag that signifies configdb to be running.
run —> db2cmd
connect to maxdb71 using db2admin using <db2admin’s password>
set schema = maximo
SELECT count(*) from maxobjectcfg where changed != 'N'
‘N’ indicates that a change has been committed. For this query, if entries are returned with a value of 0 instead of N, you must commit those changes.
select count(*) from sysibm.systables where name like 'XX%' and creator = 'MAXIMO'
This was to determine whether any temporary tables exist in your database.
If the returned value is not 0, follow these steps to drop the temporary tables:
open cmd.
cd C:\ibm\SMP\maximo\tools\maximo
run the following in order below:
configdb.bat
restorefrombackup.bat
dropbackup.bat


Then try to see if websphere admin console is running or not
localhost:9060/ibm/console
login
if can not login, then check have you started directory server?
Once logged in try to start mxserver
ideally it should start
if it complains of node agent being not started, then go to services.msc (run –> services.msc) and restart nodeagent service of websphere
retry the starting of mxserver. This time it should start and you should get the login screen at http://localhost/maximo