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

Home -> Community -> Usenet -> c.d.o.server -> Re: Standard procedure to prepare a DB for import?

Re: Standard procedure to prepare a DB for import?

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Mon, 22 Oct 2001 09:24:32 +0100
Message-ID: <E2F6A70FE45242488C865C3BC1245DA71CDECA@lnewton.leeds.lfs.co.uk>


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

DEF$_PUSHED_TRANSACTIONS
DEF$_TEMP$LOB
SQLPLUS_PRODUCT_PROFILE -----Original Message-----
From: Sybrand Bakker [mailto:postbus_at_sybrandb.demon.nl] Posted At: Sunday, October 21, 2001 11:44 AM Posted To: server
Conversation: Standard procedure to prepare a DB for import? Subject: Re: Standard procedure to prepare a DB for import?

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

Original text of this message

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