Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie: how to undo data migration

Re: newbie: how to undo data migration

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Tue, 13 May 2003 16:57:54 GMT
Message-ID: <3EC122BC.298F169B@telusplanet.net>


may2 wrote:

> hello; here is a newbie question I require help with; I want to use
> data migration from a draft or test table of Excel/Access data into an
> existing oracle database table; then I would like to undo the test
> table; remove only the test data from the oracle database; please tell
> me how to remove the test data after the data migration.

You provide limited information - your mileage may vary with the answers you get here.

First thoughts that come to mind are: the "truncate table {tab_name}" or "delete from {tab_name}" commands. These will remove ALL the data in the table.

Second "delete from {tab_name} where {appropriate condition is written}" and the condition reflects a date or other special column that contains some hint that this is your test set.

Third involve creating a target table that has the same format as the original table, and possibly the same name if you can use a different schema. A simple way is "create table {new_tab_name} as select * from {tab_name} where 0=1" (aka the CTAS statement). Then you can do the truncate listed in the first thoughts.

Finally, you could also work with your DBA to set up workspaces - available since 8i (8.1.6) - to permit data versioning. Then all you need to do is drop the workspace on the table.

Since you are a newbie, I'd recommend getting access to a local mentor soon. Check Oracle's web site (http://www.oracle.com) for a list of User Groups in your area.

HTH
/Hans Received on Tue May 13 2003 - 11:57:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US