Re: I can attach in SQL Server, but can I in Oracle?

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Sat, 09 Aug 2003 17:16:46 GMT
Message-ID: <3F352A77.282BD6BA_at_telusplanet.net>


Ron Fluegge wrote:

> Karsten,
>
> Again, thanks for the feedback.
>
> I have no problem with creating the tables with SQL scripts; it's just the
> 5,000 rows of data to load with INSERTs. As one person who responded
> commented, that 5,000 rows being loaded is nothing, it's the creating the
> 5,000 INSERTS that's the pain in the butt ... but then again someone is
> probably going to point me to a very easy way in Oracle to do that. That
> would be nice.
>

Couple of things/questions to think about as well:

  1. Transportable tablespaces do have a few limitations across the 8i/9i space. These include block size restrictions;
  2. Import is considered a fairly universal way of getting bulk, predefined data sets into an Oracle environment;
  3. Import also permits creating a blank schema.
  4. When distributing your app, how are you planning on distributng the schema?
  5. Why not consider using SQL Plus to 'write a script' to create the inserts? Something like

SELECT "INSERT INTO table ( col1, col2, col3) VALUES (' ||

            col1, || ''', ''' || col2 || ''', ''' || col3 || ''');' FROM table;

Sure the file will be big, but look at Oracle's distributions and note that they do it that way themselves for some types of problems.

This approach is much simpler than export, SQL Load, transportable tablespaces, etc. (although those mechanisms are good) and will be consistent across Oracle versions & likely as well across RDBMSs.

HTH
/Hans Received on Sat Aug 09 2003 - 19:16:46 CEST

Original text of this message