Avoid Transaction Errors Due To Tablespace Shortage

How many times we have had a call from application teams regarding a session error due to a tablespace (either DATA, TEMP or UNDO) getting 100% full?
How many times we had ask for an estimate of space used by a process, session or transaction?
There are several options that can help us overcome this type of issues.
a)    If you are using Oracle Enterprise Manager (if you don’t, you should), make use of Corrective Actions to manage your data tablespaces.
b)    If your issue is more with tablespace quotas, TEMP or UNDO you may want to enable RESUMABLE session
RESUMABLE is an option which allows the session to go into a suspended state in such a way that it won’t fail/abort. The session cannot wait forever though, this is controlled by RESUMABLE_TIMEOUT initialization parameter.
In order to enable this option at the session level you have to execute below SQL statement:
SQL> ALTER SESSION ENABLE RESUMABLE;                                                                                                    
Alertlog file will record if the session entered into suspended mode.
Some examples are:
###########
statement in resumable session ‘User TEST1(32), Session 3, Instance 2’ was
suspended due to
ORA-01536: space quota exceeded for tablespace ‘USERS’

###########
statement in resumable session ‘User TEST1(32), Session 15, Instance 1’ was
suspended due to
ORA-01562: failed to extend rollback segment number 4

###########
statement in resumable session ‘User TEST1(32), Session 23, Instance 1’ was
suspended due to
ORA-01652: unable to extend temp segment by 32 in tablespace TEMP

###########
statement in resumable session ‘User TEST1(54), Session 2, Instance 1’ was
suspended due to
ORA-01653: unable to extend table TEST1.TEST_RESUMABLE by 256 in tablespace USERS

While the session is into this suspended state it will account time to the “statement suspended, wait error to be cleared” wait event.


Once the error that sent the session to the suspended state is fixed, the session will resume its work.
More details on below Oracle’s documentation:
Thanks,
Alfredo