ibm optim: compare introductionbdavis/optim/docs/compareintro.pdf · db2®, oracle, sybase adaptive...

36
IBM Optim Compare Introduction Version 7 Release 3

Upload: others

Post on 13-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

IBM Optim

Compare IntroductionVersion 7 Release 3

���

Page 2: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management
Page 3: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

IBM Optim

Compare IntroductionVersion 7 Release 3

���

Page 4: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

NoteBefore using this information and the product it supports, read the information in “Notices” on page 23.

Version 7 Release 3 (September 2010)

This edition applies to version 7, release 3 of IBM Optim and to all subsequent releases and modifications untilotherwise indicated in new editions.

© Copyright IBM Corporation 1994, 2010.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

Page 5: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Contents

Chapter 1. Overview of Compare . . . . 1Sample Scenario . . . . . . . . . . . . . 1

Chapter 2. Comparing Data – SampleScenario . . . . . . . . . . . . . . 3Scenario Overview . . . . . . . . . . . . 3Create a Compare Request. . . . . . . . . . 3

Specify Compare Process Parameters on theGeneral Tab. . . . . . . . . . . . . . 4Identify Data Sources on the Source Tab . . . . 6

Define the Table Map . . . . . . . . . . . 7Define Match Keys . . . . . . . . . . . . 8Process the Compare Request . . . . . . . . . 9

Compare Process Report . . . . . . . . . 10Save the Compare Request . . . . . . . . . 12Browse Compare File Data . . . . . . . . . 12

Open a Compare File to Browse . . . . . . 12Save Information from a Compare File . . . . . 20

Save Compare File Information to Output File. . 20Output File Formats . . . . . . . . . . 21

Summary . . . . . . . . . . . . . . . 22

Notices . . . . . . . . . . . . . . 23Trademarks . . . . . . . . . . . . . . 25

Index . . . . . . . . . . . . . . . 27

© Copyright IBM Corp. 1994, 2010 iii

Page 6: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

iv IBM Optim: Compare Introduction

Page 7: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Chapter 1. Overview of Compare

Compare is a relational comparison facility that you can use to compare data fromone set of source tables with data from another. You can easily use Compare tocompare a set of referentially intact data in a complex data model involving anynumber of tables and relationships.

Compare is easy to use, simple in concept, yet powerful in supporting complexdatabase structures. Programmers and DBAs can easily inspect and compare sets ofrelated data. Compare eliminates the time-consuming efforts of manually“assembling” data from different tables and database management systems.Intuitive dialogs simplify data-entry tasks and provide options for comparing setsof relationally intact data. Intelligent window handling technology allows you todisplay multiple dialogs, pop-up windows, context-sensitive online help, andtutorials.

A comprehensive report and complete row-by-row results allow you to:v Analyze data used to test an application by comparing the results before and

after the application is executed.v Compare archived data with current data.v Identify similarities and differences in separate databases.v Track database changes.

Client access to the database, whether local or network, is required.

This release runs in the Microsoft Windows environment and supports the IBM®

DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, andIBM Informix® database management systems. Additional database managementsystems may be supported in future releases.

Sample ScenarioThis manual provides a sample scenario in which you archive, browse, delete, andrestore data.

The sample database tables distributed with Optim™, which correlate to the tablesused in examples in this manual, are as follows:

OPTIM_CUSTOMERSOPTIM_ORDERSOPTIM_DETAILSOPTIM_ITEMSOPTIM_SALES

Note: The tables used in examples in this manual do not contain the prefix“OPTIM_” in their names.

The major relationships between pairs of tables in the sample database are shownin the following diagram. The arrows indicate the flow from parent to child.

© Copyright IBM Corp. 1994, 2010 1

Page 8: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

In this diagram, the relationships between tables are represented by three-lettercodes consisting of the letter "R", the first letter of the parent table, and the firstletter of the child table.

The relationships between tables are as follows:v OPTIM_SALES is a parent of OPTIM_CUSTOMERS (relationship RSC)v OPTIM_CUSTOMERS is a parent of OPTIM_ORDERS (relationship RCO)v OPTIM_ORDERS is a parent of OPTIM_DETAILS (relationship ROD)v OPTIM_ITEMS is a parent of OPTIM_DETAILS (relationship RID)

