0

I am using an Oracle 18c database in a build system.

One of my builds is for a JPA/Hibernate project, which is configured as "create-drop". This means it will create all tables during startup and drop all of them again at the end.

The problem is: I can't configure Hibernate to create "drop ... purge" statements.

It seems that as a result the recycle bin has grown with each build, exceeding now the maximum allowed database size of 12 GB - and I am not even able to open the database anymore:

alter database open
*
ERROR at line 1:
ORA-12954: The request exceeds the maximum allowed database size of 12 GB.

I have now droped the PDB and created a new one - but this will last for at most a month, before I run into the same problem again.

My question: Is there any option to tell Oracle to immediately purge dropped tables?

3

Is there any option to tell Oracle to immediately purge dropped tables?

That would be disabling the recycle bin, if only for the current session. Include ALTER SESSION SET recyclebin = OFF in your build process, or, if this is a development system, you can consider turning it off via the instance initialization parameter.

Alternatively, you can choose running the build as a dedicated Oracle user; you will then DROP USER ... CASCADE at the end, which will drop all user's tables and other objects without placing them in the recycle bin.

  • 2
    There is also the option of running a purge recyclebin to purge the current user's recycle bin or purge dba_recyclebin to purge all users' recycle bins. – Justin Cave Nov 19 at 20:19
  • Thanks, I will go with the initialization parameter. Dropping the USER at the end would mean much more overhead in the build. – Tobias Liefke Nov 20 at 14:12
  • @JustinCave I tried purge recyclebin - but as it didn't finished after half an hour I would guess that this is nothing for a cronjob. And it is much more overhead to include it in the build, too. – Tobias Liefke Nov 20 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.