Merging Two OLAP databases

Hi ,
I have 2 databases "BI datawarhouse" and "BI datawarehouse Dev" that are the same (same Cubes and roles and ...)but every one of them has some additions. Is there any way to compare them in order to merge them in single database
instead of 2 ?
Thanks

Hello again, Jorje,
Given the fact that this is a random Tuesday morning, I forgot about the Synchronization Database Wizard that resides at the SSAS level (I presume that you are using Analysis Services). :) 
To quote from the description of this wizard: 
The Synchronize Database Wizard makes two Analysis Services databases equivalent by copying the data and metadata a database on
a source server to a database on a destination server. While the wizard synchronizes the data between the two databases, users can continue to query the destination database. After synchronization finishes, Analysis Services automatically switches the users
to the newly copied data and metadata, and drops the old data from the destination database.
Beside the syncing the data, this wizard also allows you to sync the roles between the two databases as you can see in the following image
You can have a short read about this wizard and how to use it by clicking on this
link. Although the page is for SQL Server 2012, there is an equivalent article for 2008 (R2) and 2005.
In conclusion, while the first method from the post is not obsolete, the second one is more elegant :).
To give you also a quick scenario to see if everything is working fine (and not affect something in case anything goes wrong):
- have Database A and Database B which need to be synced. Create an empty SSAS database, called
Database C, for example. 
- create a backup of Database A and restore it over Database C with the overwrite option
- sync Database B with Database C
- perform checks to ensure that data in A and B are found in C.
Best regards,
Razvan
Per aspera ad astra!
journeyintobi.com

