Avoiding Data disappear

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Avoiding Data disappear

Post by mab_arif16 »

Hi
One of my jobs refreshes the datamart using ODBC enterprise stage's truncate and write option.The job runs for about 10 minutes during which the data gets deleted and loaded and user sees an inconsistent data.
Is it any way possible to see the old data in the table during the run time ,and after the load is completed see the new data.
Thanks
Arif
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Sure, get a snapshot of the table before deleting and loading the new data. Then your comparison can be done. :lol:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or load a second copy of the table and when the load completes, swap it in for the original. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

chulett wrote:Or load a second copy of the table and when the load completes, swap it in for the original. :wink:
Exactly, this is called mirroring. It is infact pretty easy to achieve this through materialised views. Maintain a materialised view for your table and make sure that users always hit the materialized view. Refresh the view after each load.

Hope this helps :D
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

sud wrote:
chulett wrote:Or load a second copy of the table and when the load completes, swap it in for the original. :wink:
Exactly, this is called mirroring. It is infact pretty easy to achieve this through materialised views. Maintain a materialised view for your table and make sure that users always hit the materialized view. Refresh the view after each load.

Hope this helps :D
Thanks for help
Can this be done through Data Stage also.
Arif
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

Yes , what you can do is create a procedure to refresh the materialised view and call this procedure in the close command of your target stage in the job or call the procedure through datastage after the loading job finishes. Since your users will always be hitting the materialised view, they will see the updated data.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

sud wrote:Yes , what you can do is create a procedure to refresh the materialised view and call this procedure in the close command of your target stage in the job or call the procedure through datastage after the loading job finishes. Since your users will always be hitting the materialised view, they will see the updated data.
Thanks
That was helpful
Post Reply