Saturday, September 11, 2021

ODI - Creating the Master and Work Repository Schemas

Creating the Master and Work Repository Schemas

Before you can configure an Oracle Data Integrator domain, you must create the Master and Work Repository (ODI_REPO) schemas on a certified database for use with this release of Oracle Fusion Middleware.

Configuring a Certified Database

Before you begin, make sure you have installed and configured a certified database


Starting the Repository Creation Utility

Navigate to the ORACLE_HOME/oracle_common/bin directory:

Start RCU.

On UNIX operating systems:

./rcu

On Microsoft Windows operating systems:

rcu.bat

Navigating the Repository Creation Utility Screens to Create the Schema

Start RCU - Click Next.

Select a Repository Creation Method.

If you have permission to perform DBA activities on your database, select System Load and Product Load Concurrently.

Provide the database connection details for RCU to connect to your database. Click Next to proceed, then click OK on the dialog window confirming that connection to the database was successful.

Select Create a new prefix, specify a custom prefix, then select the Oracle Data Integrator schema.

If you are running RCU from a Standalone installation, you will see the following:

Select Oracle Data Integrator and click Next to proceed, then click OK on the dialog window confirming that prerequisite checking for schema creation was successful.

Specify how you want to set the schema passwords on your database, then specify and confirm your passwords.

Specify the custom variables for the Master and Work Repository

Navigate through the remainder of the RCU screens to complete schema creation. When you reach the Completion Summary screen, click Close to dismiss RCU.

Steps with screenshots:





















For  more details: https://docs.oracle.com/middleware/1221/core/ODING/GUID-25AC5AEE-D46D-4E4B-8835-4C1FE32207CC.htm#ODING860

ODI - Creating and Using Data Models and Datastores

 Introduction to Models:

A Model is the description of a set of datastores. It corresponds to a group of tabular data structures stored in a data server. A model is based on a Logical Schema defined in the topology. In a given Context, this Logical Schema is mapped to a Physical Schema. The Data Schema of this Physical Schema contains physical data structure: tables, files, JMS messages, elements from an XML file, that are represented as datastores.

Models as well as all their components are based on the relational paradigm (table, attributes, keys, etc.). Models in Data Integrator only contain Metadata, that is the description of the data structures. They do not contain a copy of the actual data.

Datastores:

A datastore represents a data structure. It can be a table, a flat file, a message queue or any other data structure accessible by Oracle Data Integrator.

A datastore describes data in a tabular structure. Datastores are composed of attributes.

As datastores are based on the relational paradigm, it is also possible to associate the following elements to a datastore:


Keys

A Key is a set of attributes with a specific role in the relational paradigm. Primary and Alternate Keys identify each record uniquely. Non-Unique Indexes enable optimized record access.

References

A Reference is a functional link between two datastores. It corresponds to a Foreign Key in a relational model. For example: The INVOICE datastore references the CUSTOMER datastore through the customer number.

Conditions and Filters

Conditions and Filters are a WHERE-type SQL expressions attached to a datastore. They are used to validate or filter the data in this datastore.

Data Integrity

A model contains constraints such as Keys, References or Conditions, but also non-null flags on attributes. Oracle Data Integrator includes a data integrity framework for ensuring the quality of a data model.

This framework allows to perform:

Static Checks to verify the integrity of the data contained in a data model. This operation is performed to assess the quality of the data in a model when constraints do not physically exist in the data server but are defined in Data Integrator only.

Flow Check to verify the integrity of a data flow before it is integrated into a given datastore. The data flow is checked against the constraints defined in Oracle Data Integrator for the datastore that is the target of the data flow.


Reverse-engineering

A new model is created with no datastores. Reverse-engineering is the process that populates the model in Oracle Data Integrator by retrieving metadata from the data server containing the data structures. There are two different types of reverse-engineering:

Standard reverse-engineering uses standard JDBC driver features to retrieve the metadata. Note that unique keys are not reverse-engineered when using a standard reverse-engineering.

Customized reverse-engineering uses a technology-specific Reverse Knowledge Module (RKM) to retrieve the metadata, using a method specific to the given technology. This method is recommended if a technology specific RKM exists because it usually retrieves more information than the Standard reverse-engineering method.


Creating and Reverse-Engineering a Model

Now that the key components of an ODI model have been described, an overview is provided on how to create and reverse-engineer a model:

Creating a Model

Creating a Model and Topology Objects

Reverse-engineering a Model


Creating a Model

A Model is a set of datastores corresponding to data structures contained in a Physical Schema.

