Home » SQL & PL/SQL » SQL & PL/SQL » why to use purge (oracle)
why to use purge [message #318972] Thu, 08 May 2008 10:01 Go to next message
abhishekswamy
Messages: 11
Registered: May 2008
Junior Member

hi please tell me what is the use of purge,and what is the difference between these two statements
drop table table_name purge;
and drop table table_name;

i think only DROP is sufficient to remove the table completely from DB.
please do clarify me on this,
thanks in advance
abhishek
Re: why to use purge [message #318973 is a reply to message #318972] Thu, 08 May 2008 10:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What about reading the doc?
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9003.htm#i2061306

Regards
Michel
Re: why to use purge [message #318989 is a reply to message #318973] Thu, 08 May 2008 11:04 Go to previous messageGo to next message
abhishekswamy
Messages: 11
Registered: May 2008
Junior Member

thanks...it was helpful Smile
Re: why to use purge [message #319015 is a reply to message #318972] Thu, 08 May 2008 13:35 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Michel know's his docs! Razz
Re: why to use purge [message #319246 is a reply to message #318972] Fri, 09 May 2008 08:25 Go to previous messageGo to next message
drewsmith70
Messages: 22
Registered: April 2008
Location: New Hampshire
Junior Member
A demonstration:

asmith>create table test (c1 number);

Table created.

asmith>insert into test values (1);

1 row created.

asmith>select * from test;

        C1
----------
         1

asmith>drop table test;

/* NOTE that this version of TEST remains in the recycle bin */
Table dropped.

asmith>select * from test;
select * from test
              *
ERROR at line 1:
ORA-00942: table or view does not exist


asmith>create table test (c2 number);

Table created.

asmith>insert into test values (2);

1 row created.

asmith>select * from test;

        C2
----------
         2

asmith>drop table test;

/* NOTE that this version of TEST remains in the recycle bin */
/* There are now two versions of TEST in the recycle bin  */
Table dropped.

asmith>flashback table test to before drop;

Flashback complete.

asmith>select * from test;

        C2
----------
         2

asmith>drop table test purge;

/* NOTE that this version of TEST is NOT in the recycle bin */
Table dropped.

asmith>flashback table test to before drop;

/* Recovers the FIRST version of TEST from the recycle bin */
Flashback complete.

asmith>select * from test;

        C1
----------
         1

asmith>drop table test purge;

Table dropped.

asmith>flashback table test to before drop;
flashback table test to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN

Re: why to use purge [message #319256 is a reply to message #319246] Fri, 09 May 2008 08:47 Go to previous message
abhishekswamy
Messages: 11
Registered: May 2008
Junior Member

this was awsome and gave full understanding...thanks a lot Smith Cool
Previous Topic: help me
Next Topic: Alter syntax
Goto Forum:
  


Current Time: Thu Dec 08 04:27:05 CST 2016

Total time taken to generate the page: 0.09720 seconds