The sample database includes four additional tables:v OPTIM_CUSTOMERS2v OPTIM_ORDERS2v OPTIM_DETAILS2v OPTIM_ITEMS2

These four tables are distributed empty and are related in the same way as thesimilarly named tables above. The empty tables are provided for demonstrating thefacilities in Optim.

For a complete description of the sample database tables, see the Installation andConfiguration Guide, .

2 IBM Optim: Compare Introduction

Page 9: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Chapter 2. Comparing Data – Sample Scenario

The topics in this scenario provide an overview of the functions and features ofCompare and the basic processing flow. The sample scenario proceeds through thebasics of selecting and comparing data, using example tables that correlate withtables from the sample database.

Note: The sample database table names contain the prefix “OPTIM_”. The tablenames used in examples in this scenario do not contain the prefix “OPTIM_”.

Use the comprehensive Help facility in Compare at any time to obtain moreinformation about a specific topic or function. You can click Help from the menuin most dialogs or right-click and click What's This from the shortcut menu toobtain context-specific help. Help is also available by pressing F1.

Scenario OverviewThe following scenario directs you through the process of comparing a set ofrelational data in a Source File, in this case an Extract File, to the data currently ina database.

The scenario is intended to represent a typical situation in which the Extract Filerepresents the data as it existed before testing your application and the databasetables represent the same data after testing the application.

Note: A sample Extract File is provided on the product CD. The data in thesample Extract File is similar to, but different from the data provided in the sampledatabase. The Extract File name used for this scenario is PST0001.xf.

As you proceed through this scenario, you will learn the key functions forcomparing data, including how to:v Create a Compare Request.v Specify the sources of data to compare.v Define a Table Map to match the tables being compared.v Define match keys.v Process the Compare Request and browse the results of the comparison.v Save the Compare Request.

Create a Compare RequestYou must use a Compare Request to identify the two sources of data to compare,the name of a Compare File in which to save the results, and the parametersneeded to run the comparison.

To begin, click File → New → Compare from the menu in the main window todisplay the Compare Request Editor. The General tab is shown first.

© Copyright IBM Corp. 1994, 2010 3

Page 10: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Description

Enter a description in Description to indicate the purpose or function of theCompare Request. This optional description can help you identify the CompareRequest later, should you wish to re-use it. For this scenario, type Compare ExtractFile to Database Tables.

Server Name

In the standard configuration, Compare operates as a client application with allprocessing taking place directly on the Windows workstation. Unless the databaseis installed locally, Compare uses the appropriate DBMS client software tocommunicate with the remote database over a network.

The Optim Server option allows you to define tasks on the workstation and directresource-intensive data processing functions to a machine more suited to the task.When a task requires the movement, processing, or storage of very large volumesof data, the request can be defined at the workstation in the normal way anddirected for remote processing on a machine hosting the Optim Server.

If the optional Optim Server component is installed, you process the request locallyor select a server on which to process the request, using Server Name. If theOptim Server option is not enabled at your site, Server Name is unavailable. If thisoption is enabled (as in this scenario), retain the default setting, (Local).

Specify Compare Process Parameters on the General TabThe General tab lets you establish parameters for the Compare Process. Use thistab to indicate the source of the data that is compared and the setup for theCompare Process.

4 IBM Optim: Compare Introduction

Page 11: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Compare File

The Compare File describes the results of the comparison. Enter Sample1 as thename for the Compare File. Compare completes your entry by adding the defaultextension .cmp.

Browse Results Immediately

Select the Browse Results Immediately check box to display the results of thecomparison upon completion of the Compare Process.

Create Report Immediately

Select this check box to enable the Report Options group box. You can use theReport Options group box to name a Report Request and enable access to theReport Request Editor, where reporting parameters can be defined. For thisscenario, leave the Create Report Immediately check box cleared.

Comparison Mode

The mode you select depends on the sources of data you intend to compare. Sincethe sources of data to compare for this scenario are an Extract File and tables fromthe sample database, select the Multiple Tables: Source File – All Database Tablescomparison mode.

Compress Extract Files

Compare automatically performs two Extract Processes before performing theCompare Process. Select this check box to automatically compress the Extract Filesfor storage.