To create a Model:

In Designer Navigator expand the Models panel.

Right-click then select New Model.

Fill in the following fields in the Definition tab:

Name: Name of the model used in the user interface.

Technology: Select the model's technology.

Logical Schema: Select the Logical Schema on which your model will be based.

On the Reverse Engineer tab, select a Context which will be used for the model's reverse-engineering.

Note that if there is only one context that maps the logical schema, this context will be set automatically.

Select Save from the File main menu.

The model is created, but contains no datastore yet.


Creating a Model and Topology Objects

You can create a Model along with other topology objects, including new data servers, contexts and schemas, at the same time:

In ODI Studio, select File and click New....

In the New Gallery dialog, select Create a New Model and Topology Objects and click OK.

The Create New Model and Topology Objects wizard appears.

In the Model panel of the wizard, fill in the following fields.

Name: Name of the model used in the user interface.

Technology: Select the model's technology.

Logical Schema: Select the Logical Schema on which your model will be based.

Context: Select the context that will be used for the model's reverse-engineering.

Click Next.

In the Data Server panel of the wizard, fill in the following data server fields.

Name: Name of the data server, as it appears in the user interface.

Note: or naming data servers, it is recommended to use the following naming standard: <TECHNOLOGY_NAME>_<SERVER_NAME>.

Technology: Technology linked to the data server.

Note: Appears only if the Technology selected for the Model is of the type Generic SQL.

User: User name used for connecting to the data server.

Password: Password linked with the user name.

Note: This password is stored encrypted in the repository.

Driver List: Provides a list of available drivers available to be used with the data server.

Driver: Name of the driver used for connecting to the data server.

URL: Provides the connection details.

Properties: Lists the properties that you can set for the selected driver.

Click Next.

In the Physical Schema panel of the wizard, fill in the physical schema fields.

Name: Name of the physical schema. It is calculated automatically and is read-only.

Datasource (Catalog): Name of the catalog in the data server.

Note: Appears only if the Technology selected supports Catalogs.

Schema (Schema): Name of the schema in the data server. Schema, owner, or library where the required data is stored.

Note: Oracle Data Integrator lists all the schemas present in the data server. Sometimes, Oracle Data Integrator cannot draw up this list. In this case, you should enter the schema name, respecting the case.

Datasource (Work Catalog): Indicate the catalog in which you want to create these objects. For some data validation or transformation operations, Oracle Data Integrator may require work objects to be created.

Note: Appears only if the Technology selected supports Catalogs.

Schema (Work Schema): Indicates the schema in which you want to create these objects. For some data validation or transformation operations, Oracle Data Integrator may require work objects to be created. If you do not set a Work Schema, it defaults to the Schema during execution

It is recommended that you create a specific schema dedicated to any work tables. By creating a schema named SAS or ODI in all your data servers, you ensure that all Oracle Data Integrator activity remains totally independent from your applications.

Note: Oracle Data Integrator lists all the schemas present in the data server. Sometimes, Oracle Data Integrator cannot draw up this list. In this case, you should enter the schema name, respecting the case.

Driver: Name of the driver used for connecting to the data server.

URL: Provides the connection details.

Properties: Specifies the properties for the selected driver.

Click Next.

Click Finish. The model and topology objects are created, but the model contains no datastore yet.


Reverse-engineering a Model

To automatically populate datastores into the model you need to perform a reverse-engineering for this model.


Standard Reverse-Engineering

A Standard Reverse-Engineering uses the capacities of the JDBC driver used to connect the data server to retrieve the model metadata.


To perform a Standard Reverse- Engineering:

In the Reverse Engineer tab of your Model:

Select Standard.

Select the Context used for the reverse-engineering

Select the Types of objects to reverse-engineer. Only object of these types will be taken into account by the reverse-engineering process.

Enter in the Mask field the mask of tables to reverse engineer. The mask selects the objects to reverse. This mask uses the SQL LIKE syntax. The percent (%) symbol means zero or more characters, and the underscore (_) symbol means one character.

Optionally, you can specify the characters to remove for the table alias. These are the characters to delete in order to derive the alias. Note that if the datastores already exist, the characters specified here will not be removed from the table alias. Updating a datastore is not applied to the table alias.

In the Selective Reverse-Engineering tab select Selective Reverse-Engineering, New Datastores, Existing Datastores and Objects to Reverse Engineer.

A list of datastores to be reverse-engineered appears. Leave those you wish to reverse-engineer checked.

Select Save from the File main menu.

Click Reverse Engineer in the Model toolbar menu.

