Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you're on the right track with a C# console application to make it a repeatable process. <a href="http://dotnetzip.codeplex.com/" rel="nofollow noreferrer">Here</a> is great free library I've used for zip on many projects. </p> <pre><code>using (var client = new WebClient()) using (var stream = client.OpenRead(@"ftp://mysite.com/mydb.zip")) using (var file = File.Create(@"c:\temp\mydb.zip")) { stream.CopyTo(@"c:\temp\mydb.zip", 32000); } using (ZipFile zip = ZipFile.Read(@"c:\temp\mydb.zip")) { ZipEntry e = zip["bigdb.mdb"]; e.Password = "yourpassword"; e.Extract("c:\temp\bigdb.mdb"); } </code></pre> <p>Once unpacked, you can create a data connection to the access DB and datareader object. Then use the dbreader to read rows and write to flat file (avoids out of memory exception with large data sets).</p> <pre><code>private constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourdbfile.mdb;Jet OLEDB:Database Password=yourpassword;"; OleDbConnection conn = new OleDbConnection(constr); string query = "SELECT * FROM [YourTable]"; OleDbCommand cmd = new OleDbCommand(query, conn); OleDbDataReader reader = cmd.ExecuteReader(); int rowNum = 0; StringBuilder sb = new StringBuilder(); while (reader.Read()) { // write rows to flat file in chunks of 10K rows. sb.Append(reader["FieldA"].ToString() + "|"); sb.Append(reader["FieldB"].ToString() + "|"); sb.Append(reader["FieldC"].ToString() + System.Environment.NewLine); if (rowNum % 10000 == 0) { File.AppendText(@"c:\temp\data.psv", sb.ToString()); sb = new StringBuilder(); } rowNum++; } File.AppendText(@"c:\temp\data.psv", sb.ToString()); reader.Close(); </code></pre> <p>After you have your data table filled you can then export it to a flat file. <strong>I would not suggest inserting data row by row, that will be incredibly slow and it will bloat your Oracle db transaction logs.</strong> I don't believe Oracle 10g has a .Net driver that supports bulk loading, so you'll probably need to bulk load via a flat file.</p> <p>Next, import into Oracle via command line, <a href="https://stackoverflow.com/questions/206323/how-to-execute-command-line-in-c-get-std-out-results">you can invoke this from your C# console app</a>. Before you do this you'll need to have created a <a href="http://docs.oracle.com/cd/B10501_01/server.920/a96652/ch05.htm" rel="nofollow noreferrer">control file, ctl.ldr</a>, first which is used by Oracle for bulk load operations.</p> <pre><code>options (skip=1) load data INFILE 'c:\temp\data.psv' INTO table tblTest APPEND FIELDS TERMINATED BY "|" optionally enclosed by '"' ( fielda,fieldb,etc...) and then run it in as follows via command line sqlldr username/pswd@oracle_sid control=ctl.ldr </code></pre> <p>Hopefully this helps, good luck!</p> <p><strong>[Edit]</strong></p> <p>You might also have a look at the .Net <a href="http://docs.oracle.com/cd/E11882_01/win.112/e18754/OracleBulkCopyClass.htm" rel="nofollow noreferrer">Oracle Bulk copy class</a>. This was shipped with the Oracle 11g <strong>client</strong> drivers. Perhaps it will still work against your 10g server. A potential problem there, is that all your other apps on that same application server would need to work with these newer 11g client drivers too. Another option is to build a Java application that uses the <a href="http://docs.oracle.com/cd/E18283_01/appdev.112/e11828/sem_jena.htm" rel="nofollow noreferrer">Jena framework</a> which supports bulk loading.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload