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?
Morning all,
I personally would change the code given by Sybrand to exclude SYSTEM from the truncate table statements as well as SYS, otherwise the following tables will be truncated - which might be a bad thing.
Regards,
Norman.
AQ$_QUEUES AQ$_QUEUE_TABLES AQ$_SCHEDULES DEF$_AQCALL DEF$_AQERROR DEF$_CALLDEST DEF$_DEFAULTDEST DEF$_DESTINATION DEF$_ERROR DEF$_LOB DEF$_ORIGIN DEF$_PROPAGATOR
Assuming 8.1.5+ (I know people never post a version here, and I can't provide solutions for all different versions)
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;
/
<SNIP>
Received on Mon Oct 22 2001 - 03:24:32 CDT