patternMinor
Using MVIEWS to take in time data snapshot of tables
Viewed 0 times
tablestaketimesnapshotusingdatamviews
Problem
I have a requirement where I have to Load data periodically from more than 100 tables of an OLTP oracle database into MS SQL database. In my solution I want to use MVIEWs of these tables with Fast Refresh as the point of data extraction in oracle.
Every time before triggering the data load into MS SQL database I will refresh the MVIEWs to get the data. However have below mentioned doubts:
1) Is there a way through which i can refresh all the MVIEWs at once?
2) How can I ensure that data changes happening during the MVIEW refresh will not be reflected in the refreshed MVIEW. e.g. I started a refresh of all the MVIEWs at 10:00 AM then how can I ensure that no changes happening after 10:00 AM reflects in the refreshed MVIEWs?
3) Is there a better way of achieving this? I don't have the option of using mirror database.
Every time before triggering the data load into MS SQL database I will refresh the MVIEWs to get the data. However have below mentioned doubts:
1) Is there a way through which i can refresh all the MVIEWs at once?
2) How can I ensure that data changes happening during the MVIEW refresh will not be reflected in the refreshed MVIEW. e.g. I started a refresh of all the MVIEWs at 10:00 AM then how can I ensure that no changes happening after 10:00 AM reflects in the refreshed MVIEWs?
3) Is there a better way of achieving this? I don't have the option of using mirror database.
Solution
DBMS_MVIEW.REFRESH
-
list - Comma-delimited list of materialized views that you want to
refresh. ... Alternatively, you may pass in a PL/SQL index-by table of type DBMS_UTILITY.UNCL_ARRAY, where each element is the name of a materialized view.
-
atomic_refresh - If this parameter is set to true, then the list of materialized views
is refreshed in a single transaction. All of the refreshed
materialized views are updated to a single point in time. If the
refresh fails for any of the materialized views, none of the
materialized views are updated.
-
Maybe flashback query. Using Oracle Flashback Query DBMS_FLASHBACK.ENABLE_AT_TIME.
-
list - Comma-delimited list of materialized views that you want to
refresh. ... Alternatively, you may pass in a PL/SQL index-by table of type DBMS_UTILITY.UNCL_ARRAY, where each element is the name of a materialized view.
-
atomic_refresh - If this parameter is set to true, then the list of materialized views
is refreshed in a single transaction. All of the refreshed
materialized views are updated to a single point in time. If the
refresh fails for any of the materialized views, none of the
materialized views are updated.
-
Maybe flashback query. Using Oracle Flashback Query DBMS_FLASHBACK.ENABLE_AT_TIME.
Context
StackExchange Database Administrators Q#234758, answer score: 3
Revisions (0)
No revisions yet.