Chapter 2. Comparing Data – Sample Scenario 5

Page 12: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Identify Data Sources on the Source TabClick the Source tab to identify the sources of the data to compare. The controls onthe Source tab vary according to the comparison mode you select on the Generaltab.

Source 1

For this scenario, enter PST0001.xf as the name of the Source File provided withCompare. Enter the name and fully qualified path to the directory that contains thefile, or click the Browse button to search your list of directories to select the file.

Source 2

Compare always compares the contents of a Source File (Extract or Archive File) tothe contents of another Source File. When, as in this scenario, you compare sourcedata from a database, Compare extracts the data before beginning the comparison.Therefore, you must provide an Extract File name for Source 2. Compare performsthe Extract Process automatically. Enter CStestdata.xf as the name for the ExtractFile. Extract Files are automatically saved with the default extension .xf. However,files can be saved or renamed with other extensions, or without extensions.

Table Map Option

A Table Map is required to match the tables to compare or to selectively excludetables from a comparison. You can use a Local or a Named table Map. When youclick Local, you create a Table Map that is embedded in and used only with thisCompare Request. A Local Table Map is not available to share or use in otherprocesses. When you click Named, you must provide the name of an existing TableMap or of a new Table Map that you will create.

For this scenario, click Local to create an embedded Table Map.

6 IBM Optim: Compare Introduction

Page 13: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Always View Table Map

Select this check box to review the Table map before you save or run a CompareRequest.

Note: If you clear this check box, the Table Map Editor opens only when the TableMap is not properly defined (for instance, when the specified Table Map does notinclude all of the tables in the Extract File).

For this scenario, keep the Always View Table Map check box cleared.

Define the Table MapClick Tools → Edit Table Map from the menu of the Compare Request Editor todisplay the Table Map Editor and define the Local Table Map. Since a Table Mapmust be defined, Compare will display the Table Map Editor automatically if youtry to proceed.

Note: For detailed information on the Table Map Editor, see the Common ElementsManual.

Qualifier

Enter the two-part qualifier for the Source 2 data to compare. The Qualifierconsists of: dbalias.creatorid

dbalias DB Alias of the database where the sample database tables are defined (1to 12 characters).

Chapter 2. Comparing Data – Sample Scenario 7

Page 14: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

creatoridCreator ID, Owner ID, or Schema Name (depending on DBMS) assigned tothe tables (1 to 64 characters).

For this scenario, specify the qualifier that identifies the sample database includedwith Compare. Click the down arrow to select from a list of the most recently usedqualifiers, or click the browse button to select from a list of DB Aliases and CreatorIDs.

Description

Enter a description in Description to indicate the purpose or function of the TableMap. This field is optional.

Column Map ID

For any pair of tables in the Table Map, you can specify a Column Map to mapcolumns with unlike names or exclude columns from the comparison. Refer to theCommon Elements Manual for detailed information about Column Maps.

For this sample scenario, all columns in both pairs of tables have the same namesand should be included in the comparison. Therefore, Column Maps are notrequired and this field should be left blank.

Server Name

Displays the name of an Optim Server or Local, to indicate where processing willtake place.

Tables Tab

The Tables tab displays the Source 1 tables and the corresponding Source 2 tables.Initially, the Source 2 table column is populated with the same table names as theSource 1 table column. You can change a Source 2 table name to compare theSource 1 data to a different database table or clear the Source 2 table name toexclude the Source 1 table from the comparison.

If you have correctly entered the Qualifier to specify the Optim sample databasetables, no changes to the Table Map grid are required for this scenario. Select File →Update and Return from the menu on the Table Map Editor to return to theCompare Request Editor.

Note: See the Common Elements Manual for detailed information about Table Maps.

Define Match KeysTo compare specific rows in Source 1 with the corresponding rows in Source 2,Compare requires a match key for each pair of tables.

A match key consists of one or more corresponding columns from each table.When the match key value in Source 1 is identical to the match key value inSource 2, Compare compares the remaining columns in that pair of rows. Bydefault, Compare uses the primary key as the match key.

8 IBM Optim: Compare Introduction

Page 15: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

You can review the match keys for the active Compare Request using the MatchKey Editor. When a primary key does not exist or is not acceptable as the matchkey for a specific comparison, you can define a match key using the Match KeyEditor.

Click Tools → Edit Match Keys from the menu in the Compare Request Editor todisplay the Match Key Editor.

The Match Key Editor displays the list of tables specified in the Compare Request.The Focus arrow in the first column of the table list indicates the pair of tables forwhich the corresponding Match Key column information is displayed.

For this scenario, the Source 1 primary key is used as the match key for each pairof tables, by default. If you have correctly entered the source information to specifythe sample Source File and the Optim sample database tables, no changes arerequired. Click File → Close from the menu on the Match Key Editor to return tothe Compare Request Editor.

Note: See the Compare User Manual for detailed information about match keys.

Process the Compare RequestIn the Compare Request Editor, click File → Run from the menu to process theCompare Request. The Compare Request Progress dialog displays as the CompareRequest is processed.

Chapter 2. Comparing Data – Sample Scenario 9

Page 16: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Note: Depending on the configuration at your site, you might encounter a logonprompt during processing. Refer to the Common Elements Manual for informationabout the DB Alias Connection Logon and Optim Directory Connection Logondialogs.

You can use the Compare Request Progress dialog to monitor each step of theCompare processing. The number and type of steps depend on the parameters youselected for the Compare Request.

For example, Compare might perform one or two Extract Processes (depending onthe sources you select) or reorganize and sort data in an existing Extract File beforebeginning the comparison of the selected tables.

When the Compare Process completes, one of two dialogs is displayed, dependingon whether you selected the Browse Results Immediately check box on theGeneral tab of the Compare Request Editor before you ran the request.v If you selected the Browse Results Immediately check box, the Browse Compare

File dialog displays when the Compare Process completes. (Refer to “BrowseCompare File Data” on page 12.)

v If you cleared the Browse Results Immediately check box, the Compare ProcessReport dialog displays when the Compare Process completes.

Compare Process ReportThe Compare Process Report displays specific details of the completed CompareProcess.

10 IBM Optim: Compare Introduction

Page 17: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

If the Compare Request has been named and saved, the name of the request isdisplayed on the first line of the header information. The header information alsoincludes the name and type of the data sources, Compare File and Table Mapnames, User ID of the person who initiated the process, and the start, finish, andelapsed time of the Compare Process. Process status information summarizes thenumber of warnings and errors issued, if any.

Following the header information, a summary of the tables and rows compareddisplays, including the total number of each, the number of equal and dissimilarrows, and the names of the tables compared from each source. If the CompareProcess performs any Extracts prior to performing the comparison, an ExtractProcess Report that contains the details of each Extract Process follows theCompare Process Report.

If you close the report and want to refer to it again, click File → Redisplay Results→ Current from the menu in the Compare Request Editor. (To display a list of allretained Compare Process Reports, click File → Redisplay Results → All.) Fordetails about retaining process reports, see the Common Elements Manual.

To save the Compare Process Report, click File → Save As from the menu todisplay the Save dialog. To print the report, click File → Print from the menu.

Chapter 2. Comparing Data – Sample Scenario 11

Page 18: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Save the Compare RequestTo save the Compare Request, click File → Save from the menu in the CompareRequest Editor to display the Save a Compare Request dialog.

Enter a two-part name in the box labeled Enter pattern for Compare Request.

Note: You are prompted to save the Compare Request when you exit the CompareRequest Editor if you have not done so.

Browse Compare File DataUse the Browse Utility to view the contents of a Compare File.

The Browse Utility enables you to review a summary of the results of acomparison between each pair of tables. You can also browse table data in selectedpairs of compared tables. Table data is displayed in a dialog that allows you toview Source 1 data, Source 2 data, or data from both sources, side by side.

You can also use the Browse Utility to browse the contents of a Source File (anExtract or Archive File). When selecting from several Source Files for a CompareProcess, browse Source File data to determine that the data is as expected. Whenbrowsing a Source File, you can browse data in individual tables, or join tables toview related data. For detailed information about browsing a Source File, refer tothe Common Elements Manual.

When browsing table data, you can exclude selected rows from the display, findspecific data, display character data in hexadecimal, and easily navigate the data.

