Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 8i: how to do a full import to the same database?
JustAnotherDBA wrote:
> "Bombadil" <bombadil_at_fastmail.fm> wrote in message
> news:eedb1e6a.0302230646.4d8a6242_at_posting.google.com...
>
>>Hello, >> >>we are running Oracle 8i (8.1.6) on Windows 2000 Server. >> >>I have a dump file that I got a while ago using "exp full=y ...". >>I now want to import it back into the same database replacing the data >>that is currently there.
>>How do you do a full import to the same database? >>Could someone please give me instructions as to how this can be >>achieved? >> >>If I try to just run "imp full=y ..." on the existing database, I >>think I will get lots of errors because the tables, records, >>contraints are already in the db. >>
>>Any help would be appreciated. >> >>Thanks, >>Bombadil.
A sample of the script that generates the sql to disable the triggers is below, its quite easy to edit it to do the constraints, truncates, and enable scripts as well...
set termout off
spool <<script_name.sql>>
select 'spool <<path>>\disable_trigs.LOG' from dual /
select 'set echo off;' sqlline
,'set feed on;' sqlline
from dual;
select ' ' sqlline ,'prompt ' sqlline ,'prompt '||decode(upper('Y'),'N','Enable','Y','Disable','Do nothing to')|| ' triggers table: '||table_owner||'.'||table_name||' trigger name: '||trigger_name||'...' sqlline ,'prompt ' sqlline ,'alter trigger
In the end though it is probably easier to to a simple drop user(s) before your import.
Also keep in mind that if you drop the tablespaces, your directory structure has to remain the same if you want your import to work, if you want to move the datafiles before the import, recreate the tablespaces with the same name and the datafiles in their new location before the import.
hth Received on Sun Feb 23 2003 - 12:21:17 CST