DB Views_How to Guide
-
Upload
hemanth-k-racherla -
Category
Documents
-
view
165 -
download
1
Transcript of DB Views_How to Guide
SAP NetWeaverHow-To Guide
How-To Install and Use DB Views
Applicable Releases:
SAP MDM NetWeaver 5.5 SP6
Version 1.0
February 2008
© Copyright 2008 SAP AG. All rights reserved.
No part of this publication may be reproduced or
transmitted in any form or for any purpose without the
express permission of SAP AG. The information contained
herein may be changed without prior notice.
Some software products marketed by SAP AG and its
distributors contain proprietary software components of
other software vendors.
Microsoft, Windows, Outlook, and PowerPoint are
registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel
Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390,
OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP,
Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix,
i5/OS, POWER, POWER5, OpenPower and PowerPC are
trademarks or registered trademarks of IBM Corporation.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader
are either trademarks or registered trademarks of Adobe
Systems Incorporated in the United States and/or other
countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered
trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame,
WinFrame, VideoFrame, and MultiWin are trademarks or
registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or
registered trademarks of W3C®, World Wide Web
Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems,
Inc., used under license for technology invented and
implemented by Netscape.
MaxDB is a trademark of MySQL AB, Sweden.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP
NetWeaver, and other SAP products and services
mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in
Germany and in several other countries all over the world.
All other product and service names mentioned are the
trademarks of their respective companies. Data contained
in this document serves informational purposes only.
National product specifications may vary.
These materials are subject to change without notice.
These materials are provided by SAP AG and its affiliated
companies ("SAP Group") for informational purposes only,
without representation or warranty of any kind, and SAP
Group shall not be liable for errors or omissions with
respect to the materials. The only warranties for SAP
Group products and services are those that are set forth in
the express warranty statements accompanying such
products and services, if any. Nothing herein should be
construed as constituting an additional warranty.
These materials are provided “as is” without a warranty of
any kind, either express or implied, including but not
limited to, the implied warranties of merchantability,
fitness for a particular purpose, or non-infringement.
SAP shall not be liable for damages of any kind including
without limitation direct, special, indirect, or consequential
damages that may result from the use of these materials.
SAP does not warrant the accuracy or completeness of the
information, text, graphics, links or other items contained
within these materials. SAP has no control over the
information that you may access through the use of hot
links contained in these materials and does not endorse
your use of third party web pages nor provide any warranty
whatsoever relating to third party web pages.
SAP NetWeaver “How-to” Guides are intended to simplify
the product implementation. While specific product
features and procedures typically are explained in a
practical business context, it is not implied that those
features and procedures are the only approach in solving a
specific business problem using SAP NetWeaver. Should
you wish to receive additional information, clarification or
support, please refer to SAP Consulting.
Any software coding and/or code lines / strings (“Code”)
included in this documentation are only examples and are
not intended to be used in a productive system
environment. The Code is only intended better explain and
visualize the syntax and phrasing rules of certain coding.
SAP does not warrant the correctness and completeness of
the Code given herein, and SAP shall not be liable for
errors or damages caused by the usage of the Code, except
if such damages were caused by SAP intentionally or
grossly negligent.
Disclaimer
Some components of this product are based on Java™. Any
code change in these components may cause unpredictable
and severe malfunctions and is therefore expressively
prohibited, as is any decompilation of these components.
Any Java™ Source Code delivered with this product is only
to be used by SAP’s Support Services and may not be
modified or altered in any way.
Typographic ConventionsType Style Description
Example Text Words or characters quotedfrom the screen. Theseinclude field names, screentitles, pushbuttons labels,menu names, menu paths,and menu options.
Cross-references to otherdocumentation
Example text Emphasized words orphrases in body text, graphictitles, and table titles
Example text File and directory names andtheir paths, messages,names of variables andparameters, source text, andnames of installation,upgrade and database tools.
Example text User entry texts. These arewords or characters that youenter in the system exactly asthey appear in thedocumentation.
<Exampletext>
Variable user entry. Anglebrackets indicate that youreplace these words andcharacters with appropriateentries to make entries in thesystem.
EXAMPLE TEXT Keys on the keyboard, forexample, F2 or ENTER.
IconsIcon Description
Caution
Note or Important
Example
Recommendation or Tip
Table of Contents
1. Introduction and Background Information.....................................................................1
2. Business Scenarios.........................................................................................................2
3. Technical Data.................................................................................................................2
4. Prerequisites....................................................................................................................2
5. Step-by-Step Procedure..................................................................................................3
5.1 Prepare the Environment ..........................................................................................3
5.2 Edit the GenerateViews.cmd Configuration Options File............................................3
5.3 Execute ....................................................................................................................4
6. Appendix..........................................................................................................................5
6.1 Appendix A – DB Views Naming Convention.............................................................5
6.2 Appendix B - Presentation Rules for MDM Field Types..............................................7
How-To Install and Use DB Views
September 2008 1
1. Introduction and Background InformationDatabase Views (DB Views) are used to view a snapshot of data stored in a particular database. TheMDM DB Views utility generates database views which are saved database queries representingMDM Data.
The created views retrieve data that is stored in the MDM repository and present it in a comprehensiveway, similarly to the way data is displayed in SAP MDM Data Manager. The view is generatedaccording to the underlying database schema.
MDM DB Views behave as follows:
Use a joint set of operations to combine related tables and present a single view per main table.
Use a set of presentation rules for each MDM field type in order to get a consistentrepresentation across different DB vendors.
Create a separate view for each multi-value main table lookup field.
The generated DB views are read-only views. They are not designed to write data intothe MDM repository.
Overview
How-To Install and Use DB Views
September 2008 2
2. Business ScenariosThe following are possible scenarios for using SAP MDM DB Views:...
Data Warehouse Interfaces (Analytical MDM)
MDM is the only technology that can successfully deal with the fundamental root cause of dataquality problems impacting BI across-the-board.MDM, with the aid of DB Views, can provide consolidated, consistent, and accurate master datadimensions (for example, Customer, Supplier, Product and Location) for any BI application inreal time without involving data replication or file exchange between applications.
Reporting
Data is consolidated for reporting. MDM DB Views make master data accessible to anyreporting tool and are able to create formatted reports against the MDM repository.
Data Profiling Analysis
Master data and metadata can be exposed to any data profiling application.
External Matching
Master data is made accessible to any external matching tool.
3. Technical Data The DB Views utility runs on any Windows platform.
Only MDM version 5.5 SP5 and SP6 are supported.
Supported databases are:
Oracle v9 and up
MSSQL 2005
IBM DB2 LUW v9 and up
4. Prerequisites MDM Java API version which corresponds to the MDM Server version
Java Runtime Environment, JRE 1.5.x
Type 2 JDBC Drivers according to the MDM database server type
MSSQL – Version 1.1
Oracle – Oracle client
IBM DB2 – DB2 client
MDM and the database server can be on any supported platform. Only the DB Viewsutility requires a Windows platform for the creation process.
How-To Install and Use DB Views
September 2008 3
5. Step-by-Step Procedure
5.1 Prepare the Environment1. Install the Java Runtime Environment.
2. Install the relevant JDBC Driver.
3. Unzip the DB Views execution package.Recommended Folder location: C:\Program Files\SAP MDM 5.5\DB Views
4. Install MDM Java API and make sure that the MDM Server and the MDM Java API are of thesame version.
5.2 Edit the GenerateViews.cmd Configuration Options FileParameters Description
MDMDbV_HOME Folder location of the unzipped DB Views execution package
Database home Folder location of the database client directory (SQL_HOME, DB2_HOME,ORA_HOME)
MDM JAVA API(API_DIR) Folder location of the MDM Java API
MDM Server The server on which the MDM repository is mounted
MDM Repository The repository for which you would like to generate and maintain views
MDM ServerPassword Optional – User password for performing any server-level functions
MDM User Name Optional – Name of user who is connecting to the MDM repository andperforming any repository-level functions
MDM UserPassword
Optional – User password for connecting to the MDM repository and performingany repository-level functions
MDM region
The regions for which the views are created
To specify 2 or more regions use ‘ : ‘ as a delimiter
To specify all regions, remove variable and instances
Database type Type of database
MDM DBMS name The database server on which the MDM repository is stored
Database UserName Optional – The user connecting to the database server
Database Password Optional – The database user’s password
Display FieldDelimiter The delimiter for concatenation of the table’s display fields
Hierarchy Full PathDelimiter The delimiter for the full path of the hierarchy
How-To Install and Use DB Views
September 2008 4
Parameters Description
IS_LOG Optional – To produce a log file, set to "-LOG"
IS_OVERRIDE
Optional – To override existing views, set to “-override"
This option is preferable due to schema changes that may disable views.
IS_DELETE_ALL Optional – To delete All DB views mode, set to "-D"
...
5.3 ExecuteExecute the GenerateViews.cmd file.
How-To Install and Use DB Views
September 2008 5
6. Appendix
6.1 Appendix A – DB Views Naming ConventionThe views are named according to the following naming convention. Underscore is the delimiterbetween tokens.
Main Table
[1st token] – ‘M’ constant string, stands for main table view
[2nd token] – Main table code
[3rd token] – Language Id
If the resulting view name exceeds the maximum length allowed by the DB, the 2nd tokenwill be truncated and a table id will be appended, within the maximum length allowed.
For example, the main table is Products and the language is English (Language Id =1).
The resulting View name is: ‘M_PRODUCTS_1’
Lookup Table
[1st token] – ‘F’ for Flat , ‘H’ for Hierarchy and Taxonomy
[2nd token] – Lookup table code
[3rd token] – Language Id
For example, flat lookup table name is MDM_NUMBER_RANGES_ACCOUNT_GROUPS inEnglish [US] and its Id is 38, stored in Oracle DB (maximum view length is 30).
The resulting view name is: ‘F_MDM_NUMBER_RANGE_38_1’
Multivalue and Large text Fields
[1st token] – ‘M’ for multivalue, qualified
[2nd token] – Table code concatenated with lookup field code, underscore as delimiter
[3rd token] – Language Id
For example, the flat lookup table name is MDM_NUMBER_RANGES_ACCOUNT_GROUPS inEnglish [US], and the lookup field is “RANGES.
The resulting view name is:‘M_ MDM_NUMBER_RANGES_ACCOUNT_GROUPS _RANGES_1’
Relationship Fields
[1st token] – ‘REL’ constant prefix, stands for relationship view
[2nd token] – CodeName
[3rd token] – Language Id
How-To Install and Use DB Views
September 2008 6
Taxonomy Attributes
[1st token] – ‘T_Taxonomy’ constant prefix, stands for relationship view
[2nd token] – CodeName
[3rd token] – Language Id
Table’s Remote Keys
[1st token] – M’ constant string, stands for main table view
[2nd token] – Table CodeName
[3rd token] –‘ Keys’ constant postfix, stands for Remote keys view
How-To Install and Use DB Views
September 2008 7
6.2 Appendix B - Presentation Rules for MDM FieldTypes
A presentation rule for each MDM field type is applied in order to determine how it is formatted in theviews. There are differences between the way MDS presents and formats the data, and the way it isstored in the DB.
Simple Lookup Fields
Field Type Presentation rule
Text According to DB variable-length, Unicode data field format, and the selectedlanguage.
Text Normalized According to DB variable-length, Unicode data field format, and the selectedlanguage.
Text Large
According to DB variable-length, Unicode data field format, and the selectedlanguage.
Contains square characters as a delimiter between log entries
Integer According to DB field format
Real Decimal places according to field parameter
Boolean TRUE/FALSE values according to field parameter
Literal Date Date field data type with time portion truncated (12:00:00)
Literal Time Date field data type with date portion truncated (01-01-1970)
Lookup [Flat] According to the display field definition, a text field should be presented according tothe selected language.
Lookup[Hierarchy/
Taxonomy]
According to the hierarchy table primary display field definition. The hierarchy nodename should be fully visible with a user defined separator between each node nameof the full hierarchy path.
For example, Tools Hand Tools Hammer
Lookup[Text Block]
According to the TextStart field concatenated with the TextRest field ofA2i_Data_Ex_# table, within a text field size limitation of the DB vendor
Lookup[Text HTML]
According to the TextStart field concatenated with the TextRest field ofA2i_Data_Ex_# table, within a text field size limitation of the DB vendor
Auto ID According to DB field format
Time Stamp Date field data type
Create Stamp mm-dd-yy hh-mm-ss AM (or PM) in datetime data type
User Stamp According to DB field format
Currency Symbol and Decimal places according to field parameter
GM Time Date field data type
How-To Install and Use DB Views
September 2008 8
Field Type Presentation rule
LogConverted to text, within the text field size limitation of the DB in use
Contains square characters as a delimiter between log entries
Measurement Decimal places according to field parameter, postfix value with UOM name
If the field is a display field in a lookup table, the field will be converted to a text stringand will be formatted the same as in the default setting of the Data Manager.
Multivalue Field Types:Each of the following multivalue field types is implemented as a separate view. In order to preservethe reference, each view includes the internal record ID of the referencing table.
Flat Lookup
Hierarchy Lookup
Lookup Text Block
Lookup Text HTML
Measurement
Qualified Lookup
The views definition follows the underlying qualified table definition, considering the presentationrules of simple field types, and including the internal record ID of the referencing table.
Any multivalue qualifier of the following field types (lookup flat, lookup hierarchy, andmeasurement), will be joined to the qualified lookup field view.
Taxonomy Lookup:The view is defined according to the following format, including the internal record ID of the main table.
Attribute Name
Attribute name is concatenated from the tokens identified below for each attribute type. Theseparator is a space between each token. The attribute name includes its ratings in brackets.Valid values for ratings are (Min), (Max) and (Nom).
Text
[1st token] – AttrName
Numeric
[1st token] – AttrName
[2nd token] – AttrType(Ratings)
Coupled
[1st token] – AttrName
[2nd token] – AttrType(Ratings)
[3rd token] – CoupledDelimiter
How-To Install and Use DB Views
September 2008 9
[4th token] – CoupledAttrName
[5th token] – CoupledAttrtType
Attribute Value
Attribute value of each attribute type is concatenated from the tokens identified below. Theseparator is a space between each token. The attribute value includes unit of measure using itssuffix notation.
Text
[1st token] – FeatureName in the chosen language
Numeric – Value
[1st token] – Value, including the decimal places defined for the attribute in MDM
[2nd token] – Units
Coupled
[1st token] – Value, including the decimal places defined for the attribute in MDM
[2nd token] – Units
[3rd token] – CoupledDelimiter
[4th token] – CoupledValue, including the decimal places defined for the attributein MDM
[5th token] – CoupledUnits
For example, View format
ID Attribute Name Attribute Value
1 Length 13.000 mm2 Length @ Size 12 mm @ 1 cm
Product RelationshipA view is created for each relationship.
www.sdn.sap.com/irj/sdn/howtoguides