Oracle resolution Ora-01653 cannot extend tablespace ____oracle

Source: Internet
Author: User


Problem Description:
When generating large amounts of data for performance testing, the current table data 100w is generated from the stored procedure, and then the data for the past two months is generated from the current table data through another stored procedure-that is, the history table contains 60 days of data, and the amount of data per day is 100w. If it is successfully generated, the history table will have 6000w of data.
After the current table data generation completes, the stored procedure that executes the build history table data encounters a "ora-01653:unable to extend table" error.



Problem solving:
There are generally two situations in which this table space problem occurs:
1, the table space does not use, has reached the limit of automatic expansion;
2, the automatic expansion of the table space function is not open.



View table space usage first for probability 1
SELECT UPPER (f.tablespace_name) Table space name,
d.tot_grootte_mb tablespace size (M),
D.tot_grootte_ Mb-f.total_bytes "used Space (M)",
To_char ROUND (d.tot_grootte_mb-f.total_bytes)/d.tot_grootte_mb * 100,2), ' 990.99 ' "Use ratio",
F.total_bytes free Space (m),
F.max_bytes maximum block (m)
from (SELECT tablespace_name,
ROUND (SUM (BYTES) /(1024 * 1024), 2 total_bytes,
ROUND (MAX (BYTES)/(1024 * 1024), 2) Max_bytes
from SYS. Dba_free_space
GROUP by Tablespace_name) F,
(SELECT DD. Tablespace_name,
ROUND (SUM (DD). BYTES)/(1024 * 1024), 2) TOT_GROOTTE_MB
from SYS. Dba_data_files DD
GROUP by DD. Tablespace_name) D
WHERE d.tablespace_name = f.tablespace_name
ORDER by 4 DESC;
SELECT t.tablespace_name,d.file_name,d.autoextensible,d.bytes,d.maxbytes,d.status
from Dba_tablespaces T, Dba_data_files D
WHERE t.tablespace_name =d.tablespace_name
Order by Tablespace_name,file_name;




We can see from the table that table space ***_trd space usage has reached 99.6%, leaving only 133.88M available, and its index space ***_trd_idx space usage is reached 99.97%, only 4.94M available.



To see if the table space has the ability to automatically expand
SELECT T.tablespace_name,d.file_name,d.autoextensible,d.bytes,d.maxbytes,d.status
From Dba_tablespaces t,dba_data_files D
WHERE T.tablespace_name =d.tablespace_name
Order BY Tablespace_name,file_name;


As you can see from the table above, all of the table spaces have the function of automatically expanding, and the state is available



By synthesizing the above results, it can be concluded that the problem encountered is due to the possibility of 1-tablespace deficiency. The solution is to enlarge the table space



Four ways to enlarge the table space:
1. Add Data files
ALTER tablespace ***_trd ADD datafile
' D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBFILE\TRD_2.DBF ' SIZE 1024M;



2, add data files and allow automatic growth
ALTER tablespace ***_trd ADD datafile
' D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBFILE\TRD_2.DBF ' SIZE 1024M autoextend on NEXT 8M MAXSIZE 10240M;



3. Allow existing data files to grow automatically
ALTER DATABASE datafile ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBFILE\TRD. DBF '
Autoextend on NEXT 8M MAXSIZE 10240M;



4, manually change the existing data file size
ALTER DATABASE datafile ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBFILE\TRD. DBF '
RESIZE 10240M;



In the actual solution process, we use the Method 2.



For specific projects, it is necessary to determine the optimal method according to the actual situation of each table in the table space, without further elaboration.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.