Sunday, 24 June 2012

Unable to run reports from ITIM console



Unable to run reports from ITIM console

By Siva Praturi & Vamshidhar K


When an attempt is made to run run reports in ITIM  console, the following message is displayed on the screen

"CTGIMU793E : Reports cannot run while the report data synchronization is in progress."

It happens if data synchronization task has failed for some reason and status column in SYNCHRONIZATION_HISTORY table is not updated. The only way to correct this issue is to update the status column manually.

When data synchronization task is started from ITIM console, then you will find one row with STATUS of "Started" in the SYNCHRONIZATION_HISTORY table.

This is what ITIM uses to determine if Data Synchronization is in progress or not. Most likely the actual processing finished long ago with some kind of error that was not reflected in the SYNCHRONIZATION_HISTORY table.

The database administrator can correct this situation by updating the status of the "Started" synchronization entry to "Failed". See DB2 SQL commands below.

DB2 CONNECT TO ITIMDB USER ITIMUSER USING PASSWORD

SELECT * FROM ITIMUSER."SYNCHRONIZATION_HISTORY" where status='Started';

UPDATE ITIMUSER.SYNCHRONIZATION_HISTORY set status='Failed' where status='Started';

DB2 CONNECT RESET

Manual update to SYNCHRONIZATION_HISTORY table will enable to run data synchronization task from ITIM console. It may take to complete data synchronization and some times it may result in below status

"Last synchronization completed with 8 non-fatal exceptions. Check Tivoli Identity Manager trace and message log files and application server log files for details"

After checking log files you may find CTGIMF007E and "LDAP: error code 32 - No Such Object" errors. This error occurs as ITIM LDAP contains a DN that no longer exists. One way to fix it by identifying and fixing them manually.

References:





Tuesday, 10 April 2012

DB2 HADR Setup and Failure Scenarios


DB2 HADR Setup and Failure Scenarios

By Vamshidhar K


High Availability Disaster Recovery (HADR)

HADR is a data replication feature that provides a high availability solution for both partial and complete site failures. HADR protects against data loss by replicating data changes from a source database, called the primary, to a target database, called the standby. The two primary goals for HADR are fastest failover possible and easy to use.

Let us consider an example with  IBM Tivoli Identity Manager with HADR setup using DB2 database. In this scenario, ITIM Database is residing on two servers serverOne and serverTwo with a database name ITIMDB. HADR is setup between two servers with  serverOne as primary and serverTwo as standby. The two databases are in Peer state, Synchronous mode and the connection state is Connected.

The following configuration parameters would have been set during HADR setup:

Sl. #
Configuration Parameter
serverOne
serverTwo
1
HADR_LOCAL_HOST
serverOne
serverTwo
2
HADR_LOCAL_SVC
serverOnePort
serverTwoPort
3
HADR_REMOTE_HOST
serverTwo
serverOne
4
HADR_REMOTE_SVC
serverTwoPort
serverOnePort

The two possible failure scenarios that could occur are listed below and actions that need to be taken are detailed further in the article.

  • The standby server fails
  • The primary server fails


1)      The standby server fails
The primary server regularly sends log buffer over to the standby and will wait for the number of seconds defined by the HADR_TIMEOUT configuration parameter (by default it's 120 seconds). In the case of standby server failure, primary server will not receive any response for HADR_TIMEOUT seconds then the primary server will continue to process transactions and will not try to contact the standby again.

Impact:
The performance is impacted once when the primary server determines the standby server offline.

Solution:
There is no need to perform any action after the standby is online. As the standby will contact the primary to say it is alive and the standby will automatically resynchronize itself. Once it is back in Peer state, the primary will again ship log buffers to the standby.

2)      The primary server fails
When the primary server fails, the connections to that server will be severed
Impact:
When the primary has failed then all the transactions on primary must be routed to standby so that there are no loss of transactions and response to the requests.

Solution:
When the primary server fails, standby server can be made as primary by forceful takeover (run the TAKEOVER HADR ON DATABASE database_name BY FORCE command which will cause the standby server to become a primary server). The standby will apply the last log buffers that it has (if there are any left to apply), undo any in-flight transactions, and then open the database for connections. At this point the automatic client reroute will successfully establish a connection from the client application to the standby (now primary) server and inform the application that the most recent in-flight transaction has been rolled back.



Important DB2 Commands:
a)      To stop any applications connecting to databases and ensure that those other applications are not requesting and holding agents.
DB2 QUIESCE INSTANCE database_name IMMEDIATE FORCE CONNECTIONS
In quiesced mode, users cannot connect from outside of the database engine and the trace file is less cluttered.
b)      Another command to start an instance in a quiesced mode.
DB2START ADMIN MODE
c)       To restore user access to instances or databases which have been quiesced for maintenance or other reasons.
DB2 UNQUIESCE INSTANCE database_name
d)      To check the status of HADR.
DB2PD –DB database_name -HADR
e)      To display detailed information the current database manager configuration parameters.
DB2 GET DBM CFG