Oracle Data Integrator launches a reverse-engineering process for the selected datastores. A progress bar indicates the progress of the reverse-engineering process.

The reverse-engineered datastores appear under the model node in the Models panel.


Customized Reverse-Engineering:

A Customized Reverse-Engineering uses a Reverse-engineering Knowledge Module (RKM), to retrieve metadata for a specific type of technology and create the corresponding datastore definition in the data model.

For example, for the Oracle technology, the RKM Oracle accesses the database dictionary tables to retrieve the definition of tables, attributes, keys, etc., that are created in the model.


To perform a Customized Reverse-Engineering using a RKM:

In the Reverse Engineer tab of your Model:

Select Customized.

Select the Context used for the reverse-engineering

Select the Types of objects to reverse-engineer. Only object of these types will be taken into account by the reverse-engineering process.

Enter in the Mask the mask of tables to reverse engineer.

Select the KM that you want to use for performing the reverse-engineering process. This KM is typically called RKM <technology>.<name of the project>.

Optionally, you can specify the characters to remove for the table alias. These are the characters to delete in order to derive the alias. Note that if the datastores already exist, the characters specified here will not be removed from the table alias. Updating a datastore is not applied to the table alias.

Click Reverse Engineer in the Model toolbar menu, then Yes to validate the changes.

Click OK.

The Session Started Window appears.

Click OK.

You can review the reverse-engineering tasks in the Operator Navigator. If the reverse-engineering process completes correctly, reverse-engineered datastores appear under the model node in the Models panel.

ODI - How to add Data servers and schemas in the Topology

Physical Topology:

Add Data Server:

First choose one technology for example oracle and right click and add new data server

Provide data server details like

  • Definitions: Name, User , Password
  • JDBC: JDBC driver and URL

and test connection.

Add Physical schema:

Suppose you have created data server name as Test and then right click on test and create new physical schema and add the schema name and save. 

Logical Topology:

Create a new logical schema and provide context values with the required physical schemas

4 context environments are available:

  • development
  • Global
  • Production
  • Test

Now go  to the Physical schema of Oracle technology, you will see that all the context values are mapped with the logical schemas.

With screenshots:












Designer Tab = Model:

Go to the designer tab and create new object and new  model

provide definition , reverse engineering details

selective reverse engineering etc. to import all the tables.

ODI - Overview of Oracle Data Integrator Topology

 This section contains these topics:

  • Physical Architecture
  • Contexts
  • Logical Architecture
  • Agents

Physical Architecture

The physical architecture defines the different elements of the information system, as well as their characteristics taken into account by Oracle Data Integrator. Each type of database (Oracle, DB2, etc.), Big Data source (Hive, HBase), file format (XML, Flat File), or application software is represented in Oracle Data Integrator by a technology.

A technology handles formatted data. Therefore, each technology is associated with one or more data types that allow Oracle Data Integrator to generate data handling scripts.

The physical components that store and expose structured data are defined as data servers. A data server is always linked to a single technology. A data server stores information according to a specific technical logic which is declared into physical schemas attached to this data server. Every database server, JMS message file, group of flat files, and so forth, that is used in Oracle Data Integrator, must be declared as a data server. Every schema, database, JMS Topic, etc., used in Oracle Data Integrator, must be declared as a physical schema.

Finally, the physical architecture includes the definition of the Physical Agents. These are the Java software components that run Oracle Data Integrator jobs.


Contexts:

Contexts bring together components of the physical architecture (the real Architecture) of the information system with components of the Oracle Data Integrator logical architecture (the Architecture on which the user works).

For example, contexts may correspond to different execution environments (Development, Test and Production) or different execution locations (Boston Site, New-York Site, and so forth.) where similar physical resource exist.

Note that during installation the default GLOBAL context is created.


Logical Architecture:

The logical architecture allows you to identify as a single Logical Schema a group of similar physical schemas (that contain datastores that are structurally identical) that are located in different physical locations. Logical Schemas, like their physical counterparts, are attached to a technology.

Contexts allow logical schemas to resolve to physical schemas. In a given context, a logical schema resolves to a single physical schema.

For example, the Oracle logical schema Accounting may correspond to two Oracle physical schemas:

Accounting Sample used in the Development context

Accounting Corporate used in the Production context

These two physical schemas are structurally identical (they contain accounting data), but are located in different physical locations. These locations are two different Oracle schemas (Physical Schemas), possibly located on two different Oracle instances (Data Servers).

