The ODS should have the schema of the DW or not? - data-warehouse

I am creating a datawarehouse and was thinking if the ODS needs to follow the schema of the dw or its just simple db to extract data from to the dw.
Thank you

Related

where to put dimensions in Kimball data warehouse

I am creating a data warehouse following Kimball's theory. So, I am aiming for the greatest amount of dimension table re-use. In this theory, how should I physically organize the dimension tables? I have used databases to organize my data marts (i.e., 1 mart per database, with possibly multiple fact tables per mart). Since a given dimension can be used by multiple marts (and is what I want to aim for), I don't know where I should put my dimension tables.
For example, should I put them all under a certain schema in a certain database (e.g., schema 'Dimension' under database 'Dimensions')? Or, perhaps, should I incrementally add them to each new database as I build out new data marts?
A datamart is a logical subset of your data warehouse, not a physical one. Your data warehouse should (under most circumstances) reside in a single database
Traditional data warehouses often use separate databases to create application boundaries based on either workload, domain or security.
As an example, a traditional SQL Server data warehouse might include a staging database, a data warehouse database, and some data mart databases. In this topology, each database operates as a workload and security boundary in the architecture.
You can create a schema for example for HR datamart and load all the related dimensions under it.
CREATE SCHEMA [HR]; -- name for the data mart HR
CREATE TABLE [HR].[DimEmployee] -- create dimensions related to data mart HR in the HR schema
( EmployeeSK BIGINT NOT NULL
, ...
);

Mapping mysql database to owl

I would like to create an ontology for MySQL database using protege, after that, I would like to map the database with the ontology.
Can anyone help me and send me any resources or example?
To map a relational database to an RDF dataset, you should create an R2RML mapping as described at https://www.w3.org/TR/r2rml/#dfn-r2rml-mapping.

How to use schema-mapping in a stored procedure when you have more than one schema?

I have a stored procedure on my HANA database where I need to join two tables from different schemas. These schemas are named differently in the development, staging and production system.
The obvious solution in this situation would be to use Schema-Mapping. But unfortunately schema-mapping only seems to work for the default schema of a stored procedure. When trying to reference an authoring schema in a stored procedure (ex. JOIN "AUTHORING_SCHEMA"."SOME_TABLE" ON ...) you get the error message "invalid schema name". So it seems like I can only use schema-mapping for one of the tables but not for both.
I know I can read the schema mappings in my stored procedure by querying the table "_SYS_BI"."M_SCHEMA_MAPPING", but I can't find out how to query from a schema when I have the schema name in a variable.
I would give it a try to work around this limitation by defining two synonyms using .hdbsynonym
For details on how to create design time synonyms using .hdbsynonym check https://help.sap.com/saphelp_hanaplatform/helpdata/en/52/78b5979128444cb6fffe0f8c2bf1e3/content.htm and https://help.sap.com/saphelp_hanaplatform/helpdata/en/4c/94a9b68b434d26af6d878e5f51b2aa/content.htm
There you can also find a description on how schema mapping works with hdbsynonym.
For details on synonyms in general see https://blogs.sap.com/2016/12/05/using-synonyms-in-sap-hana/
I solved this with a workaround which I am not entirely happy about, but which works for now.
I created a second stored procedure with the second schema as default schema. This procedure does nothing but SELECTing the contents of the second database table.
The first stored procedure calls the second one to load the data into a local table variable and then performs a JOIN between the first database table and the table variable.
This works reasonably well because the second table is rather small (16 rows at the moment, unlikely to grow beyond 100). But I wouldn't want to do it with a larger table.

Import random Excel into Rails 4 app to create database schema on the fly

One of my recent Rails app requires import data from excel, I've been following along Ryan's RailsCasts #396 Importing CSV and Excel, it worked out pretty okay, but with one limitation, I have to create the database schema first, just wondering how can I make it more adaptable, so that it could pick up any excel with any header or number of columns, base on the imported the data, to create database schema on the fly. Is that even possible? Thanks :)
Relational database works well when you know the structure of the data, there are not suitable for making migrations triggered by user data, if you don't know the structure you can always a schema like:
MyTable
col1: string
col2: string
col3: string
coln: string
Other approach you may try is to use a non-relational database like mongodb, it's compatible with ruby on rails.

About Data Dictionary

I'm working with Dynamics ax 2012.
I'm finding a way to create foreign key with dynamics ax.
I try to create new -> relation -> new -> foreignkey -> primarykey based
I successfully created this relation but when I look the database in SQLSERVER2008 i think ((the relation)) the foreign key is not created !
And what about the primary key !! what can i do to create my personal key other then "RecId" !!
If one day i want to import a database created with SQLSERVER2008 to Dynamics AX will it be possible ? and how do I do that ?
Sorry but table relations are for the benefit of the AX environment, it is not synced to the database. Basically only fields and indexes are synced.
Can you make an AX database from an SQL database?
It probably could be done using a good deal of X++ programming doing ODBC reads from the source database meta tables. I don't know if anyone have tried it, but I doubt it.
You are most likely better off by a total database redesign, as the AX data dictionary contains more information than the SQL database.
How would you convert an SQL Database to use Valid Time State Tables and Date Effective Data?

Resources