DB2 Commands to establish HADR between serverOne and serverTwo:
1)       Execute the following command from serverOne
DB2 TERMINATE
2)       Execute the following command from serverTwo
DB2 TERMINATE
3)       Execute the following command from serverOne
DB2 DEACTIVATE DATABASE serverOne
4)       Execute the following command from serverTwo
DB2 DEACTIVATE DATABASE servertWO
5)       Execute the following command from serverOne
DB2 START HADR ON DATABASE serverTwo USER user_name USING password AS STANDBY
6)       Execute the following command from serverOne
DB2 START HADR ON DATABASE serverOne AS PRIMARY
7)       Execute the following command from serverOne or serverTwo
DB2PD –DB serverOne -HADR
DB2PD –DB serverTwo -HADR

HADR Takeover:

The following command performs failover:
TAKEOVER HADR ON DATABASE database_name [BY FORCE]

Modes of takeover:
1)       Without the BY FORCE option, standby server and primary servers switch roles. (Current standby becomes new primary).
The standby server will send a message to tell the primary server to turn itself into a standby. The primary server will oblige by stopping in-flight transactions, sending over the last log buffer(s) to the standby, and turning itself into a standby. The initial standby server will wait for the final log buffers to arrive, apply them, and then turn itself into a primary server.
The client applications that were disconnected from the old primary will automatically reroute to this new primary and be connected. Then applications that were in-flight will be sent an error message telling them that they are still connected but their current transaction was rolled back. The proper response from an application (as with many error codes) would be to retry the transaction which will now succeed on the new primary server and the end user will be none the wiser.
If you do not use the BY FORCE option and the standby cannot contact the primary for any reason, then the takeover command will fail.
2)       With the BY FORCE option, the standby server itself turns its role to primary without coordinating any change of roles with the (current) primary server.

Wednesday, 21 March 2012

How to FIX data inconsistency issues in TDS


How to FIX data inconsistency issues in TDS

By Siva Praturi

Replication is a technique used by directory servers to improve performance, availability, and reliability. The replication process keeps data in multiple directory servers synchronized.

Data inconsistency in directory servers arises mainly due to replication issues. Keeping the directory servers synchronized requires a diligent approach, including monitoring and maintenance. Any negligence in directory administration can result in significant differences in directory data across the cluster. 


In a clustered environment of TDS, data needs to be kept consistent among clustered members. Any changes done to master server needs to be propagated to peer or replica servers through replication technique. Due to various reasons, sometimes changes done to one server may not get replicated to other servers. This results in data inconsistency among them.


Data inconsistency among TDS cluster members can occur when:

1.       One server contains entries that do not exist on another TDS cluster member.

2.       Entry exists on both server but their attributes are different.

To synchronize TDS cluster members and bring them back in consistent state, the following approaches are adapted. 
1.       Importing the data from one TDS server using idsdb2ldif and exporting it to other server using idsldif2db or bulkload.

2.       Using idsldapdiff utility.


The following is the example LDAP structure for LDAP Master and Replica instances directory structure.  The example commands which are given underneath steps are used to synchronize “ou=TestOrg” organizationUnit from master to replica/master.

O=IBM

|-ou=itim  

|-ou=TestOrg

      |-ou=itim

   |-erglobalid=000000000000000000 

|-ibm-replicaGroup=default     


 1. Using idsdb2ldif and idslidf2db utility
 The following steps need to be followed to synchronize data between two or more LDAP instances.

 1.       Export LDIF file using idsdb2ldif/db2ldif server utility on master LDAP server
The idsdb2ldif/db2ldif is a server utility which is used to export entries from a directory stored in a relational database into a text file in LDAP Directory Interchange Format (LDIF). 

db2ldif [-o output_file -I instance_name [-f config_file]

        [-n filter_DN] [-c comments]

        [-k ?|key_seed -t key_salt] [-j] [-d debug_level]

        [[-s subtree_DN [-x]] | [-l] [-r]] [-W]] |    ?

 
This utility is available under “..\IBM\LDAP\V6.2\sbin” folder 
For syntax help, type “db2ldif -?” command 
Example: idsdb2ldif -I itimldap -s " ou=TestOrg, ou=itim, O=IBM " -j -o C:\LDAP_BACKUPs\ TestOrg.ldif     


2.       Delete LDAP subtree using idsldapdelete/ldapdelete server utility, in this scenario delete “ou=TestOrg” on LDAP replica server. Note: Take LDAP full backup before deleting this entry using idsdb2ldif utility.


The idsldapdelete/ldapdelete opens a connection to an LDAP server, binds, and deletes one or more entries. If one or more Distinguished Name (DN) arguments are provided, entries with those DNs are deleted. Each DN is a string-represented DN. If no DN arguments are provided, a list of DNs is read from standard input, or from file if the -i or -f flag is used. 

ldapdelete.exe [options] [DNs]

ldapdelete.exe [options] [-i file]
 
This utility is available under “..\IBM\LDAP\V6.2\bin” folder 
For syntax help, type “idsldapdelete -?” command 
Example: idsldapdelete -D cn=root -w password -s "ou=TestOrg, ou=itim, O=IBM"