Open a Compare File to BrowseIf you select the Browse Results Immediately check box in the Compare RequestEditor, the Browse Compare File dialog displays upon completion of the CompareProcess. The Browse Compare File dialog lists the tables compared, andsummarizes the results of the comparison for each pair of tables.

The Browse Compare File dialog displays information about the selected file.When you open a Compare File to browse, the name of the file appears in the titlebar and the Tables tab is shown first.

12 IBM Optim: Compare Introduction

Page 19: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Compare Files are saved with the default extension .cmp. However, files can besaved or renamed with other extensions, or without extensions.

Tables TabUse the Tables tab on the Browse Compare File dialog to view information aboutthe tables in the selected Compare File. This information can be viewed, but notedited.

Grid Details

The Tables tab contains the following grid details:

SourceIndicates the Source File for the table. Note that tables are listed in pairs,alternating between Source 1 and Source 2.

Table NameThe names of the compared tables.

Total RowsThe number of rows compared from each table.

Unmatched RowsThe number of unmatched rows in the compared table. A row isUnmatched when the match key value does not correspond to a match keyvalue in the compared table in the other Source File.

Equal RowsThe number of equal rows in the compared table. A row is Equal when thematch key value and all other column values in Source 1 and Source 2match exactly.

Different RowsThe number of different rows in the compared table. A row is differentwhen the match key values in Source 1 and Source 2 match exactly, butvalues in other columns differ.

Rows with Duplicate Match KeysThe number of rows in the compared table that have duplicate match keys.

Chapter 2. Comparing Data – Sample Scenario 13

Page 20: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

A row with a duplicate match key contains a non-unique value in theMatch Key column(s) and cannot be compared.

You can use the Find option, available on the grid heading shortcut menu, to assistin locating specific information in a large display. See the Common Elements Manualfor complete information about the Find option.

Information TabUse the Information tab on the Browse Compare File dialog to review informationabout the selected Compare File.

The Information tab contains the following details:

Created ByUser ID of the person who ran the process that created the file.

Date CreatedDate and time the file was created.

Created on MachineIdentifier for the machine from which the file was created.

Server NameName of the Optim Server from which the file is accessed or Local if thefile is accessed from the workstation.

Number of SetsThe number of pairs of tables compared.

Source 1 File NameThe fully qualified name of the Source 1 File.

14 IBM Optim: Compare Introduction

Page 21: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Source 2 File NameThe fully qualified name of the Source 2 File.

Extended Compare Table InformationThe Extended Compare Table Information dialog contains information on how therows in the source tables were compared. The dialog shows which columns wereused as match key columns and which columns were compared.

To display the Extended Compare Table Information dialog, right-click on a pair oftables in the grid on the Tables tab and click Display Extended Information fromthe shortcut menu.

Source 1

The name of the Source 1 table.

Source 2

The name of the Source 2 table.

Grid Details

The Extended Compare Table Information dialog contains the following griddetails:

Source 1 ColumnThe names of the columns in the Source 1 table.

Source 2 ColumnThe names of the columns in the Source 2 table.

Status The status of the comparison between Source 1 and Source 2 columns:

Match Source columns are in the match key.

Chapter 2. Comparing Data – Sample Scenario 15

Page 22: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

CompareSource columns are compared when the values in the paired matchkey columns are the same.

Not UsedSource column is found in only one table or was excluded from theCompare Process.

Same AttrsWhen the check box is selected, the attributes for Source 1 and Source 2 arethe same. When the check box is cleared, the column attributes for Source1 and Source 2 tables do not match.

Display Compare File Table DataYou can browse and compare the actual data within selected tables on the BrowseCompare File dialog. If the Browse Compare File dialog indicates differencesbetween tables, and you did not expect there to be any differences between thetables, you can use this feature to look at the actual data and see what the exactdifferences are.

To display the rows for a pair of tables listed on the Tables tab:v Select a pair of tables in the grid, then complete the following.

– To display all rows in the selected tables, right-click the selected tables andclick Display Rows → All from the shortcut menu.

– To display rows whose match key values match, but values in other columnsdiffer, right-click the selected tables and click Display Rows → Different fromthe shortcut menu.

– To display rows that have nonunique match key values within a table,right-click the selected tables and click Display Rows → Duplicate from theshortcut menu.

