Integrating MongoDB with Oracle Database: Creating the Data Models

A Data model includes detailed information about data such as the columns in the data, the data types of each column, the logical length of data, whether the column is nullable, and so forth. In this section we shall create data models for MongoDB and Oracle Database, the source and target databases.

  1. To create a model for MongoDB datastore first create a model folder. Select Designer ➤ Models and select New Model Folder as shown in Figure 12-34.

  1. In Model Folder Definition specify a Model Name as shown in Figure 12-35.

A model folder gets added to the Models as shown in Figure 12-36.

  1. Right-click on the model folder and select New Model as shown in Figure 12-37.

  1. In the Model Definition specify a Name and select Technology as Hive as shown in Figure 12-38. Select Logical Schema as the MongoDB schema created in the previous section. Select Action Group as <Generic Action>. Click on Save.

A model gets added for the Hive technology based on the logical schema MongoDB as shown in Figure 12-39.

5. Right-click on the model and select New Datastore as shown in Figure 12-40.

6. In the Datastore definition specify a Name and select Datastore Type as Table. Specify Resource Name as wlslog as shown in Figure 12-41.

7. Select the Columns tab. We shall construct the data model for the datastore. Click on Add Column as shown in Figure 12-42.

8. Specify the column Name, Type, Logical Length for the columns in the Hive table wlslog, which is stored as a MongoDB document collection as shown in Figure 12-43. Click on Save.

A datastore gets added to the model as shown in Figure 12-44.

9. Initially the datastore is empty. Right-click on the datastore and select View Data as shown in Figure 12-45.

The empty datastore table gets displayed as shown in Figure 12-46.

10. Next, add a model for Oracle Database. Select New Model in Designer ➤ Models as shown in Figure 12-47.

11. In Model Definition specify Name and select Technology as Oracle as shown in Figure 12-48. Select Logical Schema as the OracleDB schema created earlier. Select Action Group as <Generic Action>. Click on Save.

A model for Oracle Database gets added as shown in Figure 12-49.

12. Next, we shall reverse engineer the datastore from Oracle Database.

    • Select the Reverse Engineer tab and select Standard.
    • Select Context as Global and select Types of objects to reverse engineer as Table.
    • Specify Mask as WLSLOG, which is the Oracle Database table to which MongoDB data is to be loaded.
    • Also specify Characters to remove from Table Alias as WLSLOG.
    • Click on Reverse Engineer as shown in Figure 12-50.

13. Click on Yes in the Confirmation dialog as shown in Figure 12-51.

The Reverse engineering of the WLSLOG table starts as shown in Figure 12-52.

The WLSLOG database table gets reverse engineered as a WLSLOG datastore. The columns for the datastore are also reverse engineered as shown in Figure 12-53.

 

14. Initially the datastore is empty. Right-click on the WLSLOG datastore and select View Data as shown in Figure 12-54.

An empty table gets displayed for the datastore with just the column headers as shown in Figure 12-55.

Source: Vohra Deepak (2015), Pro MongoDB™ Development, Apress; 1st ed. edition.

Leave a Reply

Your email address will not be published. Required fields are marked *