3.       Skip all pending change entries and suspend replication on both master and replica LDAP servers using TDS Web Admin GUI or command line utilities.

4.       Import LDIF file which is generated in step 1 using ldif2db/idsldif2db utility 
The ldif2db/idsldif2db utility is used to import entries into LDAP server.  The database must already exist. The idsldif2db can be used to add entries to an empty directory database or to a database that already contains entries.


Note:  Before executing ldif2db/idsldif2db utility, TDS server must be stopped (both administration and instance).  Make sure that no applications are active and attached to the directory.  If applications are running using TDS Server then none of the import utilities will run. 

ldif2db [-i input_file -I instance_name [-f config_file]

        [-d debug_level] [-r yes | no] [-g] [-W output_file]] | -?
            This utility is available under “..\IBM\LDAP\V6.2\sbin” folder 
For syntax help, type “ldif2db -?” command  
Example: idsldif2db -i C:\LDAP_BACKUPs\ TestOrg.ldif 

5.       Resume replication on both master and replica TDS Servers.  To test replication create/update and delete entries and verify on both LDAP servers. 



The idsldapdiff command line utility is designed to compare two directory subtrees on two different directory servers to determine if their contents match. It identifies differences in a replica server and its master and can be used to synchronize replicas.

Idsldapdiff performs two passes to make the servers are in sync. In the first pass, idsldapdiff traverses the Supplier server and does the following: Adds any extra entries on the supplier and to the consumer. Compares and fixes entries that exist on both the servers. In the second pass, idsldapdiff traverses the Consumer to check for any extra entries on the Consumer 

The tool traverses each entry in the directory subtree on the supplier server and compares its contents with the corresponding entry on the consumer server. Thus running the utility can take a long time and can generate lots of read requests to the supplier and consumer servers.  It is recommended to run the utility when no updates are being made to either of the directory servers.


This utility is a diagnostic and corrective tool it is not designed to run as routine maintenance. Depending on the replication-related errors observed in the log files, an administrator might decide to run the utility.


idsldapdiff -sh hostname -sp 389 -sD cn=root -sw password -ch consumerhostname -cp 389 -cD cn=root -cw password -b o=ibm,c=us  -a -F
                  
This utility is available under “..\IBM\LDAP\V6.2\bin” folder 
For syntax help, type “idsldapdiff -?” command  
Example: ldapdiff -b " ou=TestOrg, ou=itim, O=IBM " -sh "mastertds.ibm.com" -ch "replicatds.ibm.com" -sD "cn=root" -sw password -cD "cn=root" -cw password –F -a 
 


Tuesday, 20 March 2012

Backup, Extract and Restore Tivoli Access Manager data

Backup, Extract and Restore Tivoli Access Manager data


By Siva Praturi

pdbackup


pdbackup utility is used to backup, extract and restore Tivoli Access Manager data

<TAM_Install_Dir>\etc\pdbackup.lst file contains Tivoli Access Manager data
<TAM_Install_Dir>\etc\pdinfo.lst file contains Tivoli Access Manager service information

It is good practice to backup using both options.

How to bakup Tivoli Access Manager data?

Use following commands to bakup Tivoli Access Manager data

pdbackup.exe -action backup -list "D:\APPS\IBM\Tivoli\Policy Director\etc\pdbackup.lst" -file pdbackup.lst_xxxx -path D:\temp

pdbackup.exe -action backup -list "D:\APPS\IBM\Tivoli\Policy Director\etc\pdinfo.lst" -file pdinfo.lst_xxxx -path D:\temp

If the command is run without any errors, it creates pdbackup.lst_xxxx.dar and pdinfo.lst_xxxx.dar files in D:\temp directory.

How to extract Tivoli Access Manager data?

Use following commands to extract Tivoli Access Manager data. This is to ensure the files are created properly before performing restore operation.

pdbackup.exe -action extract  -file D:\temp\pdinfo.lst_xxxx.dar -path D:\temp\pdinfo

pdbackup.exe -action extract  -file D:\temp\pdbackup.lst_xxxx.dar -path D:\temp\pdbackup

If the command is run without any errors, it extracts files to  D:\temp\pdinfo and  D:\temp\pdbackup  directory.
  
How to restore Tivoli Access Manager data?

Use following commands to restore Tivoli Access Manager data.

pdbackup.exe -action restore -file D:\temp\pdinfo.lst_xxxx.dar

pdbackup.exe -action restore -file D:\temp\pdbackup.lst_xxxx.dar

If the command is run without any errors, it restores files to <TAM_Install_Dir> from archive file.

Note:-

  • Use current date / timestamp for xxxx. It will avoid overwriting of bakup files created.
  • msg__pdbackup file will contain verbose output of ‘pdbakup’ commands. Review this file after executing the commands. Generally this file will be created in local\temp folder.
  • ‘pdbakup’ with restore option will try to overwrite files in <TAM_Install_Dir> and it prompts for ‘yes/no/all’ options. In win 2008, there is a bug and this will not be visible in command prompt. So open msg__pdbackup file and enter your option.
  • Stop TAM policy server service before restore operation.