– To display rows that match exactly in all columns in both tables, right-clickthe selected tables and click Display Rows → Equal from the shortcut menu.

– To display rows whose match key values exist in only one selected table,right-click the selected tables and click Display Rows → Only from theshortcut menu.

v Double-click a pair of table names in the grid, or click File → Display Rows fromthe menu. All rows are displayed by default, unless a selection was made on theBrowse tab in Personal Options to limit the display to a particular type of row(you can click Tools → Show Excluded Rows from the menu to display all rows).

A Browse Compare File Table Data dialog displays data from the selected pair oftables.

Notes:

v If you select more than one pair of tables, several Browse Compare File TableData dialogs open. Move one dialog to see other dialogs beneath.

v Binary data is not displayed. Cells containing binary data are shaded. To viewbinary data, use the hexadecimal display. For more information about viewingbinary data, see the Compare User Manual.

Use the Browse Compare File Table Data dialog to review the compared data fromthe selected pair of tables. By default, differences in the compared data are shownin bold, italicized type.

16 IBM Optim: Compare Introduction

Page 23: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Note: You can select Personal Options to emphasize differences in Source 1 andSource 2 data.

Table Name

Name of the Source 1 table displays to the left of the toolbar. You can alternativelydisplay Source 2 table information by clicking Options → Display Source 2 fromthe menu.

Side Label Format

In side label format, the column names are displayed down the left side of theBrowse Compare File Table Data dialog and data from Source 1 and Source 2 aredisplayed to the right of the headings. Names of the Primary Key column(s) are inbold type. Side label format focuses on a single row and can display more columnsfor the row than the columnar format. Side label format is useful for browsing datain very wide columns.

Use the navigation buttons on the Browse Compare File Table Data dialog toolbarwhen in side label format to scroll the display to another row, or to switch the datadisplay between side label and columnar format. See “Toolbar” on page 18 formore detailed information on display options.

Columnar Format

In columnar format, column names are displayed across the top of the BrowseCompare File Table Data dialog and the data is displayed in columns beneath theheadings. The grid headings of Primary Key column(s) are in bold type.

Chapter 2. Comparing Data – Sample Scenario 17

Page 24: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

The grid contains the data from the compared tables, including the columns fromthe named table, preceded by a Change column and a Source column.

The Change column displays the status of the difference between the Source 1 andSource 2 rows in the comparison, as follows:

Equal Corresponding rows in Source 1 and Source 2 match exactly.

Diff Row in one source differs from the corresponding row in the other source.

Only Row exists in one source, but not in the other.

Dupl Rows have duplicate match keys.

The Source column indicates whether the row resides in Source 1, Source 2, orboth.

Toolbar

The toolbar allows you to select display options and menu choices for the BrowseCompare File Table Data dialog, as follows:

Columnar format button

or Side label format buttonSwitch the data display between columnar and side label format. Thedefault format is set in Personal Options. See the Common Elements Manual.

Options

Display the Options menu on the Browse Compare File Table Data dialog.

Navigation

18 IBM Optim: Compare Introduction

Page 25: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

In side label format, click << to view the first row, click < to view theprevious row, click > to view the next row, and click >> to view the lastrow.

Grid Heading Shortcut Menu

The display can be navigated and customized using options available on the gridheading shortcut menu. Right-click a grid column heading to display a shortcutmenu. For example, you can use the Find command to specify search criteria tolocate a particular value in a grid column, or the Exclude command to specify avalue or string used to exclude rows that contain matching values from thedisplay.

To focus on specific rows of interest, right-click in the Change column heading andselect Exclude from the shortcut menu to display the Exclude dialog. Select Equalin the Find what box, then click Exclude All.

The Browse Compare File Table Data dialog refreshes to exclude the equal rows.

Chapter 2. Comparing Data – Sample Scenario 19

Page 26: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Refer to the Compare User Manual for detailed information on the grid headingshortcut menu, grid column shortcut menu, and Large Object (LOB) columns.

Save Information from a Compare FileCompare Files are stored in a proprietary format; they are not readable whenopened directly with a text editor. However, you can open a Compare File with theBrowse Utility and then save it as an output file that can be read and edited byother programs.

Choose to save the file in a text (.txt) format or a comma-separated (.csv) format.You can save the information from one table or from several tables. The file, oncegenerated, can be opened in a text editor or a spreadsheet application (forcomma-separated format files).

