Micro Focus Data Express
Copyright 2007-2008 Micro Focus (IP) Ltd. All rights reserved. Micro Focus (IP) Ltd. has made every effort to ensure that this book is correct and accurate, but reserves the right to make changes without notice at its sole discretion at any time. The software described in this document is supplied under a license and may be used or copied only in accordance with the terms of such license, and in particular any warranty of fitness of Micro Focus software products for any particular purpose is expressly excluded and in no event will Micro Focus be liable for any consequential loss. Animator, COBOL Workbench, EnterpriseLink, Mainframe Express, Micro Focus, Net Express, REQL, and Revolve are registered trademarks, and AAI, Analyzer, Application Server, Application to Application Interface, AddPack, AppTrack, AssetMiner, CCI, DataConnect, Dialog System, Enterprise Server, Enterprise Server with MTO, EuroSmart, FixPack, LEVEL II COBOL, License Server, Mainframe Access, Mainframe Manager, Micro Focus COBOL, Micro Focus Studio, Micro Focus Server, Object COBOL, OpenESQL, Personal COBOL, Professional COBOL, Server Express, SmartFind, SmartFind Plus, SmartFix, SourceConnect, SupportLine, Toolbox, VS COBOL, WebSync, and Xilerator are trademarks of Micro Focus (IP) Ltd. IBM and CICS are registered trademarks, and IMS, DB2, DB2/390, DB2 Connect Enterprise Edition, DB2 Connect Personal Edition, COBOL for OS/390, Enterprise Systems Architecture/390, ESA/390, MVS, MVS/ESA, OS/390, S/390, System/390, VSE/ESA, and MFS are trademarks, of International Business Machines Corporation. Netscape Enterprise Server is a trademark of Netscape Communications Corporation. Internet Information Server, SQL Server, Visual Studio, Windows 95, Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows Server, Windows XP, and Windows Vista are registered trademarks of Microsoft Corporation in the United States and other countries. Pentium is a registered trademark of INTEL Corporation. Borland Database Engine and MIDAS are trademarks of Borland Software Corporation. Oracle is a trademark of Oracle Corporation Inc. UNIX is a registered trademark of The Open Group. Solaris, Ultra Sparc, and Java are trademarks of Sun Microsystems, Inc. Linux, GCC compiler, GNU CTAGS, GNU DIFF, Samba, and KDE/GNOME refer to Open Source tools. This product includes modified versions of software developed by the Apache Software Foundation (as described on the Apache web site). The YGrep Search Engine is Copyright (c) 1992-2004 Yves Roumazeilles. All other trademarks are the property of their respective owners. No part of this publication, with the exception of the software product user documentation contained on a CD-ROM, may be copied, photocopied, reproduced, transmitted, transcribed, or reduced to any electronic medium or machine-readable form without prior written consent of Micro Focus (IP) Ltd. Contact your Micro Focus representative if you require access to the modified Apache Software Foundation source files.
Licensees may duplicate the software product user documentation contained on a CD-ROM, but only to the extent necessary to support the users authorized access to the software under the license agreement. Any reproduction of the documentation, regardless of whether the documentation is reproduced in whole or in part, must be accompanied by this copyright statement in its entirety, without modification. U.S. GOVERNMENT RESTRICTED RIGHTS. It is acknowledged that the Software and the Documentation were developed at private expense, that no part is in the public domain, and that the Software and Documentation are Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFAR 252.227-7013 et. seq. or subparagraphs (c)(1) and (2) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable. Contractor is Micro Focus (IP) Ltd, 9420 Key West Avenue, Rockville, Maryland 20850. Rights are reserved under copyright laws of the United States with respect to unpublished portions of the Software.
4
5 Table of Contents Table of Contents... 5 1. About this Guide... 7 2. Who Should Read this Guide... 9 3. SQL Server Module Considerations... 11 4. Operational Flow... 13 5. Installing and Using SQL Server Module... 15 5.1. Requirements... 15 5.1.1. Software... 15 5.1.2. Databases... 15 5.2. Installation... 16 5.3. Post Installation Configuration... 16 5.4. SQL Server Module Execution... 17 5.5. Error Diagnosis... 18 Appendix A. ODBC DSN Alias Creation... 15 Appendix B. Supplementary Information... 21 B.1. Data Types... 21 B.1.1. Size Restricted... 21 B.1.2. Not Supported... 21 B.1.3. Format Restricted... 21 B.2. Building Masking Routines... 22
6
7 1. About this Guide This guide outlines the concepts and procedures used by the Data Express SQL Server module. The SQL Server module is an extension that adds functionality to the three modules: Data, Data Masking, and Data Subset Extraction in order to use Data Express within the SQL Server environment. The SQL Server module enables usage of the following Data Express functions: Database Loader Database Mapper File Exporter for data masking File Exporter for data subsetting
8
9 2. Who Should Read this Guide This guide is for Micro Focus users who are interested in managing the privacy of data or in extracting a subset of data contained in a SQL Server environment. It explains the SQL Server module installation procedure, and describes the steps required to configure information and execute the SQL Server module. The use of the SQL Server module requires a minimum experience of configuring ODBC data source names on Windows platforms. Before using the SQL Server module, we recommend you carefully read the following user guides: Micro Focus Data Express Front End User Guide Micro Focus Data Express Data Masking User Guide Micro Focus Data Express Data Subset Extraction User Guide
10
11 3. SQL Server Module Considerations Bear in mind the following points about the SQL Server module for Data Express: You do not need to analyze the sources of the programs in the application in order to use the SQL Server module. Non-DB2 database functions do not perform any operation capable of altering the analyzed data.
12
13 4. Operational Flow The following table describes the operational flow for working with SQL Server data sources within Data Express: Step Instruction Reference 1 Configure the Borland Database Engine to catalog your server. Note: Data Express must be configured in Standard mode to provide direct access to data on the RDBMS from your PC. 2 Use the Non-DB2 Database Mapping window in the Data module to catalogue your source and target databases. 3 Use the Non-DB2 Database Loader window in the Data module to define the mapped SQL Server tables for with you want to work. Appendix A. ODBC DSN Alias Creation. Chapter Non-DB2 Database Mapping in the Micro Focus Data Express Front End User Guide. Chapter Non-DB2 Database Loader in the Micro Focus Data Express Front End User Guide. 4 Define classes and associate them with the appropriate fields. Chapter Work with Classes in the Micro Focus Data Express Front End User Guide. 5 Use Data Masking to define business protection rules, as required. - or- Use Data Subset Extraction to define subset extraction rules, as required. 6 Use the File Exporter for Non-DB2 Database window in Data Masking or in Data Subset Extraction to generate the files required for executing the SQL Server module. Chapter File Exporter for Non-DB2 Database in the Micro Focus Data Express Data Masking User Guide. Chapter File Exporter for Non-DB2 Database in the Micro Focus Data Express Data Subset Extraction User Guide. Micro Focus Data Express Data Masking User Guide. Micro Focus Data Express Data Subset Extraction User Guide. 7 Execute the SQL Server module. Section SQL Server Module Execution in the chapter Getting Started.
14
15 5. Installing and Using SQL Server Module This chapter provides an overview of the SQL Server module. You should read it before using the module. 5.1. Requirements A 32-bit cataloged ODBC data source name, which uses SQL Server authentication, is required for both the source and target database. 5.1.1. Software The following software items are required for the SQL Server module: Microsoft Windows 2000, Windows XP, Windows Server 2003, or Windows Vista Microsoft SQL Server 2005 Microsoft Visual Studio 2003 or later Note: Microsoft Visual Studio is only required if you want to rebuild or create masking routines. 5.1.2. Databases Information for the following database items is required during SQL Server configuration: Source database Name of the database containing the original data. Target database Name of the database where the masked or reduced data are written. Repository Name of the database where the tables containing configuration information for the SQL Server module are written. The collection of tables is also referred to as the SQL Server module knowledge base. Note: The specified user must have insert/update access to the repository. Typically, the target database is used to store the repository. For each database, the following information is required: SQL Server instance name database name user ID password
16 5.2. Installation To install the SQL Server module, extract the files contained in the DE35_MSSQL.zip file of the installation media into an empty directory. This directory is referred to as your SQL Server module installation directory. 5.3. Post Installation Configuration Before you can use the SQL Server module, you need to populate the knowledge base. To configure post installation information: 1. Identify the database and schema within which the knowledge base can be stored. 2. From a Windows command prompt, change to the knowledgebase subdirectory within your SQL Server module installation directory. 3. Setup the knowledge base by executing the following command: setupkb server_name[\instance_name[,port_number]] database_name login_id where server_name specifies the name of the SQL Server with which you want to connect. To use the default instance on a given machine, specify only the server name, for example: setupkb MYSERVER database_name login_id setupkb (local) database_name login_id instance_name specifies the name of the named instance. To use a named instance, include a backward slash and the name of the instance after the server name, for example: setupkb MYSERVER\SQLEXPRESS database_name login_id port_number specifies the number for an explicit TCP/IP port for the specified server. To use an explicit port number, include the port number after a comma and surround all server information in double quotes, for example: setupkb (local)\sqlexpress,1433 database_name login_id database_name specifies the name of the database to use for the specified server, for example, pubs. login_id specifies the user name for the specified database where the SQL Server module knowledge base is stored. Note: Depending on the configuration of your SQL Server instance, your login ID and the database name may be case sensitive.
17 4. Update the file hdblayer.ini, which is located in the root directory of your SQL Server module installation, to reflect the configuration information now stored in the knowledge base. Edit information in the file as follows: RDBMS = MSSQL DBNAME = ODBC_DSN_Name DBOWNER = Schema_Name USER = UserID PSWD = Password DBNAME Name of the ODBC data source which catalogs the database where the SQL Server module knowledge base is stored. DBOWNER Name of the database schema for the database where the SQL Server module knowledge base is stored. USER and PSWD Connection criteria for accessing the specified database. Note: The RDBMS entry should remain as MSSQL. 5. Encrypt the hdblayer.ini file and generate the file hdblayer.rc within the same directory by executing the following command: HURKernelEncrypt hdblayer Note: For security purposes, you may want to reset the contents of the file hdblayer.ini. 6. Copy the files that were generated by the File Exporter for Non-DB2 Database into the config subdirectory, for use by the SQL Server module. 5.4. SQL Server Module Execution By default, the SQL Server module will attempt to insert the processed data into the target database. For testing purposes, it is possible to configure the SQL Server module to instead write the processed data into text files as comma separated values (.csv). To execute the SQL Server module: 1. If you intend to use Data Masking to conceal data, execute the following command: BPStart 2. If you intend to use Data Subset Extraction, execute the following command: DSEStart Note: If the data has already been masked, the masking rules are processed as part of the class definition for Data Subset Extraction. 3. The SQL Server module processes all the tables previously specified within Data Express, and reports a status for each table, for example: Table Table1: n records transferred. Done. Table Table2: n records transferred. Done.
18 Table Table3: n records transferred. Done. KbXDSE finished OK 5.5. Error Diagnosis When errors occur during the execution of the SQL Server module, messages are written to the file KbXDataErrorLog.txt, which is located in the log directory. If you are unable to resolve errors, contact Micro Focus SupportLine for technical assistance; provide the KbXDataErrorLog.txt file, along with the files in the config directory and the DDL for the tables being processed.
19 Appendix A. ODBC DSN Alias Creation In order to use the SQL Server module, you must first create an alias within the Borland Database Engine, in order to communicate with the ODBC DSN cataloged for your source database. To create an ODBC DSN alias: 1. Open BDE Administrator (from the Control Panel). Click Object > New: 2. In the Database Driver Name list, click SQL Native Client, and then OK to create the database alias as shown in Figure A-1: Figure A-1: BDE Administrator Database Alias Definition 3. Enter the database alias name in the All Database Aliases pane, and click Object > Apply.
20 4. In the Definition of pane, click in the second column for ODBC DSN to display a list of ODBC data source names that have been configured for connection to your source database. Select the appropriate ODBC data source name, and click Object > Apply as shown in Figure A-2: Figure A-2: BDE Administrator ODBC Data Source Names 5. If the database within which you intend to store the processed data is not your source database, repeat steps 1-4 for the target database.
21 Appendix B. Supplementary Information This appendix lists supplementary information that may become useful when using the SQL Server module. B.1. Data Types This section lists additional information for SQL Server data types. For a complete list of supported data types, see the section List of File Fields in the chapter Data Changer Field Selection in the Micro Focus Data Express Data Masking User Guide. B.1.1. Size Restricted The SQL Server module has a size restriction of 1048576 bytes when processing the following data types: IMAGE TEXT VARBINARY VARBINARY(MAX) VARCHAR(MAX) XML B.1.2. Not Supported The SQL Server module does not work with the following SQL Server data types: NCHAR NTEXT NVARCHAR NVARCHAR(MAX) Sql_variant (SQL_VAR) B.1.3 Format Restricted The content of fields using the DATETIME or SMALLDATETIME data type for subset extraction rules must be specified using the format as documented by Microsoft within the SQL Server documentation.
22 B.2. Building Masking Routines The SQL Server module ships with pre-built masking routines, as documented in the Micro Focus Data Express Data Masking User Guide. The sources are also provided, along with a makefile, if you want to amend the routines. In order to build the masking routines, from within a Visual Studio command prompt, change to the SQL Server module installation directory, and execute the nmake command.