Similar Messages

  • Merging two calendar databases

    We have two separate instances of iPlanet Calendar Server (5.0p4) running on two separate SUN boxes and we're thinking of combining the two databases into one so we need only one instance-is this feasible?

    You can start by using your backup of the MBP right now...you do have a backup, yes?
    Please tell more: are these completely separate libraries/images, partly, or almost fully synched?

  • DAC with one OLTP with two OLAP databases

    Hi!
    Is it possible to have two distinct Siebel Analytics environments extracting data in the same Siebel 7.8 OLTP database? Each Analytic environment has it own DAC and Informatica server.
    Thanks!

    Hi,
    Here we have one OLTP with 2 Siebel Analytics, but only one in production. The other two are for Test and Development purposes, so we don´t need to load data everyday from these systems, in case we need to, we try not to overlap with the production load processes.
    What´s the reason for you to have 2 diferent DWH & Siebel Analytics systems pointing on one OLTP?
    Regards.

  • Merge Two Access Databases created with Test Stand

    Hello All,
    I am trying to merge 2 databases using LabVIEW.
    When I read the values from the first database some of the numeric fields in the table are NULL.
    When I try to write to the second database, those values are being written as 0 if integers and 0.0000 if doubles.
    Is there a way to write those values as NULL in the second database if they are Null numeric fields in the first database?
    Thank you in advance,
    Stoimen

    Hi Stoimen,
    I am not sure how the flow of your program goes, but you could use the Database Variant to Data to cast the database variant to another type.  This will accept the NULL values from the database and from there you can manipulate them how you wish.  This tutorial may also be helpful in explaining the Database Variant to Data function in LabVIEW, specifically this section: "The null type arises naturally when working with databases (fields in a record are allowed to have null values), so Database Connectivity Toolkit has a special Database Variant to Data function that handles null values, but detecting them requires several steps."
    I hope this helps!
    Kim
    Applications Engineer
    National Instruments

  • Can you merge two user accounts on macbook? my wife has created a user on her new macbook , then inadvertently created a second one when using the migration tool. 1st ac has her office 365 install, yet 2nd has her itunes database, docs and contacts.

    Can you merge two user accounts on a macbook? my wife has created a new user on her new macbook air then, inadvertently, created a second one when using the migration tool. 1st a/c has her office 365 install, while 2nd has her itunes database, docs and contacts. What is the best way forward to get everything into the one account? Not sure if the office 365 will allow another installation into the second account, otherwise would just do that and delete the first, if that is possible?

    There is no merge but you can move data from one account to another via the Shared folder. Data is copied from Shared. Watch your free space when copying. These are large files.  Do one at a time if you are on a small drive. After making copy, delete from other users before you start next copy.
    Office365 installs in the main Applications folder and is available for all users on the computer. Activation is tied to the drive not the User.

  • Need help in merging two database

    Dear All,
    Can any one please let me know the methodology/Best practices for merging two databases.
    We are having two oracle Database A and B, the data from
    Database A has to be migrated to Database B using PL/SQL scripting.
    it will be a great help,Thanks in advance!

    Hi,
    Use the DB Links and try to use the "MERGE" that is better.
    you can clone it right, almost you are getting the same data from A to B and then you are going to Update is I am correct. Does the "B" consist the data, If yes then you can't clone on exiting DB, As i said above go for DB links and write custom scripts as per your requirement.
    Refer for DB links
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_admin.htm#sthref4108
    - Pavan Kumar N

  • Merge two databases with identical schemas

    I need to automate the merging of two identical databases into a new database using java.
    Any help or pointers?

    I need to automate the merging of two identical
    databases into a new database using java.
    Any help or pointers?I would start by changing the requirements ("using java").
    Other than that certainly if there is any volume and if it needs to be running while you are doing it is going to be a real problem.
    Excluding that you do the following.
    1. For each table determine specifically what is meant by "are these rows equal".
    2. Write a merge method for each table.
    3. Write more methods to deal with foreign keys
    4. Put everything together in such a way that it runs.
    5. Provide a method for reporting errors.
    6. Plan on spending a lot of time supporting it.

  • How to CREATE VIEW to merge two tables each of which has CLOB-typed column

    I failed in creating a view to merge two tables that have CLOB-type column each.
    The details are:
    Database: Oracle 9i (9.2.0)
    Two tables "test" and "test_bak", each of which has the following structure:
    ID Number(10, 0)
    DUMMY VARCHAR2(20)
    DUMMYCLOB CLOB
    The following operation fails:
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test
    union
    select id, dummy, dummyclob from test_bak;
    I was announced:
    select test.id, test.dummy, test.dummyclob
    ERROR in line 2:
    ORA-00932: inconsistent data type: required - , but CLOB presented.
    But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
    1) one table, with CLOB-typed column
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test;
    2) two tables, without CLOB-typed columns
    create view dummyview (id, dummy) as
    select id, dummy from test
    union
    select id, dummy from test_bak;
    I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
    many thanks in advance

    Dong Wenyu,
    No.
    But you could do this:
    SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
    FROM your_table1 tab1, your_table2 tab2, (
    SELECT primary_key, ...
    FROM your_table1
    UNION
    SELECT primary_key, ...
    FROM your_table2
    ) source
    WHERE source.primary_key = tab1.id (+)
    AND source.primary_key = tab2.id (+)
    In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
    d.

  • Merge two recordsets

    I have two ADODB-connections in VBA to two different databases. I select the same field names in both databases. Is it somehow possible to merge these two recordset and remove duplicates with union and select distinct?

    Hi,
    You can make a database link from the first to the sencond database.
    then you make an ADODB connection to the first database and query the union there.
    In the first database:
    CREATE DATABASE LINK second_db_link
    CONNECT TO user_name IDENTIFIED BY password
    USING 'second_db_name';From ADODB Client to first database
    select
      col1
      ,col2
      ,col3
    from
      table_1
    union
    select
      col1
      ,col2
      ,col3
    from
      table_1@second_db_linkRegards,
    Peter

  • OLTP and OLAP databases on same SQL Server?

    Would you put OLTP and OLAP databases on same SQL Server or separate?
    I realize the ideal would be separate, but that means 2 expensive licenses instead of 1.  Most of our OLTP stuff happens during the day while OLTP processing happens at night (so good use of resources) if just 1 server.  Also, the disks that hold
    the files could have different allocations (small chunks for the OLTP disks, large for the OLAP disks).  Also, by being on the same database server, the OLTP data is immediately accessible for processing into the warehouse.
    Or, is it just a cardinal rule to never mix the two worlds as server completely different purposes?
    Thanks.

    Answer given in simillar below thread would help you for sure:
    MSDN Forum:
    Is keeping your OLAP and OLTP databases on the same server is considered bad practice?
    -Vaibhav Chaudhari

  • Merging two history.dat files

    I have two history.dat files and want to merge them into one. Is there any way to do this?
    I tried to search solution and found utility that allows viewing and exporting data from Mork format: http://www.nirsoft.net/utils/mozilla_history_view.html, but it cannot import into this format. Also there is Firefox Sync addon, but it does not support firefox 2. If there is a way to convert history from places.sqlite to history.dat, than it will do for me.
    I have mozilla firefox 2.0.0.20 and Windows XP

    You're dealing with an abandoned file format, which hasn't been used in Firefox in a few years. As far as Mork databases go, see this and read the criticisms. <br />
    http://en.wikipedia.org/wiki/Mork_%28file_format%29
    If that Nirsoft utility program doesn't have the capability of merging 2 Mork databases, you're probably SOL. That was the only tool that I ever found back in the days that Mozilla still used Mork files. I never used that utility program enough to recall any of what functions it has.
    Besides that, why are you still using a Firefox 2.0.0.x version? <br />
    Support ended a few years ago and it should be left to RIP.

  • Different optimizer paths between two identical databases

    Hello!
    I'm running into a problem with a query that is pretty amazing.  I have two different databases that I work with - Development and Acceptance.  According to my DBA, they are absolutely identical in every respect - including data.  Both of them gather statistics every night at the same time.
    On development my query executes beautifully - 0.6 seconds.
    On acceptance the query executes in 60 - 70 seconds.
    They both evalute completely differently thought an explain plan - obviously from the difference in performance.  Here are the two explain plans for the query...
    GOOD
    explain plan for
    select e.employee_name,
           e.worker_id       id,
           e.vac_ent         "Vac<BR>Ent",
           e.vac_taken       "Vac<BR>Taken",
           e.vac_presched    "Vac<BR>PreSched",
           e.vac_remain      "Vac<BR>Remain",
           e.banked_hours    "Banked<BR>Hours",
           e.banked_taken    "Banked<BR>Hours<BR>Taken",
           e.banked_presched "Banked<BR>Hours<BR>Presched",
           e.banked_remain   "Banked<BR>Hours<BR>Remain",
           e.edo_earned      "EDO<BR>Hours<BR>Earned",
           e.edo_taken       "EDO<BR>Hours<BR>Taken",
           e.edo_presched    "EDO<BR>Hours<BR>Presched",
           e.edo_remain      "EDO<BR>Hours<BR>Remain",
           e.ado_earned      "ADO<BR>Hours<BR>Earned",
           e.ado_taken       "ADO<BR>Hours<BR>Taken",
           e.ado_presched    "ADO<BR>Hours<BR>Presched",
           e.ado_remain      "ADO<BR>Hours<BR>Remain"
      from tas.benefit_summary_curr_year_v e /* USESYSDATEFORSECURITY */
    where 1 = 1
       and (e.worker_id in
           (select worker_id
               from worker_cost_centre_v ecc2
              where ecc2.cost_centre = '100033'
                and ((ecc2.effective_date <= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/10/08')) or
                    (ecc2.effective_date <= dtutil.todate('2013/11/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/11/08')) or
                    (ecc2.effective_date >= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date <= dtutil.todate('2013/11/08')))))
       and pkg_taw_security.user_worker_access('CA17062',
                                               'TIMEKEEPER',
                                               e.worker_id,
                                               trunc(sysdate)) = 1
    union
    select 'ZZZTOTALS',
           sum(e.vac_ent),
           sum(e.vac_taken),
           sum(e.vac_presched),
           sum(vac_remain),
           sum(e.banked_hours),
           sum(e.banked_taken),
           sum(e.banked_presched),
           sum(e.banked_remain),
           sum(e.edo_earned),
           sum(e.edo_taken),
           sum(e.edo_presched),
           sum(e.edo_remain),
           sum(e.ado_earned),
           sum(e.ado_taken),
           sum(e.ado_presched),
           sum(e.ado_remain)
      from tas.benefit_summary_curr_year_v e
    where 1 = 1
       and (e.worker_id in
           (select worker_id
               from worker_cost_centre_v ecc2
              where ecc2.cost_centre = '100033'
                and ((ecc2.effective_date <= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/10/08')) or
                    (ecc2.effective_date <= dtutil.todate('2013/11/08') and
                    ecc2.expiration_date >= dtutil.todate('2013/11/08')) or
                    (ecc2.effective_date >= dtutil.todate('2013/10/08') and
                    ecc2.expiration_date <= dtutil.todate('2013/11/08')))))
       and pkg_taw_security.user_worker_access('CA17062',
                                               'TIMEKEEPER',
                                               e.worker_id,
                                               trunc(sysdate)) = 1
    order by 1;
    select * from table(dbms_xplan.display);
    GOOD PLAN_TABLE_OUTPUT
    Plan hash value: 432971565
    | Id  | Operation                            | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                     |                        |     2 |   274 |    14  (43)| 00:00:01 |
    |   1 |  SORT UNIQUE                         |                        |     2 |   274 |    13  (70)| 00:00:01 |
    |   2 |   UNION-ALL                          |                        |       |       |            |          |
    |   3 |    HASH GROUP BY                     |                        |     1 |    66 |     6  (34)| 00:00:01 |
    |   4 |     NESTED LOOPS                     |                        |       |       |            |          |
    |   5 |      NESTED LOOPS                    |                        |     1 |    66 |     4   (0)| 00:00:01 |
    |   6 |       NESTED LOOPS                   |                        |     1 |    44 |     3   (0)| 00:00:01 |
    |*  7 |        TABLE ACCESS BY INDEX ROWID   | WORKER_COST_CENTRE_TBL |     1 |    29 |     2   (0)| 00:00:01 |
    |*  8 |         INDEX RANGE SCAN             | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |*  9 |        INDEX RANGE SCAN              | BENEFIT_IND            |     1 |    15 |     1   (0)| 00:00:01 |
    |* 10 |       INDEX UNIQUE SCAN              | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |  11 |      TABLE ACCESS BY INDEX ROWID     | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    |  12 |    SORT AGGREGATE                    |                        |     1 |   208 |     7  (43)| 00:00:01 |
    |  13 |     VIEW                             | VM_NWVW_0              |     1 |   208 |     6  (34)| 00:00:01 |
    |  14 |      HASH GROUP BY                   |                        |     1 |    66 |     6  (34)| 00:00:01 |
    |  15 |       NESTED LOOPS                   |                        |       |       |            |          |
    |  16 |        NESTED LOOPS                  |                        |     1 |    66 |     5  (20)| 00:00:01 |
    |  17 |         NESTED LOOPS                 |                        |     1 |    44 |     4  (25)| 00:00:01 |
    |  18 |          SORT UNIQUE                 |                        |     1 |    29 |     2   (0)| 00:00:01 |
    |* 19 |           TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |     1 |    29 |     2   (0)| 00:00:01 |
    |* 20 |            INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |* 21 |          INDEX RANGE SCAN            | BENEFIT_IND            |     1 |    15 |     1   (0)| 00:00:01 |
    |* 22 |         INDEX UNIQUE SCAN            | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |  23 |        TABLE ACCESS BY INDEX ROWID   | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       7 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR
                  "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
       8 - access("X"."COST_CENTRE"='100033')
       9 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY') AND
                  "PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUNC(SYSDATE@!))=1)
      10 - access("X"."WORKER_ID"="X"."WORKER_ID")
      19 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR
                  "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
      20 - access("X"."COST_CENTRE"='100033')
      21 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY') AND
                  "PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUNC(SYSDATE@!))=1)
      22 - access("X"."WORKER_ID"="X"."WORKER_ID")
    The bad plan - based off the same query but run against a different database.
    Bad PLAN_TABLE_OUTPUT
    Plan hash value: 3742309457
    | Id  | Operation                        | Name                        | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                 |                             |     4 |  1158 |       | 10065   (2)| 00:02:01 |
    |   1 |  SORT UNIQUE                     |                             |     4 |  1158 |       | 10064  (51)| 00:02:01 |
    |   2 |   UNION-ALL                      |                             |       |       |       |            |          |
    |*  3 |    HASH JOIN                     |                             |     3 |   915 |       |  5031   (2)| 00:01:01 |
    |   4 |     JOIN FILTER CREATE           | :BF0000                     |     1 |    29 |       |     2   (0)| 00:00:01 |
    |*  5 |      TABLE ACCESS BY INDEX ROWID | WORKER_COST_CENTRE_TBL      |     1 |    29 |       |     2   (0)| 00:00:01 |
    |*  6 |       INDEX RANGE SCAN           | WORKER_CC_CC_IDX            |    28 |       |       |     1   (0)| 00:00:01 |
    |*  7 |     VIEW                         | BENEFIT_SUMMARY_CURR_YEAR_V |   204K|    53M|       |  5027   (1)| 00:01:01 |
    |   8 |      HASH GROUP BY               |                             |   204K|  7403K|  9656K|  5027   (1)| 00:01:01 |
    |   9 |       JOIN FILTER USE            | :BF0000                     |   204K|  7403K|       |  3040   (2)| 00:00:37 |
    |* 10 |        HASH JOIN                 |                             |   204K|  7403K|  5392K|  3040   (2)| 00:00:37 |
    |  11 |         TABLE ACCESS FULL        | WORKER_TBL                  |   162K|  3485K|       |   584   (1)| 00:00:08 |
    |* 12 |         INDEX FULL SCAN          | BENEFIT_IND                 |   204K|  3001K|       |  1927   (2)| 00:00:24 |
    |  13 |    SORT AGGREGATE                |                             |     1 |   243 |       |  5032   (2)| 00:01:01 |
    |* 14 |     HASH JOIN RIGHT SEMI         |                             |    16 |  3888 |       |  5031   (2)| 00:01:01 |
    |  15 |      JOIN FILTER CREATE          | :BF0001                     |     1 |    29 |       |     2   (0)| 00:00:01 |
    |* 16 |       TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL      |     1 |    29 |       |     2   (0)| 00:00:01 |
    |* 17 |        INDEX RANGE SCAN          | WORKER_CC_CC_IDX            |    28 |       |       |     1   (0)| 00:00:01 |
    |* 18 |      VIEW                        | BENEFIT_SUMMARY_CURR_YEAR_V |   204K|    41M|       |  5027   (1)| 00:01:01 |
    |  19 |       HASH GROUP BY              |                             |   204K|  7403K|  9656K|  5027   (1)| 00:01:01 |
    |  20 |        JOIN FILTER USE           | :BF0001                     |   204K|  7403K|       |  3040   (2)| 00:00:37 |
    |* 21 |         HASH JOIN                |                             |   204K|  7403K|  5392K|  3040   (2)| 00:00:37 |
    |  22 |          TABLE ACCESS FULL       | WORKER_TBL                  |   162K|  3485K|       |   584   (1)| 00:00:08 |
    |* 23 |          INDEX FULL SCAN         | BENEFIT_IND                 |   204K|  3001K|       |  1927   (2)| 00:00:24 |
    Predicate Information (identified by operation id):
       3 - access("E"."WORKER_ID"="X"."WORKER_ID")
       5 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08')
                  AND "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
       6 - access("X"."COST_CENTRE"='100033')
       7 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"E"."WORKER_ID",TRUNC(SYSDATE@!))=1
      10 - access("X"."WORKER_ID"="X"."WORKER_ID")
      12 - filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY'))
      14 - access("E"."WORKER_ID"="X"."WORKER_ID")
      16 - filter("X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/10/08') OR "X"."EFFECTIVE_DATE"<="DTUTIL"."TODATE"('2013/11/08')
                  AND "X"."EXPIRATION_DATE">="DTUTIL"."TODATE"('2013/11/08') OR
                  "X"."EFFECTIVE_DATE">="DTUTIL"."TODATE"('2013/10/08') AND
                  "X"."EXPIRATION_DATE"<="DTUTIL"."TODATE"('2013/11/08'))
      17 - access("X"."COST_CENTRE"='100033')
      18 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"E"."WORKER_ID",TRUNC(SYSDATE@!))=1
      21 - access("X"."WORKER_ID"="X"."WORKER_ID")
      23 - filter(TO_CHAR(INTERNAL_FUNCTION("X"."ACTIVITY_DATE"),'YYYY')>=TO_CHAR(SYSDATE@!,'YYYY'))
    So I can definitely tune the query to work against my acceptance database - that isn't really the problem.  The problem is that I can't count on the optimizations to be the same between development and acceptance.  So if I move this to production, how do I know I don't get a third plan?!?!?
    Can anyone suggest anything that might cause what I'm seeing above - and / or anything that I can do to prevent it.  This is just one query out of 10,000 or so that I'm working with - we are migrating from Oracle 9 to 11g and the queries all worked perfectly on 9.
    Thanks in Advance!
    Cory Aston

    Here are the two plans for the simplified query - using the OUTLINE format as per your request
    This is the bad plan from acceptance.
    PLAN_TABLE_OUTPUT
    SQL_ID  3zfrdhqpqk1mw, child number 1
    select /*+ gather_plan_statistics */        w.worker_id, w.worker_name
    from worker_v                   w,        worker_cost_centre_v       c
    where w.worker_id = c.worker_id    and c.effective_date <=
    trunc(sysdate)    and c.expiration_date >= trunc(sysdate)    and
    c.cost_centre = '100033'    and pkg_taw_security.user_worker_access('CA1
    7062',                                            'TIMEKEEPER',
                                       w.worker_id,
                       trunc(sysdate)) = 1  order by w.worker_name
    Plan hash value: 1726112176
    | Id  | Operation                      | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                        |       |       |   589 (100)|          |
    |   1 |  SORT ORDER BY                 |                        |     4 |   400 |   589   (2)| 00:00:08 |
    |*  2 |   HASH JOIN                    |                        |     4 |   400 |   588   (1)| 00:00:08 |
    |   3 |    VIEW                        | WORKER_COST_CENTRE_V   |     4 |   124 |     2   (0)| 00:00:01 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |     4 |   116 |     2   (0)| 00:00:01 |
    |*  5 |      INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    28 |       |     1   (0)| 00:00:01 |
    |*  6 |    VIEW                        | WORKER_V               |   162K|    10M|   584   (1)| 00:00:08 |
    |   7 |     TABLE ACCESS FULL          | WORKER_TBL             |   162K|  3485K|   584   (1)| 00:00:08 |
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('optimizer_index_cost_adj' 10)
          ALL_ROWS
          OUTLINE_LEAF(@"SEL$2")
          OUTLINE_LEAF(@"SEL$3")
          OUTLINE_LEAF(@"SEL$1")
          NO_ACCESS(@"SEL$1" "C"@"SEL$1")
          NO_ACCESS(@"SEL$1" "W"@"SEL$1")
          LEADING(@"SEL$1" "C"@"SEL$1" "W"@"SEL$1")
          USE_HASH(@"SEL$1" "W"@"SEL$1")
          FULL(@"SEL$2" "X"@"SEL$2")
          INDEX_RS_ASC(@"SEL$3" "X"@"SEL$3" ("WORKER_COST_CENTRE_TBL"."COST_CENTRE"
                  "WORKER_COST_CENTRE_TBL"."EFFECTIVE_DATE"))
          END_OUTLINE_DATA
    Predicate Information (identified by operation id):
       2 - access("W"."WORKER_ID"="C"."WORKER_ID")
       4 - filter("X"."EXPIRATION_DATE">=TRUNC(SYSDATE@!))
       5 - access("X"."COST_CENTRE"='100033' AND "X"."EFFECTIVE_DATE"<=TRUNC(SYSDATE@!))
       6 - filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"W"."WORKER_ID",TRUN
                  C(SYSDATE@!))=1)
    Note
       - cardinality feedback used for this statement
    62 rows selected.
    This is the good one from development.
    PLAN_TABLE_OUTPUT
    SQL_ID  3zfrdhqpqk1mw, child number 0
    select /*+ gather_plan_statistics */        w.worker_id, w.worker_name
    from worker_v                   w,        worker_cost_centre_v       c
    where w.worker_id = c.worker_id    and c.effective_date <=
    trunc(sysdate)    and c.expiration_date >= trunc(sysdate)    and
    c.cost_centre = '100033'    and pkg_taw_security.user_worker_access('CA1
    7062',                                            'TIMEKEEPER',
                                       w.worker_id,
                       trunc(sysdate)) = 1  order by w.worker_name
    Plan hash value: 3435904055
    | Id  | Operation                      | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                        |       |       |     5 (100)|          |
    |   1 |  SORT ORDER BY                 |                        |    18 |   918 |     5  (20)| 00:00:01 |
    |   2 |   NESTED LOOPS                 |                        |       |       |            |          |
    |   3 |    NESTED LOOPS                |                        |    18 |   918 |     4   (0)| 00:00:01 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| WORKER_COST_CENTRE_TBL |    18 |   522 |     2   (0)| 00:00:01 |
    |*  5 |      INDEX RANGE SCAN          | WORKER_CC_CC_IDX       |    29 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX UNIQUE SCAN          | WORKER_PK              |     1 |       |     1   (0)| 00:00:01 |
    |   7 |    TABLE ACCESS BY INDEX ROWID | WORKER_TBL             |     1 |    22 |     1   (0)| 00:00:01 |
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('optimizer_index_cost_adj' 10)
          ALL_ROWS
          OUTLINE_LEAF(@"SEL$5428C7F1")
          MERGE(@"SEL$2")
          MERGE(@"SEL$3")
          OUTLINE(@"SEL$1")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$3")
          INDEX_RS_ASC(@"SEL$5428C7F1" "X"@"SEL$3" ("WORKER_COST_CENTRE_TBL"."COST_CENTRE"
                  "WORKER_COST_CENTRE_TBL"."EFFECTIVE_DATE"))
          INDEX(@"SEL$5428C7F1" "X"@"SEL$2" ("WORKER_TBL"."WORKER_ID"))
          LEADING(@"SEL$5428C7F1" "X"@"SEL$3" "X"@"SEL$2")
          USE_NL(@"SEL$5428C7F1" "X"@"SEL$2")
          NLJ_BATCHING(@"SEL$5428C7F1" "X"@"SEL$2")
          END_OUTLINE_DATA
    Predicate Information (identified by operation id):
       4 - filter("X"."EXPIRATION_DATE">=TRUNC(SYSDATE@!))
       5 - access("X"."COST_CENTRE"='100033' AND "X"."EFFECTIVE_DATE"<=TRUNC(SYSDATE@!))
       6 - access("X"."WORKER_ID"="X"."WORKER_ID")
           filter("PKG_TAW_SECURITY"."USER_WORKER_ACCESS"('CA17062','TIMEKEEPER',"X"."WORKER_ID",TRUN
                  C(SYSDATE@!))=1)
    60 rows selected.
    I'm not sure how to interpret what dbms_xplan is telling me above.  Any help would be greatly appreciated!!
    Thanks,
    Cory

  • APEX Application accessing data from two different databases

    Hi All,
    Currently as we all know that APEX Application resides in database and is connected to the schema of that database.
    I want APEX Application to be running and accessing data from two different databases. Elaborating my question,
    Currently, my APEX Production Application is connected with XXXX Schema of DB1 Database(Where APEX Resides). Now I want to add some pages into this APEX Application for REPORT Purpose, But I want to connect this REPORT APEX Pages to get data from Different Schema YYYY for Database DB2.
    Is it possible to configure this scenario?
    The reason for doing this is to avoid the REPORT related (adhoc queries) resource utilization effect on Production DB1 Database.
    Thanks
    Nil

    1. If you do the joining of two or more tables in DB1 then all data is pulled over to DB1 and then the join is executed: so more data over the databaselink and more work for DB1. Better keep the joining stuff where the data resides and just pull exactly that data over that you need.
    2. Don't know about your different block sizes. Seems a nice question for one of the other forums (DBA or SQL).
    3. I mean create synonyms on DB1 for reports VIEWS in DB2.
    Hope all is clear!

  • Please help me to merge two places.sqlite to get my old and New history at the same time, every time i rename my two places.sqlite to see my old and new history

    every time i rename my new places.sqlite to see my old history and come back rename old places.sqlite to see my new history, i tired and i found No Way to merge two places.sqlite :( but it's must be found this way for The PPL to see their old and new history :(
    Thank You all in Advance

    You can't merge history otherwise then using Sync to store the history and bookmarks of one places.sqlite on the Sync server and then disconnect.<br />
    Copy the second places.sqlite file to your Firefox profile folder with Firefox closed.
    Then setup Sync once again using that account and merge the content on the Sync server with your computer.
    * Merge this device's data with my Sync data

  • TS3988 how do i merge two icloud accounts - on on my computer and ipad, a different icloud id on my iphone?

    How do I merge two iCloud accounts into one?  One account is on my mac and ipad, the other on my iphone.

    Welcome to the Apple community.
    You cannot merge accounts, you will need to choose one and use it.

Maybe you are looking for

  • How to highlight days in Calendar Week view

    I miss the old system of highlighting the current day's column (in "Week View"). It was eye-catching. The red dot doesn't do it for me. Is there any way to get that feature back? P.S. - I wish Jon Ive would go back to designing hardware. There is suc

  • How to set the page size

    Hi, How to set the page size of a B tree node in berkeley db java edition? thanks.

  • Problem with opening recent projects

    Hello all, I've been working on a project on FCP since july and I've been saving it to an external HD since then. There's been 3-4 other projects I've worked on along the way, and I've tried to keep everything organized and saved properly (I.e. I alw

  • Regarding rescheduling of purchase req.

    Hi All, For raw materials I have maintained safety lead time in the material master and I conduct MRP run. System create the purchase requisitions after MRP run. When I check the requirements in MD04 for the raw material, system show me rescheduled d

  • Execution of maintenance scripts in Lion

    Hi there, as of the latest update to OS X Lion, the maintenance scripts have ceased to perform automatically.  Before, the scripts executed at their proper times (daily, weekly, monthly) and whenever the computer was running (no need to wait for spec