Skip to main content

Process multiple IBM Rational Team Concert resources in IBM Rational Insight

How to use the extract, transform, and load (ETL) feature

Petroula Pantazopoulos (petroula@ca.ibm.com), Rational Insight Data Warehouse Developer, IBM
Petroula Pantazopoulos is a developer on the Rational Insight warehouse team. She has prior experience developing for IBM Rational Portfolio Manager.

Summary:  Learn how to use the extract, transform, and load (ETL) tool that is included with Rational Insight to process more than one IBM® Rational® Team Concert data source. This article explains how to perform an ETL action on multiple Rational Team Concert data sources in IBM® Rational Insight using Cognos Data Manager.

Date:  10 Sep 2009
Level:  Intermediate PDF:  A4 and Letter (201KB | 14 pages)Get Adobe® Reader®
Activity:  1567 views

Note: The automatic processing of Rational Team Concert data sources is available in the Rational Insight 1.0.0.1 ETL.

The IBM® Rational® Insight extract, transform, and load (ETL) process for Rational Team Concert is different from other supported point product data extractions provided in the out-of-the-box Data Manager catalog, because it uses a direct database connection to the IBM® Rational® Team Concert™ data warehouse. There are no REST services to provide the data to the ETL, and there are no associated XML metadata configuration files.

To perform an ETL action on multiple Rational Team Concert data sources in Rational Insight, you must use IBM® Cognos® Data Manager procedure component to make system calls. You must complete these tasks to set up your environment:

  1. Register the Data Manager database in the Insight Data Manager catalog so that you can get the encrypted password for the user account that connects to the catalog database.
  2. For each Rational Team Concert resource that needs to be processed, register its database. Use a specific naming convention for the connection profile name, such as “Rational Team Concert X,” where X is a digit.
  3. Remove the definition of the RESOURCEGROUP_ID variable from the RTCE2E job.
  4. Manually export the registered database aliases from the catalog database.
  5. Generate a batch file that creates alias files to use with the rundsnode.exe executable for each of the Rational Team Concert resources.
  6. Generate a batch file and execute commands to process all of the Rational Team Concert resources that were created in the previous step.

This procedure sets up an automatic process to generate the alias files to process all Rational Team Concert resources in an end-to-end scenario. You use only one scheduled job to invoke the RTCE2E node against all Rational Team Concert repositories, in sequence. This process will only work for Rational Team Concert resources that are all deployed on the same DBMS. That is they are all deployed on DB2 or all deployed on Oracle or all deployed on SQL Server.

Register the Data Manager database

To register the Data Manager database in the Insight Data Manager catalog:

  1. In Data Manager, select Library > Connections (see Figure 1).
  2. Create an entry for the Data Manager catalog database (see Figure 2).

Figure 1. The entry for the Data Manager catalog
Connections node in the Library section of catalog


Figure 2. Data Manager catalog database connection information
Connection information for DB2 in Data


Register the Rational Team Concert resources

  1. In Data Manager, select Library > Connections.
  2. For each additional Rational Team Concert database that you need to process, create a connection entry that uses the naming convention "Rational Team Concert X," where X is a digit (see Figure 3).

Figure 3. Multiple Rational Team Concert database entries
Numbered database entries, Rational Team Concert


Remove the RESOURCEGROUP_ID variable definition

The predefined RESOURCEGROUP_ID variable at the RTCE2E job node groups all data from various Rational Team Concert resources as the same data source. Because you want to process more than one Rational Team Concert resource, you must delete the variable at the RTCE2E node.

To uniquely identify the data from each Rational Team Concert resource in the Rational Insight data warehouse, you must first define the RESOURCEGROUP_ID variable outside of the scope of the job; that is, define and set it at runtime from the command line and then find a good, unique value to set it to.

In the following example, the variable is set to the value of the database alias itself:

To set a variable from the command line when invoking the rundsjob executable file, you must pass the -V flag along with the variable name and value that you want to set it to.

-V<variable>=<value>


Export the aliases from the catalog

