How do I add data files for an Oracle tablespace or temporary table space?

Source: Internet
Author: User
Background:
When a new table is created from the CREATE table in Oracle, the new table has a larger amount of data, such as 1 billion, when Sql*plus is likely to prompt "ORA-01653: ..." error message. This error message implies that the table space is not large enough and requires additional data files for the tablespace.

Analysis:
1. Query table space remaining byte size
SELECT Tablespace_name, SUM (BYTES)/1024/1024 as "free Space (M)"
From Dba_free_space
WHERE tablespace_name = ' &tablespace_name '
GROUP by Tablespace_name;
Note: If it is a temporary table space, please inquire dba_temp_free_space
SELECT Tablespace_name, free_space/1024/1024 as "free Space (M)"
From Dba_temp_free_space
WHERE tablespace_name = ' &tablespace_name ';

2. If you do not know the table space data file directory planning, you can first query the table space all data files
SELECT Tablespace_name, file_id, file_name, bytes/1024/1024 as "BYTES (M)"
From Dba_data_files
WHERE tablespace_name = ' &tablespace_name ';
Note: If it is a temporary table space, please inquire dba_temp_files
SELECT Tablespace_name, file_id, file_name, bytes/1024/1024 as "space (M)"
From Dba_temp_files
WHERE tablespace_name = ' &tablespace_name ';

3. Additional data files for space-deficient tablespaces
ALTER tablespace &tablespace_name ADD datafile ' &datafile_name ' SIZE 2G;
Note: If you want to enlarge the temp table space, use the following statement
ALTER tablespace &tablespace_name ADD tempfile ' &datafile_name ' SIZE 2G;

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.