Oracle XE Help tablespace bloated

Posted on 2009-04-08
Last Modified: 2012-05-06
I am not an Oracle DBA, I have managed to install XE on my home PC to enable me to develop reporting tools using Excel, and therefore to emulate my work DB.  To do this I have recently had to truncate and re-populate a number of large(ish) tables.

The problem now seem to have is I appear to have hit a limit, not THE limit in terms of the 4GB DB size, but a limit, on what I think to be 2 of the TABLESPACES on the DB.

My question is, how to I "shrink" them?  I have tried the compact database function within the XE interface which reports back:
Space Allocated: 1,590 MB
Available:      3,530 MB
Maximum Allowable: 5,120 MB
Percent Used:      31%
Which seems to suggest I have more capacity, however when I view the DB through SQLSeveloper, it shows the following
SYSTEM       PCT_USED: 97.75 ALLOCATED:350 USED:342.13 FREE:7.88
SYSAUX      PCT_USED: 97.02 ALLOCATED: 300 USED:291.06 FREE: 8.94
UNDO      PCT_USED: 81.2 ALLOCATED: 500 USED: 406 FREE: 94
USERS      SPCT_USED: 47.06      ALLOCATED: 940 USED: 442.38 FREE: 497.63

It would seem that both the SYSTEM and SYSAUX tablespaces are the problem, however I do not have the first idea of what to do to overcome this; I have tried dropping a couple of large tables from the DB, but this has only freed up space in the USER tablespace.

Any help greatly appreciated.

Question by:MISServices
  • 3
  • 3

Expert Comment

ID: 24095189

What is the exact error message or what makes you think you hit a limit?
LVL 47

Expert Comment

ID: 24095310
If you the above mentioned  feeling you can put the tablespaces in autoextend mode
and they will not cause expansion problems:

alter database datafile    '/u01/app/oracle/SYSTEM01.dbf'  autoextend on;

Find the correct names and locations of that files.

Be aware that these percents are normal for these tablespaces and
in the common case autoextend is set to ON.


Author Comment

ID: 24096878
OK, so from what schwertner has said, the size of the 2 tablespaces I refer to is not the issue.  As is typical in these cases I am now attempting to append byte-sized parts of the table, and as yet they have not failed to append.  However I still feel there is an issue, that I am not fully understanding, and that is why it takes so long to append the rows, and I mean a very long time indeed.  For example the table I am trying to append from is over 1.5 million rows, if I was to append the lot into the XE equivalent table it would take over 3 hours, some times longer before Access reports back (usually with a failure error).

So is the approach I am using appropriate, e.g. I use a make table query at work to create an Access table of the Oracle table.  At home I then link the XE equivalent table and run an MS Access append query.  Is there a more efficient way to achieve the same results?
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Author Comment

ID: 24097856
I have now managed to attempt an append that has resulted in an error.  The error, as reported back by MS Access is:
ODBC insert on linked table [TableName] failed.
[Oracle][ODBC][Ora]ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO'(#30036)

Both the UNDO tablespace and USER tablespace or at 99-100%

The append query (100,000 rows) took 2 hours before it failed!

LVL 47

Accepted Solution

schwertner earned 500 total points
ID: 24098024
It is so, because you have to try to append the rows in small chunks.
about 1000 rows every and to COMMIT in order to empty the UNDO segment.
This is not enough. There is an parameter UNDO_RETENTION that you should
set to a very low level.

There are experts that claim that it is possible to insert without affecting the size
of the UNDO segment:
They suggested to use:
 insert /*+APPEND */ into ... select ... from [some other table or view]
But the table must be defined (or altered) to "nologging".

Also to speed up the inserting you can disable all indexes on the thable(s)
and enable them after insert.

Author Closing Comment

ID: 31568463
Thanks schwertner

Based on your advice I created a VBA function that dynamically created append queries of 500 rows a time, worked a dream, and none of the issues previously mentioned arose.  I also found that by turning the LOGGING off for both the table and it's indexes reduced the append query by a further 8-10 secs, per 500 rows.  So, I would suggest this is the best solution if you are to use Access as the vehicle for appending the data.

Having said all of this I have procured a copy of DATA LOADER which seems to handle things in a tidier way.

Thanks again for your advice.
LVL 47

Expert Comment

ID: 24110552
Thats a fantastic news!
Good luck!

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
statspack purge automate 7 50
alter database link to change the password 2 45
File generation using utl_file 4 45
Oracle -- identify blocking session 24 41
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now