All the components developed in Oracle Data Integrator are designed on top of the logical architecture. For example, a data model is always attached to logical schema, and data flows are defined with this model. By specifying a context at run-time (either Development or Production), the model's logical schema (Accounting) resolves to a single physical schema (either Accounting Sample or Accounting Corporate), and the data contained in this schema in the data server can be accessed by the integration processes


Agents:

Oracle Data Integrator run-time Agents orchestrate the execution of jobs. These agents are Java components.

The run-time agent functions as a listener and a scheduler agent. The agent executes jobs on demand (model reverses, packages, scenarios, mappings, and so forth), for example when the job is manually launched from a user interface or from a command line. The agent is also used to start the execution of scenarios according to a schedule defined in Oracle Data Integrator.

Tuesday, September 7, 2021

Comprehensive vs Third Party Two Wheeler Insurance

Two wheeler ins​urance​​​, as the name suggests, is an insurance plan which offers financial cover to two-wheelers like bike, scooter, etc. in case of any accidental damage, theft and third party liability. Some companies also sell two wheeler insurance under the label of motorbike insurance and scooter insurance. Motor insurance in India also offers personal accident insurance to the two-wheeler drivers. Motor insurance in India has been mandated by the Indian law, thus if someone is caught riding an uninsured bike, motorcycle, scooter, etc., he/she might have to face legal procedures.It is probably because of the mandated law that most of the people buy two wheeler insurance only for the sake of formality. Thus, in the process, they end up buying insufficient coverage for their vehicle. 

At the time of buying two wheeler insurance, you will come across two types of policies -

  • Comprehensive
  • Third Party Liability. 

Under a comprehensive two wheeler insurance​ policy, your vehicle will be covered against theft, loss, and damage. This coverage will also offer personal accidental cover for the owner or rider in event of an accident. In addition, this type of two-wheeler insurance also covers you in the case of third-party liability. 

On the other hand, a third-party liability two wheeler insurance will protect you only against damage/loss towards the third party. This types of policy will not bear the cost of loss/damage of your vehicle, neither will it provide you any personal accident cover for drive and rider. And individuals who buy two wheeler insurance for the sake of mandated law mostly buy third-party insurance only, thus stay underinsured.Be a smart buyer, get full coverage for yourself and your two-wheeler by choosing comprehensive two wheeler insurance. 



OIC - Convert JSON to String

Use Case: Sometimes we come to situation where we get a source json file from source system and may need to send  the json as string to target system.

Source Json:

{

"firstname": "srinanda",

"lastname":"das"

}

Target Json as string:

{

"data": "{\n  \"firstname\" : \"srinanda\",\n  \"lastname\" : \"das\'\n}"

}

Opaque.xsd:

<?xml version='1.0' encoding='UTF-8'?>

<schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/" xmlns="http://www.w3.org/2001/XMLSchema">

<element name="opaqueElement" type="base64Binary"/>

</schema>


Implementation steps:,

Step1:  Rest trigger configure with request and response




Step2: Write a JSON file with the inputs using Stage file.




Sample.json contains:


Step3: Map the inputs to Write fields.


Step4: Read the files to opaque using Stage file.



Opaque.xsd


Map the read opaque reference to data response with decodebase64().


The flow is like below:


Test:



Wednesday, September 1, 2021

OIC - Fault Handling in OIC in details

UseCase Details: Here, we will capture the exception details from sub integration using scope default handler and sends them as response to the main integration and then from the main integration where if it finds the exception, it will throw new fault to scope handler and then it logs the exception and rethrow the fault to global scope where it will send mail notification to the customer.

Components:

Sub Integrations:

  • OIC_GetFiles_FTP : Take file name and file path as input and provide the file in base64 format and Exception details(ExceptionCode, ExceptionReason and ExceptionDetails) 
  • Generic_MailNotification: used send mails.

Main service:

  • SD_InboudErrorHandling.


Implementation steps:

Step1: OIC_GetFiles_FTP flow in bodyScope where it downloads the file from a FTP location based on file name and file path and then map the file as a response. 


Step2: In the bodysope default handler, added a map to add the bodyscope faulit details to response.



Step3: From main Integration, it calls the OIC_GetFiles and then checks if there is any exception. If exception exists, then it throws a new fault to bodyscope.


This is the exception condition used:


Switch and throw new fault block


Throw New Fault


Step4: Open the scope default handler


Step5: add the log the fault in a file or others and then rethrow the fault to Global fault.

Use Integrarion Metadata and Bodyscope fault details for enrichment

Step6: In the global fault, call the mail notification or call the incident creation service etc.

Logged fault in files:




Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...