Database join

hi again....
In one of my notes, one friend said that he been told about lossy and/or lossless join. Unfortunately, he cannot give me the best explanation nor sources for good brainstorming. So in this forum, would you guys help me, what is lossy and lossless join? What's the relationship on database design? And example(s) also? The help may be in short explanation or link. Thanks a lot....

From the Oracle® Database Data Warehousing Guide
"A lossless join is one where, if two tables called A and B are joined together, rows in table A will always match with rows in table B and no data will be lost, hence the term lossless join. For example, every row with the foreign key matches a row with a primary key provided no nulls are allowed in the foreign key. Therefore, to guarantee a lossless join, it is necessary to have FOREIGN KEY, PRIMARY KEY, and NOT NULL constraints on appropriate join keys. Alternatively, if the join between tables A and B is an outer join (A being the outer table), it is lossless as it preserves all rows of table A."
I also found this to be rather interesting
from http://www.cs.siena.edu/courses/csis350glossary.html
"Decomposition: the process of transforming a relation into 2 or more smaller (in the sense of fewer attributes) relations with the goal of removing redundancies. You should ensure that every decomposition is lossless by linking the new relations with the original one via a primary key-foreign key relationship (the FK belongs in the original relation). Another goal is to ensure that the decomposition is dependency-preserving. It is always possible to achieve a 3NF, lossless, dependency-preserving decomposition. It is also always possible to achieve a BCNF, lossless decomposition, but we are not guaranteed to be able to always achieve BCNF, lossless, and dependency- preserving at the same time. A lossless decomposition is necessary for correctness of the database; a dependency-preserving decomposition is merely a performance enhancement. "
"Lossless Join Property: A decomposition is lossless if we can join the new tables together and get exactly the old one back. We have not lost any information by doing the decomposition."
"Lossy Join Property: A decomposition is lossy if we can not join the new tables together and get exactly the old one back. We have lost information by doing the decomposition. "
Hope that helps. Google seemed to have a fair number of hits when I searched for "lossless join Oracle"

