Oracle Walkthrough
  • 7 Minutes to read
  • Dark
    Light
  • PDF

Oracle Walkthrough

  • Dark
    Light
  • PDF

Article Summary

This guide will walk you through the steps needed to integrate data from an Oracle database (on-prem or managed service) into a cloud target using Rivery.

The following topics will be covered:

Configure Oracle for Rivery

Create a User for Rivery:

In order to extract data, it's recommended to create a new user in the database for Rivery:

CREATE USER < myUsername > IDENTIFIED BY < password >;
GRANT CREATE SESSION TO < myUsername >;

Use the database you want to extract data from. Change the <database> with your existing database name:

USE < database >;

Now, grant permissions to the new user you've just created for Rivery to the table or schema you want to extract data from. Use the commands below, and change the <database>, <schema> and <table> structures with your existing schema and table names.

  • To grant SELECT operation to all of the tables in the database, use:

GRANT SELECT ANY TABLE TO < myUsername >;

  • To grant a SELECT operation to a specific schema and table, use:

GRANT SELECT ON "< schema>"."< table >" TO < myUsername >;

Pull Oracle Data Into Your Target

Using Rivery, you can pull data from your Oracle tables and send that data into your target database.

First select 'Create New River' from the top right of the Rivery screen.

image

Choose 'Data Source to Target' as your river type.

In the 'General Info' tab, name your river and give it a description. Next, navigate to the 'Source' tab.

Find Oracle in the list of data sources and select it:

image

Define a Source Connection (this will be the connection created earlier in the process). If you do not yet have a Oracle connection in your Rivery account, you can create a new connection here by clicking 'Create New Connection.'

image

Next, choose your River mode.

image

  • Multi-Tables : Load multiple tables simultaneously from Oracle to your target.
  • Custom Query : Create a custom query and load it into your target.
  • Legacy River : Choose a single source table to load into a single target.

Multi-Table Mode:

Make sure 'Multi-Tables' is selected in the Source tab. Navigate to the Target tab.

Select your desired Target:

image.png

image

Depending on what Target you select, the Target tab will look a little bit different. For relational database targets, in the Target tab you will identify the location where the data is to land (database and schema). You also have the option to define a table prefix.

image

Next, you can define the default loading mode for your multi-table migration.

image

For storage targets (Google Cloud Storage, Amazon S3, Azure Blob Storage) the Target tab will allow you identify the bucket and path for your data to land.

image

Once your desired target location is configured, navigate to the 'Mapping' tab.

Select 'Show Me My Schemas' to pull the metadata of your Oracle database.

image

Once the metadata has been detected, you'll see a list of schemas:

image

Click into the desired schema to list the tables within that schema.

image

From the image above, you can see that there are checkboxes that allow for you to pull in specific tables or simply select all by clicking the checkbox next to the 'Table Name' header.

Even though in the Target tab there is a default Loading Mode define, the loading mode for any individual table can be edited by clicking in the 'Edit' button on the far right.

Once you click 'Edit', the metadata of the corresponding table will be displayed with additional options to update.

image

On the 'Columns' tab you are able to edit the following:

  • Select/deselect columns to bring into the target
  • Rename the field in 'Target column'
  • Cast the field to a different data type (by double-clicking the current data type under 'Type')
  • Change the mode of the field under 'Mode'
  • Add a field to be a Cluster Key by checking the 'Cluster Key' checkbox (this is used for partitioning).
  • Define a field as the key for Upsert-Merge by clicking the key to the left of the field name to highlight it

image.png

On the 'Table Settings' tab you are able to edit the following:

  • Change the loading mode
  • Change the extraction method. If 'Incremental' is selected, you can then define which field will be used to define the increment.
  • Filter by expresion that will be used as a WHERE clause to fetch the selected data from the table.

image

If a date is chosen, you'll be prompted for a start date. If an integer field is chosen, you'll be prompted for a starting value.

Once all desired table edits have been made, you can navigate back to the schema level of your 'Mapping' tab to make more edits.

Before moving on to the 'Schedule' tab to schedule your river, try clicking the 'Run' button at the bottom of the screen to test it first.

image

Once you've started running your river, you'll see a status bar appear at the bottom of the screen.

Custom Query Mode:

Pulling data from a custom query:

You may also use the Custom Query in order to define a query data pull from Rivery. You may use any query that works in the source, using a specific SELECT query without any other statements. Rivery isn’t compatible using multi-statements or SQL Script in the custom query field.

image

Extract Method:

Using Rivery, you can pull your data incrementally or pull the entirety of the data that exists in the table:

image

  • All: Fetch all data in the table using Chunks.
  • Incremental: Gives you the option to run over a column in a table or your custom query top SELECT. You can run over it by filtering Start and End dates or Epoch times
    Moreover, you may choose to run over the date using Daily, Monthly, Weekly, or Yearly chunks.

Please define the incremental Field to be used in the Incremental Field section. After choosing the incremental field, choose the Incremental Type and the dates/values you would like to fetch.

Note: Rivery will manage the increments over the runs using the Maximum value in the data. This means you will always get the entire data since the last run, which prevents data holes. You just need to configure your river once.

Recommended : Define your incremental field in Rivery over a field with an Index or Partitions key in the table.

image.png

Please note:
The Start Date won't be advanced if a River run is unsuccessful.
If you don't want this default setting, click More Options and check the box to advance the start date even if the River run is unsuccessful (Not recommended).
image.png

Limit and Auto Mapping:

After defining the extract method, you may choose a limit of top N rows to fetch. Rivery will set your Schema using the Auto Mapping feature. You can also choose fields you want to fetch in the Mapping table and add fields on your own.

image

Legacy River Mode:

This river mode allows for the load of a single source table into a single target table.

image

In the above screenshot, there are steps to define the source table to pull (Rivery will auto-detect available schemas and tables), the extraction method to use, and options for filters or row limits on the data pull.

Schedule the River

Once the creation of the river is complete, navigate to the 'Schedule' tab and click 'Schedule Me.'

image.png

Choose the frequency at which to schedule the river.

image

To notify certain users about a river failure or warning, enable notifications below:

image

You can edit your {Mail_Alert_Group} in the Variables page (find this in the left-hand pane of the browser).

Monitor the River

During the river run, or after the run has complete, you can monitor the river in its 'Activities' tab.

image

In this tab you can monitor each the status of the current river run. For the Multi-Table mode, you can monitor at the table-level (see above).

By toggling between 'Run View' and 'Target View' you can see the river results grouped either by time of run or by target location.

Check out the Targets section to find out how to load the data to your target data warehouse.

Type Mapping

While extracting your data, we match Oracle data types to Rivery data types. If a data type isn't supported, we will automatically map it as a String type.

The mapping of Oracle data types to Rivery-compatible types is shown in the table below:

Oracle TypeRivery Type
BLOBSTRING
DATETIMESTAMP
TIMESTAMPTIMESTAMP
VARCHARSTRING
NVARCHARSTRING
CHARSTRING
FLOATFLOAT
CLOBSTRING
DateTIMESTAMP
DOUBLE_PRECISIONFLOAT
INTERVALTIMESTAMP
LONGINTEGER
NCLOBSTRING
NUMBERFLOAT
RAWSTRING
ROWIDINTEGER
VARCHAR2STRING
NVARCHAR2STRING

Was this article helpful?