Specialized IT Services focused on Data Management | Speak with Us 877-634-9222
Art of BI: Extending Oracle Tablespace – Quick and Dirty
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.
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.
/ ((maxbytes/1024)/1024)) * 100) used_pct
where tablespace_name = ‘SYSTEM’;
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.