Select Page

Extending Oracle Tablespace – Quick and Dirty

Author: Christian Screen | | September 12, 2010

I was working on quick project and kept bumping an a “failure to initiate auto-extend…” message that was rather irritating.  I typically use SQLDeveloper over Toad and there is not immediate built-in functionality to manage tablespaces in that tool.  A quick Google search gave me some results and I figured I would quickly post the two step extension process here for later reference.

Step 1

Run the PL/SQL code to determine the current size of the tablespace in question. Notice how memory is divided by 1024 to get at the canonical data size.  The tablespace I was using for my project was the SYSTEM tablespace and it is referenced within the code in this post.  If you are using the USERS or a custom tablespace simple substitute your tablespace where you see SYSTEM.

select
file_name,
autoextensible,
(bytes/1024)/1024 usedmb,
(maxbytes/1024)/1024 maxmb,
round((((bytes/1024)/1024)
/ ((maxbytes/1024)/1024)) * 100) used_pct
from dba_data_files
where tablespace_name = 'SYSTEM';

Step 2

As we determined in the previous step, we now know how much of the tablespace is being used and what the current size and max sizes are.  To extend the space run the following query based on the information provided from the Step 1.  I want to increase my maxsize to a value that I know is within the bounds of my current volume but will still allow my data operations to continue without being held hostage by the error that started this discussion. To do that I pick a value such as 2000 MB and multiple it twice by 1024 (i.e.: 2000 x 1024 x 1024) .  The result of that math is the value I place for the maxsize in the following statement.

alter database datafile 'G:ORACLEXEORADATAXESYSTEM.DBF' autoextend on maxsize 2097152000;

Run the statement above and the tablespace maxsize will be set as desired.  Re-run the statement provided in Step 1 to see the values have changed and your percentage of use should now be changed as well.

References

http://garycoy.com/?page_id=13

Oracle BI Publisher (BIP) Tips: Functions, Calculations & More

Check out these BI Publisher tips including functions & calculations so you can understand more about the production and support of BI Publisher reports.

Sherry Milad | January 15, 2018

How to Index a Fact Table – A Best Practice

At the base of any good BI project is a solid data warehouse or data mart.

Christian Screen | March 16, 2010

Qlik vs. Tableau vs. Power BI: Which BI Tool Is Right for You?

Tableau, Power BI, and Qlik each have their benefits. What are they and how do you choose? Read this blog post for a quick analysis.

Tom Hoblitzell | June 6, 2019

Subscribe to Our Blog

Never miss a post! Stay up to date with the latest database, application and analytics tips and news. Delivered in a handy bi-weekly update straight to your inbox. You can unsubscribe at any time.

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS