Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Import succeded with warnings" and ERRORS!?
"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 UKReceived on Mon Oct 22 2001 - 03:38:21 CDT
![]() |
![]() |