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: "Import succeded with warnings" and ERRORS!?

Re: "Import succeded with warnings" and ERRORS!?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Mon, 22 Oct 2001 09:38:21 +0100
Message-ID: <3bd3dafc$0$8514$ed9e5944@reading.news.pipex.net>


"Howard J. Rogers" <howardjr_at_www.com> wrote in message news:3bd32b2f_at_news.iprimus.com.au...
> Comments as ever...
> HJR
> --
> Resources for OracleT: www.geocities.com/howardjr2000
> =========================================
> > Good point. How can I truncate all objects of a DB without having to
> > investigate its structure in detail and without writing complex
> > scripts? Which objects should be excluded from being truncated? You
> > see, I am learning a lot!
> >
>
> Well, a blunderbuss technique would be:
> spool masstrunc.txt
> select 'truncate table ' || table_name || ';' || from dba_tables;
> spool off
> @masstrunc.txt

Ouch. I think I just felt that blunderbuss! If this actually worked It would do a lot of damage to important users in the DB (like MDSYS,CTXSYS etc not sure what would happen to SYS and SYSTEM.)

Fortunately as written this would only succeed in truncating the tables of the user running the query. A slightly better option might be something along the lines of

spool masstrunc.txt
select 'truncate table '||owner||'.' || table_name || ';' from dba_tables where owner not in ('SYS','SYSTEM','CTXSYS',....); spool off
@masstrunc.txt

--
Niall Litchfield
Oracle DBA
Audit Commission UK
Received on Mon Oct 22 2001 - 03:38:21 CDT

Original text of this message

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