Note: LOB columns are not included in an output file in either format.

Save Compare File Information to Output FileUse this task to save Compare File information as an output file on your computer.You can import the information from an output file into a spreadsheet or database,or you can view the information in the output file using a text editor.

About this task

To save Compare File information as an output file:

Procedure1. Select the pairs of tables you wish to save from the display in the Browse

Compare File dialog.2. Click File → Save as Output File from the menu to open the Windows Save As

dialog.3. Enter the file name for the output file, choose a format, and click Save. For

details on the Windows Save As dialog, refer to Windows Help.

20 IBM Optim: Compare Introduction

Page 27: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Output File FormatsOutput files can be saved in text format or in comma-separated variable format.The format that you choose depends on whether you want to review theinformation using a text editor or whether you want to import the information intoa spreadsheet or database program.

Text Format

This is an example of a portion of a text document version of a Compare File. Ifyou select more than one pair of tables to include in the text document,information for each pair of tables is separated by a header.

Comma-Separated Variable Format

This is an example of a portion of a comma-separated variable version of aCompare File, opened using Microsoft Excel spreadsheet software.

Chapter 2. Comparing Data – Sample Scenario 21

Page 28: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

SummaryThis scenario demonstrated how to create a Compare Request using the CompareRequest Editor, how to run the Compare Process, and how to browse the results ofthe comparison.

You create a Compare Request to specify the parameters required to run theCompare Process and the sources of data to compare, including:v The name of the Compare File in which to store the results of the comparison.v Whether to browse the results of the comparison immediately upon completion.v The mode of comparison – single or multiple tables – and whether the source

data is contained in a Source File, is defined by an Access Definition, or residesin the database.

v The specific location of the data to compare.v The correlation between the tables selected for comparison.

Use the Browse Utility to:v View the contents of a Compare File.v Review a summary of the results of a comparison between each pair of tables.v Browse table data in selected pairs of compared tables.v View Source 1 data, Source 2 data, or data from both sources, side by side.v Browse the contents of a Source File (an Extract or Archive File).

22 IBM Optim: Compare Introduction

Page 29: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Notices

This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document inother countries. Consult your local IBM representative for information on theproducts and services currently available in your area. Any reference to an IBMproduct, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product,program, or service that does not infringe any IBM intellectual property right maybe used instead. However, it is the user's responsibility to evaluate and verify theoperation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matterdescribed in this document. The furnishing of this document does not grant youany license to these patents. You can send license inquiries, in writing, to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.

For license inquiries regarding double-byte (DBCS) information, contact the IBMIntellectual Property Department in your country or send inquiries, in writing, to:

IBM World Trade Asia CorporationLicensing 2-31 Roppongi 3-chome, Minato-kuTokyo 106-0032, Japan

The following paragraph does not apply to the United Kingdom or any othercountry where such provisions are inconsistent with local law:INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THISPUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHEREXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESSFOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express orimplied warranties in certain transactions, therefore, this statement may not applyto you.

This information could include technical inaccuracies or typographical errors.Changes are periodically made to the information herein; these changes will beincorporated in new editions of the publication. IBM may make improvementsand/or changes in the product(s) and/or the program(s) described in thispublication at any time without notice.

Any references in this information to non-IBM Web sites are provided forconvenience only and do not in any manner serve as an endorsement of those Websites. The materials at those Web sites are not part of the materials for this IBMproduct and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way itbelieves appropriate without incurring any obligation to you.

© Copyright IBM Corp. 1994, 2010 23

Page 30: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Licensees of this program who wish to have information about it for the purposeof enabling: (i) the exchange of information between independently createdprograms and other programs (including this one) and (ii) the mutual use of theinformation which has been exchanged, should contact:

IBM CorporationSoftware Interoperability Coordinator, Department 49XA3605 Highway 52 NRochester, MN 55901U.S.A.

Such information may be available, subject to appropriate terms and conditions,including in some cases, payment of a fee.

The licensed program described in this information and all licensed materialavailable for it are provided by IBM under terms of the IBM Customer Agreement,IBM International Program License Agreement, or any equivalent agreementbetween us.

