Six minutes to learn to create an Oracle tablespace the implementation steps _oracle

Source: Internet
Author: User

After a long period of learning to create Oracle Tablespace, so share with you, after reading this article you certainly have a lot of harvest, hope this article can teach you more things.

1, first query the free space

Copy Code code as follows:

Select Tablespace_name,file_id,block_id,bytes,blocks from Dba_free_space;

2, increase the Oracle table space

First, query the data file name, size and path information, the following statement:

Copy Code code as follows:

Select Tablespace_name,file_id,bytes,file_name from Dba_data_files;

3, modify the file size statement as follows

Copy Code code as follows:

ALTER DATABASE DataFile
' Need to increase the path of the data file, which is the path above the query
' Resize 800M;

4. Create Oracle Tablespace

Copy Code code as follows:

Create Tablespace Test
DataFile '/home/app/oracle/oradata/oracle8i/test01.dbf ' size 8M
Autoextend on
Next 5M
MaxSize 10M;

Create Tablespace Sales
DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize Unlimited
MaxSize Unlimited is not limited in size

Create Tablespace Sales
DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize 1000M
Extent management Local uniform;
The unform represents the same size and defaults to 1M

Create Tablespace Sales
DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize 1000M
Extent management local uniform size 500K;
The size of the Unform size 500K indicates that the area is the same as 500K

Create Tablespace Sales
DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize 1000M
Extent management local autoallocate;
The size of the Autoallocate representation area is changed automatically with the size of the table, and the large table uses the small table to use the district

Create Tablespace Sales
DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize 1000M
temporary;
Temporary create a dictionary to manage temporary table spaces

Create temporary tablespace sales
Tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
Autoextend on
Next 50M
MaxSize 1000M
Creates a local administration temp table space, and if it is a temporary tablespace, the datafile in all statements are swapped to Tempfile

8i system default Create dictionary to manage temporary table spaces, to create a local administration temp table space to add temporary tablespace keyword
You must not use the Atuoallocate parameter when creating a local administration temp table space, the system defaults to create uniform management mode

To add a data file to a table space:
Alter TABLESPACE sales Add
DataFile '/home/app/oracle/oradata/oracle8i/sales02.dbf ' size 800M
Autoextend on Next 50M
MaxSize 1000M;

Create a local administration temporary Oracle tablespace, and if it is a temporary tablespace, the datafile in all statements are replaced by the tempfile8i system default creation dictionary to manage temporary tablespace, to create a local administration temp table space to add temporary tablespace keyword to create a local administration temp table space, you must not use the Atuoallocate parameter, the system defaults to create uniform management method

To add a data file to a table space:

Copy Code code as follows:

Alter TABLESPACE sales Add
DataFile '/home/app/oracle/oradata/oracle8i/sales02.dbf ' size 800M
Autoextend on Next 50M
MaxSize 1000M;

5. Change Automatic Extended properties:

Copy Code code as follows:

ALTER DATABASE DataFile
'/home/app/oracle/oradata/oracle8i/sales01.dbf ',
'/HOME/APP/ORACLE/ORADATA/ORACLE8I/SALES02.DBF '
'/HOME/APP/ORACLE/ORADATA/ORACLE8I/SALES01.DBF
Autoextend off;

The above describes the creation of Oracle Tablespace, here to share with you, I hope to be useful.

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.