Sunteți pe pagina 1din 24

22

1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Loading Relational Data with


Oracle BI Cloud Service
Data Sync s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non
Objectives

After completing this lesson, you should be able to:


• Explain Oracle BI Cloud Service Data Sync
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• Describe how to load data from relational sources to Oracle BI Cloud


Service
• Demonstrate how to load data from files to Oracle BI Cloud Service
• Demonstrate how to load data from Oracle BI to Oracle BI Cloud Service
• Schedule a job to load data
• Explain integration with other processes s a
• Describe how to run Data Sync from another external process ) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 2


Populating Multiple Cloud Environments

• You can have multiple cloud targets, such as one for development and
another for production.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• After testing with data loaded to a development schema, you can populate
the production.
• There are two ways to do this:
– Use the same environment and create a new job for the production target.
– Set up a mirror environment and import the data from the development
environment.
s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
Creating new jobs: n a ra use
t a e to
ysource
• There are two possibilities for
( a
s ens database.
the
S source
- Extract from theVsame lic and populate a production target on the cloud.
N l e
y a e rab source and populate a production target.
na a fdifferent
- Extract from

a a database,
• For thertarget
a n s create another connection of type “Oracle (BICS)”.
• ty n
a the nJobs
From r
-t tab, choose to create a new job. Then map the source connection to a new value
a n o
S if necessary, and map the Target connection to the newly created target connection.
• Now, this job can be used to populate a different target.
• Pros: Monitor job status to multiple cloud targets with the same client.
• Cons: Any changes done in the project, affect all the jobs.
Setting up a different environment:
• This approach is better when there is much happening on the dev side. And/or people
responsible for dev and production environment population are different.
• To set up a different environment for the first time, export the system and its logical metadata
from the development environment and import it into the production environment by choosing to
truncate the tables using the Export and Import commands on the Tools menu.
• After initial setup, export only the logical metadata from the development environment and
import into production by choosing to truncate the tables.

Business Intelligence on Oracle Cloud 22 - 3


Overview of Data Sync

• Enables you to move data from:


– Relational sources such as:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

— Oracle
— Microsoft SQL Server
— DB2
— MySQL
— Teradata
— TimesTen
– CSV files exported from any other source
– Oracle BI (including OTBI)
• Simple to install and use s a
• Load automation – via native scheduler, command-line interface, SQL/File interface ) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 4


Concepts

Connections:
Source and target
connections
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Job: a unit of work that


can upload the data
from one or more files
Project: workspace where as defined in the project
one defines all metadata.
• Source tables
• Source files
• Target tables
s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 5


Connections

Two connections are created during the


initial setup:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• Target: This is the connection to


Oracle BI Cloud Service. Requires
username, password, and your target
BI Cloud Service URL in this format:
https://<service><identity_domain>.analytics.
<data_center>.oraclecloud.com
• File source: This is the connection to
file source. No configuration required.
s a
Note: Do not delete or rename these ) ha
connections.
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 6


Connections: Connecting to Your On-Premises
Click to create a new Schema owner
connection name

Database type
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Password for
the user

Logical name for


the data source
Value specific for
yyour database

User with whom Port on which


connection is database listens
established

s a
Name or IP address of JDBC driver for) ha
the machine where
ฺ c om the datasource

rris ideฺ
the database resides connection

a
@ Gu
n a
a ent
a y
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 7


Loading Data from Relational Sources

• You can load data into Oracle BI


Cloud Service schema directly from
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

a relational table, view, or SQL


statement.
• The Data Sync assumes that the
source table name and target table
name are the same.
• If you want a different target table
name, consider using a SQL query s a
for the source. ) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 8


Loading Data from Relational Sources: Data from Table

• All the columns are uploaded, by


default.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• To exclude one or more columns,


click the Inactive check box in the
Target Tables > Target Columns
view.
view

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 9


Loading Data from Files

To import data from a file, click “New” on the “File Data” tab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 10


Loading Data from Files

Select a file to Codepage


import for CSV
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

source

Select “First line


Select the delimiter contains headers”
such as comma, tab,
pipe, and so on Data type
f
formatt
Number of lines to be
sampled to determine Select existing target or
the attribute type create a new one

s a
) ha
ฺ c om Select to remove

rris ideฺ
duplicate rows
Choose DB table or
a
Data Set as output
@ Gu
n a
option

a ent
a y
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 11


Loading Data from Files

Note: Verify the data type suggested and make corrections as needed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Target table columns:


• Determined by header
• Space replaced by ‘_’
• Special characters removed

Target table column types:


• For number, length is 38
• For decimal, length is 38
s a
) ha
and precision is10.
• For string length is

ฺ c om computed in 50 increments

a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 12


Monitoring and Troubleshooting

Performing a Complete Reload of Data


To refresh data for a To refresh all the data in
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

single table the cloud

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 13


Multiple Sources