Any performance data contained herein was determined in a controlledenvironment. Therefore, the results obtained in other operating environments mayvary significantly. Some measurements may have been made on development-levelsystems and there is no guarantee that these measurements will be the same ongenerally available systems. Furthermore, some measurements may have beenestimated through extrapolation. Actual results may vary. Users of this documentshould verify the applicable data for their specific environment.

Information concerning non-IBM products was obtained from the suppliers ofthose products, their published announcements or other publicly available sources.IBM has not tested those products and cannot confirm the accuracy ofperformance, compatibility or any other claims related to non-IBM products.Questions on the capabilities of non-IBM products should be addressed to thesuppliers of those products.

All statements regarding IBM's future direction or intent are subject to change orwithdrawal without notice, and represent goals and objectives only.

All IBM prices shown are IBM's suggested retail prices, are current and are subjectto change without notice. Dealer prices may vary.

This information is for planning purposes only. The information herein is subject tochange before the products described become available.

This information contains examples of data and reports used in daily businessoperations. To illustrate them as completely as possible, the examples include thenames of individuals, companies, brands, and products. All of these names arefictitious and any similarity to the names and addresses used by an actual businessenterprise is entirely coincidental.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, whichillustrate programming techniques on various operating platforms. You may copy,modify, and distribute these sample programs in any form without payment toIBM, for the purposes of developing, using, marketing or distributing applicationprograms conforming to the application programming interface for the operating

24 IBM Optim: Compare Introduction

Page 31: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

platform for which the sample programs are written. These examples have notbeen thoroughly tested under all conditions. IBM, therefore, cannot guarantee orimply reliability, serviceability, or function of these programs.

Each copy or any portion of these sample programs or any derivative work, mustinclude a copyright notice as follows:

© (your company name) (year). Portions of this code are derived from IBM Corp.Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rightsreserved.

If you are viewing this information softcopy, the photographs and colorillustrations may not appear.

TrademarksIBM, DB2, Informix, Optim, the IBM logo, and ibm.com® are trademarks orregistered trademarks of International Business Machines Corporation in theUnited States, other countries, or both. If these and other IBM trademarked termsare marked on their first occurrence in this information with a trademark symbol(® or ™), these symbols indicate U.S. registered or common law trademarks ownedby IBM at the time this information was published. Such trademarks may also beregistered or common law trademarks in other countries. A current list of IBMtrademarks is available on the Web at “Copyright and trademark information” atwww.ibm.com/legal/copytrade.shtml.

Microsoft, Windows, and Windows NT are trademarks of Microsoft Corporation inthe United States, other countries, or both.

Other company, product, or service names may be trademarks or service marks ofothers.

Notices 25

Page 32: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

26 IBM Optim: Compare Introduction

Page 33: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

Index

BBrowse Compare File dialog 12Browse Results 5, 10Browse Table Data 16Browse Utility 12, 22

Extended Compare TableInformation 15

Extract and Control Files 12, 22Information tab 14save Compare File information 20table data 16, 20Tables tab 13

CColumn Map ID 8Compare File 5

browsing 12, 22Compare Process Parameters 5Compare Process Report 11Compare Request 3, 11

description 4Editor 3General tab 3, 5Progress dialog 10report 11run 10save 12Source tab 6

Comparison Mode 5Control Files

browsing 12, 22example 21

DDialogs and Editors

grid heading shortcuts 19

EEnvironment 1Exclude 19Extract File

browsing 12, 22Extract Process Report 11

GGrid Heading Shortcut Menu 19

HHelp 3

KKey Functions 3

MMatch Key

description of 8Editor 9

OOverview 1

SSample Database 1Sample Extract File 3Save

Compare File information 20Compare Request 12

Summary 22

TTable Map 6

qualifier 7Table Map Editor 7, 8tables 8

Table Map Editor 7, 8Toolbar Buttons 18

© Copyright IBM Corp. 1994, 2010 27

Page 34: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

28 IBM Optim: Compare Introduction

Page 35: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management
Page 36: IBM Optim: Compare Introductionbdavis/Optim/Docs/CompareIntro.pdf · DB2®, Oracle, Sybase Adaptive Server Enterprise (ASE), Microsoft SQL Server, and IBM Informix® database management

����

Printed in USA