Question

I am working on winform application in C# where I have to import some 200,000 records from an Oracle view and dump into SQL Server table. I am not sure how to approach this problem whether i should use datatable to hold all these records and then store it in SQL server Or I have to use some DBlink which I am not familiar with. Any suggestions/recommendations will be greatly appreciated. Thanks!

Was it helpful?

Solution

A lot of how you handle it depends on the data and how it is used.

If it is dynamic data that is often changing, then having a live link might be better, although there still may be a speed issue. Or if it changes some but not often, reloading it to SQL Server using an SSIS package might be a good option. If having two copies of the data is simpler (and it's data that doesn't change), then just doing a one-time copy over might be acceptable.

Setting up a DB Link is not too hard and recommended if you're going to make a SSIS package or accessing the data through SQL Server but leaving it in Oracle.

If you're using the data and getting it fresh each month, and not modifying it in SQL, then creating a SSIS task and a DB Link would be a reasonable solution. Create the link and make sure it connects, then use SSIS to truncate your SQL table and then reload it from Oracle. Run the package during a time the application is not using the SQL copy of the data. Make a job to run the package. It might be reasonable to make a backup of the table before truncating, or copying to a temporary location, or some sort of process to recover in the case of a problem loading the data. Something like the following:

Job  
step 1   Backup table 
step 2   (if step 1 successful) Run SSIS package
                    Truncate table
                    Reload table using DB Link 
step 3   (if step 2 failure) restore from backup

OTHER TIPS

Open 2 connections. Read from one and write to the other. There is an Oracle .Net driver. It's called ODP.NET.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top