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

Move Maximo Database to another server


The installation properties are maintained in the Maximo database, and the maximo.properties file. These are required for fixpack installations, and other product installations. Over time passwords may change, hostnames/ip-addresses or database names may change. In order to update these values, follow these instructions:
1. Update the \ibm\SMP\maximo\applications\maximo\properties\maximo.properties file on the Admin Workstation to change the IP-Address/Hostname for either the database server or the webserver. Also to update the password
a. Delete the file named maximo.properties
b. Rename the file named maximo.properties_orig to maximo.properties (this is an unencrypted file)
c. Edit the maximo.properties file and update the hostname/IP-address for the database server.
d. If necessary, update the password for the user to access the database
e. Save the file
Note: The file will be automatically re-encrypted when you install a fixpack or other product. If this is not an immediate activity, you can run encryptproperties.bat file located in C:\ibm\smp\maximo\tools\maximo directory against the file to encrypt it.
2. Update the \ibm\SMP\etc\install.properties file on the Admin Workstation to change the IP-Address/Hostname for either the database server or the webserver.
3. Update the values in the maximo database to change the IP-Address/Hostname for a variety of servers, or to update passwords.
a. Connect to the maximo database using your favorite SQL editor utility.
b. Query the maxpropvalue table, and find the key you need to edit. For example, WAS.DeploymentManagerHostName is the key for the hostname or IP address of the WebSphere machine.
c. Create a query to update that value to the new value, and run the query.
d. Repeat for any passwords, ip addresses etc that need to be updated.
4. Rebuild and redeploy the EAR files.

http://www-01.ibm.com/support/docview.wss?uid=swg21382026

How to set up a clustered Maximo application environment


The following describes the steps required to set up a clustered Maximo application (an example). Maximo clustering provides a means to group like functionality. In this example the Maximo EAR file is deployed to the cluster is for the UI. From there the IHS web server will be used to distribute the requests between identically defined application servers. This is a great way to scale your Maximo system.
Note: To share resources in a clustered environment, all resources must be defined at the cell-level within the WebSphere console.
In the example configuration below, we will use the following names:
MXCLUSTER is the cluster
MXUI1 is a cluster member
MXUI2 is a cluster member

Creating a cluster and cluster members

First, you define both the Cluster and the Cluster members that make up the Cluster. Begin by using the following “example” configuration for a single application server Java Virtual Machine (JVM):
50 concurrent users, 1 CPU and 2GB of RAM memory.
So, using the above example, if you had 100 concurrent users, you would create a 2-JVM cluster and the server environment would have 2 CPUs and 4GB of ram memory.
1. Login to the WebSphere Administrative Console.
2. Click Servers > Clusters, in the Server clusters screen, click New.
3. Enter the basic cluster information,
a. Enter MXCLUSTER in the Cluster name field.
b. Check Prefer local checkbox, click Next.
4. Create first Clustered Servers member, enter the following:
a. Enter MXUI1 in the Member name field.
b. Accept the defaults in the Select Node and Weight fields.
c. Check the Generate Unique Http Ports checkbox.
d. Select the “Create the member using existing application server as a template” radio button and choose MXSERVER (this is the application server name created initially for Maximo) from the drop down list and click Next.
5. Create additional cluster members, enter MXUI2 in the Member name field, click Add Member and then click Next.
6. Click Finish to create the cluster and clustered servers, then click Save
7. Heap size: Click Application servers, then click on each new server > Java and Process Management > Process Definition > Java Virtual Machine and fill in both the Initial and Maximum Heap sizes. Click Apply and then click Save
NOTE: When setting the Initial/Maximum heap size for the MXUI1/MXUI2 application server JVMs, the following recommended heap size should be used for each JVM:
32-bit server = 512MB/1024MB
64-bit server = 1024MB/2048MB.

Update Virtual Hosts

This procedure describes how to verify port numbers used by the clustered servers. It also explains how to update the virtual host with the port number information. A virtual host enables a single host machine to resemble multiple host machines. Each virtual host has a logical name and a list of one or more DNS aliases by which it is known.
1. To verify port numbers of the clustered application servers, perform the following actions:
a. Servers > Application Servers, click MXUI1.
b. Under the Communications, click Ports.
c. Make a note of the WC_defaulthost port number for use below (9081, 9082).
2. Repeat Step 1 for MXUI2.
3. Environment > Virtual Hosts, click New.
4. Enter MXCLUSTER_host is the Name field, click Apply.
5. Click Host Aliases under Additional Properties.
6. Click New in the Host Alias panel to add 3 Host name and port number values to the host aliases list:
a. Host Name: *, Port: 80 (IBM HTTP Server port), click OK.
b. Host Name: *, Port: 9081 (same as port number for MXUI1), click OK.
c. Host Name: *, Port: 9082 (same as port number for MXUI2), click OK.
7. Click Save.

Deploying to the Cluster

Now that you have created and configured the MXCLUSTER, you then should deploy your enterprise application (EAR) within the cluster.
Note: When mapping modules to servers, make sure you select both MXCLUSTER and the webserver1 as the web server:
WebSphere:cell-ctgCell01,cluster=MXCLUSTER
WebSphere:cell-ctgCell01,node=ctgNode01,server=webserver1
Also, when mapping virtual hosts to web modules, use the virtual host you created above for the cluster:
MXCLUSTER_host
Lastly, start the MXCLUSTER Cluster

IBM PMR URL

Following is the IBM PMR URL.

https://www-947.ibm.com/support/servicerequest/Home.action

You will require an IBM web id and password to log in.