Export the registered database aliases so that you can get the encrypted password for the Data Manager database that you registered in the first step. You do this so that the batch files that are generated in the subsequent steps do not store nor use a clear text password.

  1. To export the aliases, use the catexp utility in the Data Manager.
  2. After you generate the file and extract all of the information, make sure that you delete the file so that you do not leave behind profile and connection information. Anyone with access to the file, server, knowledge of the catalog, and the jobs it contains might be able to invoke a Data Manager job against a repository.

The following is an example of a command to issue from a command prompt for an IBM® DB2® database:

catexp DB2 DSN=DMCAT;UID=<user name>;PWD=<passwd> DMCatAlias.txt A

where <user name> is the account that you use to connect to the catalog database and <password> is the password for this account. The contents of the export are located in the DMCatAlias.txt file, and the A flag forces the command to export only the database aliases.

  1. In the DMCatAlias.txt file, locate the entry that pertains to the Data Manager catalog, and take note of the encrypted password:
// Database Alias specification
// Data Manager - catalog API v8.0
<DEFAULT> 'DMCAT' DB2 'DSN=DMCAT;UID=dweadmin;
PWD=~3EC298FE80F9AD09D22FE05EF394CE4C0B;TRUSTED=FALSE;COGNOSSQL=FALSE'


Automatically generate the connection files

In the Insight Data Manager catalog, the default Rational Team Concert builds normally processes the connection with a profile name of "Rational Team Concert". In order to process more than one Rational Team Concert resource, without having to duplicate the builds in the catalog for each resource, you must change the connection information for the "Rational Team Concert" connection dynamically. To accomplish this:

  1. Create an alias file for each of the Rational Team Concert resources. The file contains a connection entry for the Rational Insight warehouse, and the Rational Team Concert resource in question.
  2. Then, create a job and use a procedure node that will issue system commands to generate and run a batch file.

The UI in Figure 4 contains an example of the variables and their values at the job level, and the list that follows defines the variables.


Figure 4. List of Data Manager variables to define in the job
DB2 values for the batch job

  • DMCATUSER: The account to use to connect to the Data Manager catalog database
  • DMCATPASSWD: The encrypted password for this account that you extracted previously in the process
  • DMCATDRIVER: The RDBMS driver to use for the connection, IBM DB2, Oracle, or Microsoft® SQL Server®
  • SQLSERVINST: If SQL Server is used for the Data Manager catalog database, here is where to specify the instance where it resides
  • WINAUTH: If SQL Server is used for the Data Manager catalog database, here is where to specify whether windows authentication should be used (in that case set the value to TRUE) otherwise use SQL Server authentication (in that case set the value to FALSE).
  • DMCATCONST: The connection string to the Data Manager catalog database, based on what DMCATDRIVER (driver) is specified.

Here, we examine the cases of the DB2, Oracle, and SQL Server drivers. You can add to the list or make it specific to support only one kind of driver in your environment. The following definitions are for Microsoft® Windows® and Linux®:


Listing 1. Driver definitions for Windows
CASE Upper($DMCATDRIVER) OF
BEGIN
'DB2': RETURN 'DB2 DSN={$DMCATDB};UID={$DMCATUSR};PWD={$DMCATPASSWD}';
'ORACLE': RETURN CONCAT('ORACLE ','{$DMCATUSR}','/','{$DMCATPASSWD}','@','{$DMCATDB}');
'OLEDB': CASE $WINAUTH OF
       BEGIN
        TRUE:RETURN CONCAT('OLEDB   "Data Source"=','{$SQLSERVINST}',';
"Integrated Security"=TRUE',';Database=','{$DMCATDB}');
        DEFAULT:RETURN CONCAT('OLEDB   "Data Source"=','{$SQLSERVINST}',';
"User Id"=','{$DMCATUSR}',';Password=','{$DMCATPASSWD}',';"Integrated Security"=FALSE',
';Database=','{$DMCATDB}'); 
         END
DEFAULT: RETURN 'NOT SUPPORTED RDBMS';

Note:
For Linux, you must escape the semicolon (;) with a backslash (\) as the ; is a statement terminator in Linux.


Listing 2. Driver definitions for Linux
CASE Upper($DMCATDRIVER) OF
BEGIN
'DB2': RETURN 'DB2 DSN={$DMCATDB}\;UID={$DMCATUSR}\;PWD={$DMCATPASSWD}';
'ORACLE': RETURN CONCAT('ORACLE ','{$DMCATUSR}','/','{$DMCATPASSWD}','@','{$DMCATDB}');
DEFAULT: RETURN 'NOT SUPPORTED RDBMS';
END

The node in the job is a procedure node that contains system calls (see Figure 5, Figure 6, and Figure 7).


Figure 5. Data Manager node for Windows
Windows: Procedure node in Data Manager


Figure 6. Data Manager node for Linux
Linux: Procedure node in Data Manager


Figure 7. Contents of the procedure node
System calls for the procedure node

Click to enlarge


Listing 3. Procedure note code in Windows
System('mkdir ..\ricon');
System('catexp {$DMCATCONSTR} ..\ricon\ListRTC.txt A');
System('echo @echo off> ..\ricon\rtc.bat');
System('echo pushd ..\ricon >> ..\ricon\rtc.bat');
System('echo SETLOCAL ENABLEDELAYEDEXPANSION >> ..\ricon\rtc.bat');
System('echo set /A TOTRTC=1 >> ..\ricon\rtc.bat');
System(concat('echo for /F "tokens=*" %%g in (',char(39),'findstr /I 
/C:"Rational Team Concert" 
ListRTC.txt',char(39),') do (>> ..\ricon\rtc.bat'));
System('echo findstr /I /C:"Rational Data Warehouse" 
ListRTC.txt ^>RTC!TOTRTC!.txt >> ..\ricon\rtc.bat');
System(Concat('echo FOR /F "tokens=2 delims=',char(39), ' eol=/" %%a  in (',char(39),
'echo "%%g"',char(39),') do ( >>  ..\ricon\rtc.bat'));
System('echo set  GSUB=%%g  >>  ..\ricon\rtc.bat');
System('echo set GSUB=!GSUB:%%a=Rational Team Concert! >>  ..\ricon\rtc.bat');
System('echo echo !GSUB! ^>^> RTC!TOTRTC!.txt>> ..\ricon\rtc.bat');
System('echo SET /A TOTRTC=!TOTRTC!+1>> ..\ricon\rtc.bat');
System('echo )>> ..\ricon\rtc.bat');
System('echo )>> ..\ricon\rtc.bat');
System('echo ENDLOCAL>> ..\ricon\rtc.bat');
System('echo popd >> ..\ricon\rtc.bat');
System('call ..\ricon\rtc.bat');
System('del /F /Q ..\ricon\rtc.bat');


Listing 4. Procedure node code in Linux
System('mkdir $COG_ROOT/ricon');
System('catexp {$DMCATCONSTR} $COG_ROOT/ricon/ListRTC.txt A');
System('echo "#!/bin/ksh"> $COG_ROOT/ricon/rtc.sh');
System('echo "curDir=\`pwd\`" >> $COG_ROOT/ricon/rtc.sh');
System('echo "cd \$COG_ROOT/ricon" >> $COG_ROOT/ricon/rtc.sh');
System('echo "typeset -i TOTRTC=1" >> $COG_ROOT/ricon/rtc.sh');
System('echo "RIDW=\`cat ListRTC.txt|grep 
-e \"Rational Data Warehouse\"\`
">>$COG_ROOT/ricon/rtc.sh');
System('echo "while read line" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "do" >>$COG_ROOT/ricon/rtc.sh ');
System('echo "echo \$line|grep \"Rational Team Concert\">/dev/null" 
>>$COG_ROOT/ricon/rtc.sh  ');
System('echo "if [ \$? -eq 0 ]" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "then" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "echo \$RIDW>RTC\$TOTRTC.txt" >>$COG_ROOT/ricon/rtc.sh');
System(Concat('echo "echo \$line |sed ',char(39),
's/Rational Team Concert [1-9]/Rational Team Concert/g',char(39),' >>RTC\$TOTRTC.txt" 
>>$COG_ROOT/ricon/rtc.sh'));
System('echo "TOTRTC=\$TOTRTC+1" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "fi" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "done <ListRTC.txt" >>$COG_ROOT/ricon/rtc.sh  ');
System('echo "cd \$curDir" >>$COG_ROOT/ricon/rtc.sh');
System('chmod +x $COG_ROOT/ricon/rtc.sh');
System('$COG_ROOT/ricon/rtc.sh');
System('rm -f $COG_ROOT/ricon/rtc.sh');

The output of this execution is a batch or shell script file called rtc.bat/rtc.sh located in the $COg_ROOT/ricon. After it is executed, it is immediately deleted.

The output in the example in Figure 8 displays three text files, one for each of the connection profiles for DB2 databases for Rational Team Concert and a DB2 Rational Insight database:

  • Rational Team Concert
  • Rational Team Concert 2
  • Rational Team Concert 3

Figure 8. Generated files at run time on Windows
Connection profiles: RTC1.txt, RTC2.txt, RTC3.txt

The RTC*.txt files contain the following code shown in Listings 5, 6, and 7.


Listing 5. RTC1.txt (connection profile for Rational Team Concert)
<DEFAULT> 'Rational Data Warehouse' DB2 'DSN=RIDW;UID=db2admin;
  PWD=~850926D39C5C57FA0AAEA66B472FB0757B;COGNOSSQL=FALSE'
<DEFAULT> 'Rational Team Concert' DB2 'DSN=JAZZDB;UID=dbjzadmin;
  PWD=~BA3E90727065956DB28BB8B2C3E09690CB;TRUSTED=FALSE;COGNOSSQL=FALSE'   


Listing 6. RTC2.txt (connection profile for Rational Team Concert 2)
<DEFAULT> 'Rational Data Warehouse' DB2 'DSN=RIDW;UID=db2admin;
  PWD=~850926D39C5C57FA0AAEA66B472FB0757B;COGNOSSQL=FALSE'
<DEFAULT> 'Rational Team Concert' DB2 'DSN=RTCDB;UID=dbdwjadm;
  PWD=~BA3E90727065956DB28BB8B2C3E09690CB;TRUSTED=FALSE;COGNOSSQL=FALSE'  


Listing 7. RTC3.txt (connection profile for Rational Team Concert 3)
<DEFAULT> 'Rational Data Warehouse' DB2 'DSN=RIDW;UID=db2admin;
  PWD=~850926D39C5C57FA0AAEA66B472FB0757B;COGNOSSQL=FALSE'
<DEFAULT> 'Rational Team Concert' DB2 'DSN=RTCDW;UID=dbdwadm;
  PWD=~BA3E90727065956DB28BB8B2C3E09690CB;TRUSTED=FALSE;COGNOSSQL=FALSE'  

The physical database connection information for the Rational Team Concert connection profile has been changed. You can now use these files to start the Rational Team Concert jobs.


Automatically process Rational Team Concert resources

For each of the RTC*.txt alias files that were generated in the previous step, the Insight Rational Team Concert Data Manager job RTCE2E must be executed against them. To automate this processing, you must use the procedure node from the previous step and add to it the statements outlined below. The process will do the following.

  1. Go through each of the RTC*.txt connection profile files, and call the RTCE2E job.
  2. After that is complete, the files will be automatically deleted.

Listing 8. For Windows
System(concat ('@echo OFF && for %c in (..\ricon\RTC*.txt) do (',char(13),
'for /F "skip=1 tokens=2 delims=^=.*;" %g in (',char(39),
'findstr /C:DSN %c',char(39),') do (',char(13),'rundsjob.exe  {$DMCATCONSTR} 
"{$JOB_NAME}" -A%c -VRESOURCEGROUP_ID=%g))'));
System(concat ('cmd /V:ON /C "@echo OFF && for %c in (..\ricon\RTC*.txt) 
do (',char(13),'for /F "skip=1 tokens=2 delims=@" %g in (',char(39),
'findstr /R .* %c',char(39),') do (',char(13),'set vg=%g && rundsjob.exe  
{$DMCATCONSTR} "{$JOB_NAME}" -A%c -VRESOURCEGROUP_ID=!vg:',char(39),'=!))"'));
System(concat ('cmd /V:ON /C "@echo OFF && for %c in (..\ricon\RTC*.txt) 
do (',char(13),'for /F "skip=1 tokens=4 delims=',char(39),'; eol=;" %g in 
(',char(39),'findstr .* %c',char(39),') do (',char(13),'for /F %a in (',char(39),
'echo %g^|FIND /C "Database"',char(39),') do (set ER=%a) && if "!ER!" 
EQU "1" (set vg=%g && rundsjob.exe  {$DMCATCONSTR} "{$JOB_NAME}" -A%c 
-VRESOURCEGROUP_ID=!vg:~9!)))"'));
System(concat ('cmd /V:ON /C "@echo OFF && for %c in (..\ricon\RTC*.txt) do
(',char(13),'for /F "skip=1 tokens=6 delims=',char(39),'; 
eol=;" %g in (',char(39),'findstr .* %c',char(39),') do (',char(13),'for /F %a 
in (',char(39),'echo %g^|FIND /C
"Database"',char(39),') do (set ER=%a) && if "!ER!" EQU "1" \
(set vg=%g && rundsjob.exe  {$DMCATCONSTR} 
"{$JOB_NAME}" -A%c -VRESOURCEGROUP_ID=!vg:~9!)))"'));
System('RMDIR /S /Q ..\ricon');


Listing 9. For Linux
System('rm -f $COG_ROOT/ricon/rtc.sh');
System(concat('echo "for FILE in \`ls $COG_ROOT/ricon/RTC*.txt\`; do if [ \`sed 1d
\$FILE|grep -c DSN \` -gt 0 ]; then $COG_ROOT/bin/rundsjob  {$DMCATCONSTR} \"{$JOB_NAME}\"
-A\$FILE -VRESOURCEGROUP_ID=\`sed -n ',char(39),'/Rational Team \ Concert/p',
char(39),'  \$FILE |sed  ',char(39),'s/.*DSN=//g',char(39),' |sed \
',char(39),'s/;.*//g',char(39),'\`; fi; 
done">$COG_ROOT/ricon/ex_rtc.sh'));
System(concat('echo "for FILE in \`ls $COG_ROOT/ricon/RTC*.txt\`; do if [ \`sed 1d 
\$FILE|grep -c @ \` -gt 0 ]; then $COG_ROOT/bin/rundsjob  {$DMCATCONSTR} \"{$JOB_NAME}\" 
-A\$FILE -VRESOURCEGROUP_ID=\`sed -n ',char(39),'/Rational Team Concert/p', char(39),
' \$FILE |sed 
 ',char(39),'s/\(.*\)@//g',char(39),'|sed s/\',char(39),'//g\`; fi; 
done">>$COG_ROOT/ricon/ex_rtc.sh'));System('chmod +x $COG_ROOT/ricon/ex_rtc.sh');
System('$COG_ROOT/ricon/ex_rtc.sh');
System('rm -fR $COG_ROOT/ricon');

The job runs the executable file rundsjob.exe and runs the job RTCE2E by connecting to the databases that is specified in the RTC*.txt files. At the same time, you set the value of RESOURCEGROUP_ID.



Download

DescriptionNameSizeDownload method
Sample code for listings: 1, 3, 4, 8, and 9.1processingmultipleresources_codelistings.txt6KBHTTP

Information about download methods

Note

  1. Use the code samples provided in this txt file for code listings 1, 3, 4, 8, and 9.

Resources

Learn

Get products and technologies

Discuss

About the author

Petroula Pantazopoulos is a developer on the Rational Insight warehouse team. She has prior experience developing for IBM Rational Portfolio Manager.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=417859
ArticleTitle=Process multiple IBM Rational Team Concert resources in IBM Rational Insight
publish-date=09102009
author1-email=petroula@ca.ibm.com
author1-email-cc=robinw@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers