PURGE Command SQL or SQL*Plus Command?

  • From: "Ethan Post" <post.ethan@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 5 Dec 2006 10:52:09 -0600

This command is in the 10G SQL documentation, it does not seem to run from
command line of 9i client, but will work as a PLSQL block.

Is this the case? I need to execute this command from a script using

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Dec 5 10:52:46 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

qa>purge recyclebin;
SP2-0734: unknown command beginning "purge recy..." - rest of line ignored.

Then I run it from 10g client.

SQL*Plus: Release 10.2.0.2.0 - Production on Tue Dec 5 10:42:34 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

SQL> connect / as sysdba
Connected.
SQL> purge recyclebin;

Recyclebin purged.

Works in PLSQL Block for 10G and 9i

SQL> begin
 2  execute immediate 'purge recyclebin';
 3  exception
 4  when others then
 5  dbms_output.put_line(dbms_utility.format_error_stack);
 6  end;
 7  /

PL/SQL procedure successfully completed.

Other related posts: