Manage tablespaces and datafiles 3-Extended tablespace

5) Drop tablespace
In general, the privileged user or dba comes to Cao Zu. If it is operated by other users, the

user is required to have the drop tablespace system permission
drop tablespace 'tablespace' including contents and datafiles;

Description:
including contents means to delete When a tablespace is used, all database objects in the space are deleted, and datafiles means that the database files (disk space) are also deleted.

6) Extended table space
The table space is composed of data files, and the size of the table space is actually the size of the data files added together. Then we can imagine that if the table employee is stored in the data01 table space, the initial size is 2m. When the data is full of 2m space, if you insert data into the employee table, an error of insufficient space will be displayed.

Case description:
1. Create a table space sp01
2. Create a common table mydment on the table space whose structure is the same as dept
3. Import dept data into the table insert into mydment select * from dept;
4. When a certain time There will be a problem that cannot be extended, what should I do?

5. To expand the table space and add more storage space for it, there are three methods:

expand the table space
1) Increase the data file
sql> alter tablespace table space name add datafile 'e:\sp002.dbf' size 20m

2) Modify the size of the data file (the latter value refers to the size to be modified)
sql>alter database datafile 'e:\sp001.dbf' resize 20m;
it should be noted here that the size of the data file should not exceed 500m

3) Set the automatic growth of the file
sql>alter database datafile 'e:\sp001.dbf' autoextend on nex

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327039394&siteId=291194637