Oracle tablespace & datafiles-Oracle tablespace-application instance (2)

Source: Internet
Author: User

1. Create tablespace test: Create a tablespace named test. The size of test is 8 m, the automatic growth step is 5 m, and the maximum space is 10 m.

Create tablespace test datafile '/home/APP/Oracle/oradata/Oracle8i/test01.dbf' size 8 m autoextend on next 5 m maxsize 10 m;

 

2. Create tablespace sales: Create a tablespace named sales. The sales size is 800 m, and the automatic growth step is 50 M. There is no maximum space limit.
Create tablespace sales datafile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize unlimited; -- the size is unlimited.

 

3. Create tablespace sales: Create a tablespace named sales. The sales size is 800 m, the automatic growth step is 50 m, and the maximum space is 1000 m,

The local management mode is used. unform indicates that the partition size is the same. The default value is 1000 MB.
Create tablespace sales datafile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize 1000 m extent management local uniform; -- unform indicates the same partition size. The default value is 1000 m.

 

4. Create tablespace sales: Create a tablesapce named sales. The sales size is 800 m, the automatic growth step is 50 m, and the maximum space is 1000 m,

The local management mode is used. The uniform indicates that the partition size is 500 mb.
Create tablespace sales datafile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize 1000 m extent management local uniform size 500 K; -- unform size 500 k; indicates the same partition size, which is 500 k

 

5. Create tablespace sales: Create a tablespace named sales. The sales size is 800 m, the automatic growth step is 50 m, and the maximum space is 1000 m,

Local management is adopted. automaticate indicates that the partition size automatically changes with the table size. Large tables use large partitions and small tables use small partitions.
Create tablespace sales datafile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize 1000 m extent management local autoallocate; -- autoallocate indicates that the partition size changes automatically and dynamically with the table size. Large tables use small tables in large regions and small tables use cells.

 

6. Create tablespace sales: Create a tablespace named sales. The sales size is 800 m, the automatic growth step is 50 m, and the maximum space is 1000 m,

Temporary indicates creating a temporary tablespace for dictionary management.
Create tablespace sales datafile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize 1000 m temporary; -- temporary create a dictionary to manage temporary tablespace

 

7. create temporary tablespace sales: create a temporary tablespace named sales, and the datafile becomes tempfile.
Create temporary tablespace sales tempfile '/home/APP/Oracle/oradata/Oracle8i/sales01.dbf' size 800 m autoextend on next 50 m maxsize 1000 m -- create a local temporary tablespace for management, if it is a temporary tablespace, The datafile in all statements is replaced by the tempfile 8i system default create a dictionary to manage the temporary tablespace. To create a local temporary tablespace, add the temporary tablespace keyword.

 

8. Do not use the atuoallocate parameter when creating a local temporary tablespace for management. By default, the system creates an uniform management mode to add data files to the tablespace:
Alter tablespace sales add datafile '/home/APP/Oracle/oradata/Oracle8i/sales02.dbf' size 800 m autoextend on next 50 m maxsize 1000 m;

 

9. add data files to the tablespace

Alter tablespace sales add datafile '/home/APP/Oracle/oradata/Oracle8i/sales02.dbf' size 800 m autoextend on next 50 m maxsize 1000 m;

 

10. Change auto scaling attributes

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;

 

11. Delete tablespaces

Drop tablespace test including contents and datafiles cascade constraints;

For the syntax, see Orale tablespace & datafile -- Oracle tablespace

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.