Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to TRUNCATE USER
On Tue, 23 Jul 2002 23:56:35 +0200, Rick Denoire
<100.17706_at_germanynet.de> wrote:
>Hello
>
>This is simple: Preparing a DB for import. I know about IGNORE=Y but I
>would prefer a clean state to begin with. I could also drop the user
>whose schema I want to get rid of before importing, but this is prone
>to errors since I would need to recreate all his properties
>(privileges, roles etc.). Finally, I could drop all his objects,
>hundreds of them... rather not.
>
>So how can I truncate users, meaning getting rid of all his data in
>order to reimport again?
>
>Thanks
>Rick
begin
for tablist in (select table_name from user_tables order by
table_name) loop
execute immediate 'truncate table '||tablist.table_name;
end loop;
end;
/
Hth
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Tue Jul 23 2002 - 17:41:11 CDT