Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Standard procedure to prepare a DB for import?
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
>You shouldn't import table and indexes at the same time. The import process
>will be definitely much slower, and will force to rebuild.
>You need to import with indexes=n
>generate the indexfile
>edit the indexfile to add the nologgin clause to every create index
>run it
This is the kind of advice I was looking for!
>I will leave the second set of code to you as an exercise. 3 won't be
>necessary anymore when you follow the above procedure.
>Obviously this code is along the same lines as the *very simple* programs
>above.
Yes, changing "disable" into "enable" (or something similar, I will have to check that out) should not be difficult.
Thanks a lot!
Rick
>1
>begin
>for r in (select owner, table_name from dba_tables where owner <> 'SYS'
>order by 1,2) loop
>execute immediate 'truncate table '||r.owner||'.'||r.table_name;
>end loop;
>end;
>/
>2
>for r in (select owner, trigger_name from dba_triggers where owner <>'SYS'
>order by 1,2) loop
>execute immediate 'alter trigger '||r.owner||'.'||r.trigger_name||'
>disable';
>end loop;
>end;
>/
>3
>for r in (select owner, index_name from dba_indexes where owner <>'SYS'
>order by 1,2) loop
>execute immediate 'drop index '||r.owner||'.'||r.index_name;
>end loop;
>end;
>/
>
Received on Sun Oct 21 2001 - 16:36:13 CDT