Similar Messages

  • How to get Hierarchical XML File from a Database Join Query !

    Hi,
    How can i get a Hierarchical XML File from a Database Join Query ?
    Any join query returns repeated values as below:
    BD17:SQL>select d.dname, e.ename, e.sal
    2 from dept d
    3 natural join
    4 emp e
    5 /
    DNAME ENAME SAL
    ACCOUNTING CLARK 2450
    ACCOUNTING KING 5000
    ACCOUNTING MILLER 1300
    RESEARCH SMITH 800
    RESEARCH ADAMS 1100
    RESEARCH FORD 3000
    RESEARCH SCOTT 3000
    RESEARCH JONES 2975
    SALES ALLEN 1600
    SALES BLAKE 2850
    SALES MARTIN 1250
    SALES JAMES 950
    SALES TURNER 1500
    SALES WARD 1250
    14 rows selected.
    We tried use DBMS_XMLQUERY to generate a xml file, but it was unable to get xml in Hierarchical format.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <ROWSET>
    - <ROW num="1">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>CLARK</ENAME>
    <SAL>2450</SAL>
    </ROW>
    - <ROW num="2">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>KING</ENAME>
    <SAL>5000</SAL>
    </ROW>
    - <ROW num="3">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>MILLER</ENAME>
    <SAL>1300</SAL>
    </ROW>
    - <ROW num="4">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SMITH</ENAME>
    <SAL>800</SAL>
    </ROW>
    - <ROW num="5">
    <DNAME>RESEARCH</DNAME>
    <ENAME>ADAMS</ENAME>
    <SAL>1100</SAL>
    </ROW>
    - <ROW num="6">
    <DNAME>RESEARCH</DNAME>
    <ENAME>FORD</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="7">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SCOTT</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="8">
    <DNAME>RESEARCH</DNAME>
    <ENAME>JONES</ENAME>
    <SAL>2975</SAL>
    </ROW>
    - <ROW num="9">
    <DNAME>SALES</DNAME>
    <ENAME>ALLEN</ENAME>
    <SAL>1600</SAL>
    </ROW>
    - <ROW num="10">
    <DNAME>SALES</DNAME>
    <ENAME>BLAKE</ENAME>
    <SAL>2850</SAL>
    </ROW>
    - <ROW num="11">
    <DNAME>SALES</DNAME>
    <ENAME>MARTIN</ENAME>
    <SAL>1250</SAL>
    </ROW>
    - <ROW num="12">
    <DNAME>SALES</DNAME>
    <ENAME>JAMES</ENAME>
    <SAL>950</SAL>
    </ROW>
    - <ROW num="13">
    <DNAME>SALES</DNAME>
    <ENAME>TURNER</ENAME>
    <SAL>1500</SAL>
    </ROW>
    - <ROW num="14">
    <DNAME>SALES</DNAME>
    <ENAME>WARD</ENAME>
    <SAL>1250</SAL>
    </ROW>
    </ROWSET>
    Thank you for some help.
    Nelson Alberti

    Hi,
    I wrote a general ABAP program which can be configured to grab contrent from an URL and post that content as a new PI message into the integration adapter .... from that point on normal PI configuration can be used to route it to anywhere ...
    It can be easily scheduled as a background job to grab content on a daily basis etc ...
    Regards,
    Steven

  • OBIEE error: Getting error in creating cross database joins

    Hi,
    We are trying to create a cross database join in OBIEE.
    CHild table is on SQL server and we are using ODBC 3.5 call interface to connect.
    Parent table is in Oracle
    11.2.0.3.0
    Each table can be queried separately. Main task required was to fetch records from Oracle based on records returned by SQl server (Query based on other saved request).
    The count of inner query got increased to 30,000 due to which we got too many records in IN predicate error.
    Now while creating cross database join between Oracle and SQL server we are getting following error:
    [nQSError: 10058] A general error has occured. ODBC state: 37 000
    code: 102 message: [microsoft][ODBC SQL Server driver][SQL Server] Incorredt Syntax near 'Session'
    [nQSError: 16015] SQL statement execution failed.

    Hi,
    Could you give a bit more of context for this case? The table in SQL server; Is it a dimension and the one in Oracle DB is a fact? I am guessing, you have set up the driving table here. Have you given a try taking it off, and let BI Server do the filter in memory?
    -Dhar

  • OBIEE 11g caching question - cross database joins

    Hi, I'm seeing something strange (a.k.a. not wanted) in OBIEE (11g, not sure that version matters).
    I have a simple data mart that contains spend information. The supplier dimension contains keys that can be used to join it to detailed supplier information and supplier address information in our ERP system (that sits in a different database / on a different box). In the OBIEE physical layer I've created a cross database join between the supplier dimension table and the ERP tables that contain the address info.
    Here's the odd behavior I'm seeing. If I write an answers request to select the supplier, some address info, and total spend for fiscal year 2010, I'm seeing OBIEE fire off two queries (this I expect):
    A) Select supplier, address key, and total spend for fiscal year = 2010 against the spend mart
    B) select address_key and associated address info against the ERP system (no limit on this query, it pulls back all rows from the address table)
    OBIEE then does an internal join itself and serves up the results, everything is correct. But here's what's "wrong" - if I then run the exact same answers request, but change the fiscal year to 2009, I again see OBIEE firing off the two queries. What I expected and/or want to see is that, since the entire result set from query #B doesn't change at all, that it wouldn't have to rerun this query. However, it seems to be.
    Is there any way to get #B to cache so that, for any subsequent query that contains supplier address info, OBIEE can pull it from cache instead of rerunning the query (which is pretty slow)? I really thought it would do that, but it doesn't seem to be.
    Thanks!
    Scott

    Hi,
    Could you give a bit more of context for this case? The table in SQL server; Is it a dimension and the one in Oracle DB is a fact? I am guessing, you have set up the driving table here. Have you given a try taking it off, and let BI Server do the filter in memory?
    -Dhar

  • Cross database join Oracle - SQL server date column - nQSError: 46008

    Hi,
    I am using OBIEE 10.1.3.4.2 and
    I am able to make cross database join between Oracle and SQL server using varchar columns, but I am getting this error:
    nQSError:22024-A comparison is being carried out between noncompatible type when I try to make "foreign key" join between two tables (one from Oracle, second from SQL Server) using number columns (INT, DOUBLE...). It is strange, but I when I make "complex join" on physical layer no error is thrown and everything works fine.
    But I am not able to make join between tables using Date column. Column in Oracle table has DATE datatype, column in SQL server tables has datetimeoffset(7) datatype (example: 2011-07-19 13:14:22.2032605 +02:00). So I tried to cast datetimeoffset(7) to date datatype using "convert(DATE,HappenedOn,120)" - this returns me 2011-07-19 . In this format, BI can show converted date column, I can make filter using this date column, but I am not able to make physical join with Oracle table using this column
    Answer using data from both joined tables gives me this error:
    [nQSError: 46008] Internal error: File .\DataType\SUKeyCompare.cpp, line 875. (HY000)
    Do you have some tips, how to solve this "bug"?

    Parse the command column to get the SSIS package file name may be your only option here.

  • Question about Crystal Reports 4.0 and "cross database joins"

    Hi everybody,
    in Crystal Reports 2008 we could use the cross database joining feature to put two or more BEx queries via MDX into one report and join them within Crystal Reports. We know that this might lead to performance problems but for some scenarios this was the only solution.
    Now with Crystal Reports for Enterprises 4.0 the whole connection to SAP systems will change. Will we have a chance to make one report agains two or more BEx queries any other way than using subforms. The latter will not fit our needs.
    Thank you very much!
    Thorsten

    Hi,
    Crystal Reports 4.0 is in RampUp right now. In case you are interested in the details I would suggest you join the RampUp.
    regards
    Ingo Hilgefort

  • Cross database join support timeline

    Hi
    As I am reading on this forum and over the web, SQL Azure doesnt support cross database joins.
    Even the synonym entity is restricted to current database or the tempdb.
    Need to understand the official position on above.
    1. Whether there is a plan to support cross database joins in future.
    2. If yes, by when can such a support be expected.
    Thanks
    Abhishek

    Hi Mekh
    Thanks for the quick response.
    Your reply means that we will need to combine multiple databases into one, in order to be able to use SQL Azure.
    Here is our situation:
    1. We have two development Databases - let us say DB A and DB B, managed by different product development teams.
    2. Some customers require both A and B, while some require only A, and others only B. All customers are proposed to be on SQL Azure. So now we have three types of production database schemas - A+B, A and B.
    3. With continuous development, schemas of both DB A and DB B keep changing.
    4. We need to replicate this schema change to all customer databases deployed on SQL Azure.
    Kindly let me know the best way to achieve above, in terms of best tools and practices.
    Thanks
    Abhishek

  • A dimension table outer join across two databases

    I have two databases of the same schema but may have different data that I would like to do comparisons on. For this discussion, each has two tables, Dimension and Fact. I created a common dimension which would show dimension data that exists on both databases. However, I want a common dimension which is a full outer join of the two Dimension tables that can be used to view data on the Fact tables on the two databases; this seems to be a little difference than a fact which may having missing value, isn't it? should this outer join occurs at the physical or logical? Can I even do it at physical if the data are from two different source? Any recommendation on what is the best way to do so? Thanks

    It depends on how you are defining your BM. Always, BM is for creating joins on folders within BM, in the sense that each folder can contain data from within multiple databases. So, create it in Physical layer and also create new joins for your defined facts dimensions in BM. But remember, cross database joins are not recommended. If both your schemas reside on 2 different oracle databases, you would be better off creating a single view (by creating a dblink between these 2 databases). So, create a single view and include that in the physical layer.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • OBIEE - table join across databases

    Hi,
    I want to join two tables that are in different databases. I want to join these tables on some condition and then be able to see data from both of them in the reports.
    Table 1 - columns A1, B1, C1
    Table 2 - columns A2, B2, D2
    Currently what we tried is
    1. create foreign key constraint between the two tables in the physical layer. Map A1 to A2, B1 to B2.
    2. create a join of two tables in BMM layer and then port that to presentation layer and then make report using these columns.
    OR
    try the approach as described on link http://oraclebizint.wordpress.com/2008/03/19/oracle-bi-ee-101332-cross-database-joins/
    in both the above mentioned ways, we are not able to see join of two tables. The link mentioned above doesn't work as we tried it multiple times already.
    We are able to see individual data from each table, but when we try to see data from them together, we get error.
    Can someone help us with this problem.
    Please email me on [email protected] if you need more info as i cant paste the confidential data here on the forum.
    Thanks in advance,
    Amit

    We made sure that the datatypes are the same in both tables.
    I will explain a bit how we did it.
    We have table T1 in database d1, table t2 in database d2. Since datatypes are different there, we actually had to create tables in physical layer and used select query to extract data from databases and get that into those tables in proper format. For example we had to do mapping to make the values of some parameters consistent (like BABY in T1 and CHILD in T2, so we used 'case when T1.parameter1='BABY' then 'CHILD' and so on for other columns).
    After that we defined forgein key constraints between these tables, then ported them to BMM layer, then to presentation layer.
    We are not getting error in terms on data types. Is there a step by step guide we can follow to get this cross database join.
    Regards,
    Amit

  • Logical Database for a Resource

    Hello,
    I'm looking to write a query in Quickview (SQVI) and I need the logical database for a Resource.  Can anyone help?
    Thanks,
    B

    There are two ways for this -
    1. To create the functional area with a logical database
    Tools => ABAP/4 Workbench => Utilities => ABAP/4 query => Functional Areas.
    Give the functional area name and click on Create button
    In the next screen give a brief description of the functional area
    Specify the name of the logical database, for e.g. Database FI, Application S. This will be the definition for the flight database
    Click on the button Functional Group present on the application toolbar, in order to create the functional group for the required fields from the logical database tables
    In the functional group box mention the number of the functional group and the description for the functional group
    The tables from the logical database are shown in Tables Of Logical Database/Joins while the fields are displayed in the Fields Box
    Double click on the table name in order to change the list
    Every field that has to be selected in the query should be assigned a functional group number against it
    Sometimes the list of fields in the Fields box will not be completely visible. To have a wider display of the list place the cursor in the fields box area and click on Settings => Full Screen from the SAP menu bar
    To see the fields from different tables select the table and double click on it.
    Once the required fields are selected, save the functional Area by clicking on the SAVE icon on the toolbar, and then Generate the Functional Area by clicking the Generate icon on the toolbar
    To add user defined fields to the abap query use the menu bar option GOTO => Additional Field
    Give the field name and the table name from the logical database to which the field needs to be included. Click the ENTER button.
    On the next screen give the Sequence, description, title and the technical attributes for the field (field type, length). Here you can also specify the formula for the field. Click on the SAVE button to register the data to the database.
    Remember that the sequence of the field matters – if the second field uses the first field in its code then the second field should have a higher sequence than the first. Tables can also be included – to do this use the menu option Goto => Additional Tables
    You can include your own selection criteria and parameters to control the data to be selected from the database. For these additions to get activated, code needs to be written for taking care of the additional fields.
    To display something before the execution of the actual query, go to the start of selection event via the menu path Goto => Code => Start-of-selection.
    To display something just before or after the output of the query, go to the end of selection event via the menu path Goto => Code => End-of-selection.
    To display something at the beginning of the page, go to the top of page event via the menu path Goto => Code => Top-of-page.
    After finishing everything save and generate the functional area and click on the BACK icon to come out.
    2. To create a functional area without a logical database
    One of the following can be selected
    Based on a single table
    Using an ABAP/4 program
    Using Table Joins
    Using Sequential Dataset
    The steps to be followed for creating the functional area are as follows
    Tools => ABAP/4 Workbench => Utilities => ABAP/4 query => Functional Areas.
    Give the functional area name and click on Create button
    In the next screen give a brief description of the functional area
    In the Without a logical database area give the base table on which to form the ABAP query
    To form the query with two or three tables, we need to create a join. For this check the Table Join Check Box and click on the Table Join button.
    NOTE: The tables to be used in the join should have at least one field in common i.e. it should have the same name, domain or data element.
    Mention the tables that you want to include in the join condition in the Joined Tables area and press ENTER.
    A checkbox will appear against the table names on the left side, and three radio buttons will appear against the tables on the right side specifying the join type.
    Base table name remains grayed out. Select the two tables to be involved in the join by clicking the check boxes against them. Use menu path Edit => Join => Define condition to create the join. A mapping between the tables will be displayed on the right hand side. Click on the button provided (with + and down arrow symbol) to specify the join.
    Click YES on the Proposal Requested message that gets displayed.
    If the join tables have a foreign key relationship then the common fields in the tables will be marked with 00 to indicate that the join has been created. User can create the join by specifying 00, 01 etc. against the fields that qualify for the join.
    Complete the join condition by adding more tables if necessary.
    Remaining concepts for creating the functional area without a logical database are same as the concepts for creating the functional area with a logical database.
    After finishing everything save and generate the functional area and click on the BACK icon to come out.
    Thanx!

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • ABAP Joins or Separate select statements?

    Hi,
       I am working on a simulation of an implementation project as part of my in-house training programme. I am a rookie to ABAP and am now doing a print program that requires master data selection from tables ANLZ, LFA1, MSEG and CSKT, and also related line items from ANLA.
      As a former Java/.NET programmer I used to play with database joins. Now since ABAP joins are much simpler to use, I take the best advantage of them. For instance, in this particular program, I fetched related data from ANLZ, ANLA, LFA1 and CSKT into one internal table using a single select statement with ABAP joins.
      Now I happen to hear (in bits and pieces) that one should limit the use of nested joins to a certain extend. Instead, for the above program, I was advised to use 4 internal tables and to select data separately using FOR ALL ENTRIES. But in this case, we need to use 4 select statements, which means 4 database operations in place of just one.
      From ABAP documentation, I read that we can link upto 24 tables in a single select statement using ABAP joins.
    Can anyone clarify more about this? Which is high on performance?
    Using a single select statement using joins
    or
    Using multiple selects -- FOR ALL ENTRIES?
    Thanks and regards,
    Arun

    Hi Arun,
    you keep reading in these forums that FOR ALL ENTRIES is more performant, but this is simply not true.
    In your example, joining four tables for one DB operation is better than storing a lot of redundant data in internal tables just to perform four separate DB operations using FOR ALL ENTRIES.
    Make sure you join the tables correctly, i.e. link dependent tables giving their full primary key.
    FOR ALL ENTRIES can be used where effective join statements are not possible, e.g. when cluster tables are involved (like BSEG).
    Cheers
    Thomas
    Edit: check this out too: Inner Join or For All Entries

  • Why does "SELECT * FROM [database].[schema].[table]" not work in Azure ?

    Hi all
    In Microsoft Azure I have 2 databases.
    I work since more than 10 years with T-SQL and I always use
    fully qualified object names, means "[database].[schema].[table]".
    When I now make a connection to my database "A" in Azure and
    write a Query against database "B" ("SELECT * FROM [B].[schema].[table]")
    I get an exception. Of course when I connect to database "B" it works
    but again not to database "A". When I use "SELECT * FROM [schema].[table]"
    with the right database connected, it also works in Azure.
    Hope you understand what I mean :-)
    In MS-SQL, this of course works fine.
    Well my question is: What sense does this make ??
    Do I now have to re-write everything just for azure or will this behavior changed sometimes ?
    I know MS-SQL is not the same like Azure-SQL, but hey; does Microsoft think all projects have only one database ?? :-)
    Thanks for any answer
    Frank

    Hi Frank,
    According to your description, you want to retrieval data cross database in SQL Azure, right?
    As June said, Currently cross database joins are not supported in SQL Azure. Also you cannot change database mid query so you cannot, for example, put a USE [MyDB] in your query either. Please refer to the link below to see the details.
    http://www.britishdeveloper.co.uk/2011/11/cross-database-joins-in-sql-azure.html
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to prevent duplicate keys in archive database?

    I am struggling with this problem.
    Background: I'm working on a project where I have to make an archive database. The archive database should get
    all data of the operational database. It should even save every update ever made, so it literally contains the entire history of the operational database (this is a must and the whole project revolves around this idea). So this is solved by using Change Data
    Capture. After that the data should go through a staging area and eventually in the data warehouse database. I came out with a solution and worked it out in the prototype and it seemed to be working all fine. I stupidly forgot to include the foreign keys,
    so the archive database didn't have the original structure but it should ofcourse (no wonder it went okay without too much hassle).
    Problem: Because we want to store everything in archive, there will be duplicate primary keys (just for instance,
    many same contact_id's because telephone number changes a couple of times). I thought to solve this by adding a new primary key which says is auto-increment and purely exist to make a record unique. But when it comes to foreign keys, it's impossible. You want
    contact_id to be able to be duplicate and in that case it cannot be a primary key. But foreign key is only able to reference to a primary key or another unique key but not other normal columns.
    Any advice on this? It's an absolute must to store all changes.

    All of you, thanks for replying, I'm happy you're trying to help me out with this problem. 
    Visakh and Louis, thanks that seems like the solution for this case indeed. Yes, the dimensional design appeals more to me as well.
    I read the articles and watched some tutorials. But I can't work it around the solution that I had.
    More background info: I use CDC to track all the changes done in the operational database and SSIS (following one of Matt Mason's tutorials and with a lot of alterations to make it fit for my project). I have this control flow (don't mind that
    error haha):
    (Oh apparently I cannot add images yet, so here's the link for the screenshot:) http://nl.tinypic.com/r/w0p1u0/8
    Basically I create staging tables in my archive database next to my normal archive tables. Then start CDC control task to get the processing range and then it copies everything from the operational database (joined with a few CDC columns) to the staging
    tables. After that the processing range ends so it will only get the rows it hasn't processed before. And then I do some updates on the staging tables and then finally insert everything into the archive tables. The staging tables then can be truncated. After
    this the data will go to the staging area for transformations and then finally at last to the DWH. The reason for having a staging area between the archive and DWH is that the archive will not only be used as source for the DWH but also on it's own. The DWH
    will not contain 100% the same stuff as the archive (like maybe some transformations, extra columns with calculated fields, plus some columns don't need to be in the DWH at all). When all the ETL stuff is done in SSIS, I have to use SSAS to define all the
    facts, dimensions, cubes. 
    Example: So I try to work with the SCD type 2. If I understood it correctly (and maybe I didn't): for example, the contact table in archive should have the surrogate key ID (the auto-increment one). The business key is the contact_id
    and can be used uniquely with the time range columns. 
    Following Visakh's post, the ID becomes the key that the foreign key will reference to. For example: 
    Contact table:
    ID: 1 contact_id: 100
    Name: Glenn start_time: 2014-01-01
    End_time: 2014-08-20
    ID: 2 Contact_id: 100
    Name: Danzig Start_time: 2014-08-20
    end_time: NULL
    Sorry, I couldn't style it as table somehow. So the employee changed his name. It makes sense that the time period tells when the first name was valid. 
    Organisation table: 
    ID: 1
    org_id: 20 
    Contact_id: 1
    Start_time: 2014-01-01
    End_time:NULL
    (it references to ID instead of contact_id as suggested)
    The employee belongs to an organisation. It references 1 which is still old data. But this is the last version of the organisation record. 
    So then I need a table to link the 2: 
    organisation_contact table
    contact_id:100
    org_id: 20
    and then I need another one to join with the surrogate key?
    ID: 1
    org_id: 20
    ID: 2
    org_id: 20
    (Guess it would make more sense to have org_id in the contact table but for now it's an example)
    Problems: I don't quite understand how this works. From the example I saw you have to have another table (the fact table) to link it to the surrogate key. Would this mean I have to have facts and dimension tables in my archive database?
    My intention was actually to have all records of the operational databases (all the updates too) in my archive. And after that create the facts and dimensions in the DWH with SSAS. The example looks like I should do it earlier. 
    I don't know how to combine this with the cdc solution. I want to get all the data by using CDC. Like how every update gets registered in the accompanying CDC table. Then the archive will get the CDC data. But then how to combine this in use with SCD. I
    have the surrogate key in archive (ID) and then I make the start and end time columns. I need to point all references to the ID and then make the other table to keep track of the contact_id (original PK) and another key. At last make another table to track
    all the current data in the fact. 
    Another question: Would you recommend the SCD task in SSIS. I read it was not that great if you have many rows to work with. What would you think is the best method to implement it. 
    Thanks so much again.
    EDIT: What about slowly changing dimensions type 4? It looks like you don't have to change the references of the foreign key then. Why do you prefer 2 over 4?

  • Select query in materialized view with two dblinks

    Hi All,
    We have oracle 10g On windows.
    We are trying to create materialized view. Scenario is we have base table on other database and we are creating mview on different database.
    Basa database have two schema's and i am selecting records from that two schema's using two private db links.
    But when i am tryin gto create mview its not getting created. After 15 hrs. its still showing creation command and not finished.
    Query is :-
    Is it good practice to have two db links in select query of materialized view.

    Billy  Verreynne  wrote:
    Chanchal Wankhade wrote:
    Is it good practice to have two db links in select query of materialized view.Same db link being used twice, or two different db links?
    If the former, you ideally want the local Oracle db to send the join to the remote database, and for the remote database to drive the join between those 2 tables. There is a hint (<i>driving_site</i>) that can be used - or the join query can be defined on the remote database as a view, and the local materialised view can then use that remote view.
    If you have 2 different db links and joining across these - usually a bad idea to perform distributed database joins. There are lots of limitations as to how the tables can be joined. Worse case, full table scans of both remote tables, pulling all the rows from the 2 remote database tables to the local database, and joining these on the local database.
    I have seen some severe performance issues in the past as a result of distributed joins. I'll rather use 2 materialised views for pulling both distributed tables's data locally, and then do the join on local data (using indexes, partition pruning, etc)Hi Billy,
    My scenario is i have two database database A and database B. Database A is having two schema's SCOTT AND HR. SCOTT schema have select privileges on HR schema.
    DB LINK is between Database B to Database A. name is db.link.B.A.oracle.com.
    What if i priovide while creating materialized view, the schema name before the table name in database B for this particuler table so it will pick up the table from that schema using same DB LINK(db.link.B.A.oracle.com.) that i am using to fetch records from SCOTT schema.
    Above schnario is like two base schema's and one db link using two schema.

Maybe you are looking for

  • Purchase & Sales register India-J1IPUR/ J1ISAL

    Hello, We are planning to implement to use Standard SAP Provided program for Purchase register (J1IPUR) and Sales register (J1ISAL). Wanted to know the how useful the same is keeping in mind the Indian Tax Regulatory requirements. Thanks

  • I created a hi resolution 4:3 slide show in imovie.

    When I share to idvd, I'm not sure that I'm getting the same quality output that I put in. In idvd I found a theme that will accept 4:3, but when I try to look at it, the preview is 16:9 (although I have 4:3 checked in the dropdown). I really don't w

  • Unable to download using Safari

    I would like to download the latest version of iTunes using Safari, but the following happens: 1. Click button to download iTunes from Apple website. 2. Safari window flashes and displays completion page saying download should proceed automatically.

  • How deactivate Web premium CS4 when I can't get into my old computer (crashed)?

    Hi, At Adobe's website it says: "What happens if my computer is stolen or damaged and cannot be repaired? If your computer is stolen, damaged beyond repair or the hard drive is completely re-imaged, the activation will be lost. In either case you can

  • Sudden loss of sound

    I was using my macbook (white 13") the other night to do a presentation with video.  I had a hard time getting sound to play, but finally did.  Now I have no sound at all.  The sound indicator is light gray in color as opposed to black and if I using