You can load data from multiple sources and consolidate the data for analytics
purposes:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• Heterogeneous sources
• Homogeneous sources (same version)
• Homogeneous sources (different versions)

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
Heterogeneous Sources n a ra use
a t yofasources.
e o
tFor
This is when you have different types
( s ens example Siebel CRM, Oracle EBS, Peoplesoft
VS leto use
and so on. You can either choose
N lic the same project or different ones.
• A single project
a n r a b when there is single schedule to upload data.
ais convenient
• Multiplera y none
projects, s feper source are convenient when scheduling data load at different times
a
an multiple
and/or trapeople work on them.
t y n -
S a
Homogeneousno sources (of same version)
This is when there same source but multiple instances of it. For example, you there are two instances
of Siebel CRM – one used in North America, and the other for Europe. Extracting data from both
these sources can be managed with single project.
• Create a connection for the database in North America and another for Europe.
• Use one of the databases for identifying the tables/queries to replicate.
• Test the load process from one sources.
• Create a new job where you can map the existing source to new one.
• Schedule them seperately.

Business Intelligence on Oracle Cloud 22 - 14


Homogeneous sources (of different version)
This is very similar to the first use case. The only difference being there are tables that may have the
same name but different structures/schema definitions. There are two ways of doing data upload.
• Use a single project
- Use one source as a primary source to import the table definitions.
- Use Query as a means of importing data from the others.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

- If there are new attributes from the queries, they get added to target table definition
• Use multiple projects – one per type of source
- Create individual projects one per version of the source system.
- Import tables,
tables and queries from sources in to their respective projects
projects.
- Care should be taken for the target tables to have similar datatypes.

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
S aty non

Business Intelligence on Oracle Cloud 22 - 15


Scheduling
Name for the
j b
job Specify the date to
run the scheduled
job
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Mark the
Select the job
schedule as
you want to
queued or
schedule
completed

Run job only


once

Schedule the End schedule


s a
) ha
job to run on a by a certain
regular basis. date or never

ฺ c om end

rris ideฺ
Start date for
th job
the j b
a
@ Gu
n a
a ent
a y
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 16


Running Data Sync from an External Process

• There are several ways you can trigger Data Sync to upload data:
– SQL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

– File
– Command Line

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 17


SQL-Based Trigger

• Add a connection to the source database using the Connections tab.


• Edit a file called on_demand_job.xml in the conf-shared directory and add:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

<DataSource name="trigger1"/>
• Create a table with the following syntax :
CREATE TABLE JOB_TRIGGER
( UNIQUE_KEY VARCHAR(250)
( ) NOT NULL
,JOB_NAME VARCHAR(250) NOT NULL
,EFFECTIVE_DT DATETIME NOT NULL
,INACTIVE_FLG CHAR(1) DEFAULT 'N' NOT NULL
);
CREATE INDEX JOB_TRIGGER_U1 ON JOB_TRIGGER(UNIQUE_KEY) ; a
• Making an entry in this table triggers the upload job. As soon as the job ) has
starts, the entry is deleted. ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a tya non-t
S

Business Intelligence on Oracle Cloud 22 - 18


File-Based Trigger

• You can use a file called on_demand_job.xml in the \conf directory to trigger
a job.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• The following TriggerFile entry polls for the presence of an abc.txt file, and
when found executes Job1. The file is deleted as soon as the job starts.
<TriggerFile job="Job1" file="c:\abc.txt"/>
• In this example
example, the file polling happens between 12:00 AM and 2:30 AM
AM.
There is a second window between 6:00P M and 8:00 PM every day.
<TriggerFile job="Job2" file="c:\xyz.txt">
<TimeWindow startTime="00:00" endTime="02:30"/> s a
<TimeWindow startTime="19:00" endTime="20:00"/> ) ha
</TriggerFile> ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar StudCopyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 19


Command Line–Based Trigger

• You can use a command file called dacCmdLine.bat/.sh to trigger a job


or get the status of a job.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• Edit the file to find the usage.


• The dac.properties file contains all the information required to run
dacCmdline.
• For example, the following command runs the job Demo-Job1:
datasyncCmdLine StartETL Demo-Job1

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 20


Exporting Data Sync Metadata

Select to export
metadata
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Directory to
export metadata

Export all
information in
Project view Select
application from
which to export
metadata
Export information
about jobs and
schedules s a
) ha
om
Export all information in
Connection view except
ฺ c
rris ideฺ
passwords
a
@ Gu
n a
a ent
a y
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 21


Importing Metadata

Select to import Select application


metadata for which to import
data
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

Directory to
import metadata

Import all
information in Select to import into
Project
j view blank repository or
replace
l current metadata
d

Import information
about jobs and Select to import new or
schedules update existing records
s a
Export all information in ) ha
Connection view except
ฺ c om Import metadata as array
insert. Increases speed

rris ideฺ
passwords
of import
p p process.
a
@ Gu
n a
a ent
a y
ฺ n ar Stud Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 22


Summary

In this lesson, you should have learned how to:


• Use multiple sources and targets
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

• File based and command line triggers

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

Business Intelligence on Oracle Cloud 22 - 23


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ

s a
) ha
ฺ c om
a rris ideฺ
n a @ Gu
a y a ent
ฺ n ar Stud
y a na this
n a ra use
a t ya se to
S (s cen
N V le li
y a na ferab
n a ra rans
a -t
Saty non

S-ar putea să vă placă și