|
In case of need, you can modify the name of the table space. Modify the name of the table space will not affect the data table space. But can not modify the system table space system and sysaux name.
Rename table space syntax is as follows:
alter tablespace tablespace_name rename to new_tablespace_name;
note:
If the table space state is offline, you can not rename the table space.
Delete table space
Delete table space need to use drop tablespace statement, its syntax is as follows:
drop tablespace tablespace_name [including contents [and datafiles]]
The syntax follows:
including contents
It means to delete the table space at the same time, delete all database objects in the table space. If you have a database table space objects, you must use this option.
and datafiles
Means to delete the table space at the same time, remove the table space corresponding to the data file. If this option is not applicable, then delete the table space is merely removed from the data dictionary and the control file information about the table space, but does not delete the operating system with the corresponding table space data file.
SQL> select tablespace_name, status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
MYTEMP ONLINE
TEMPGROUP ONLINE
TEMPGROUP02 ONLINE
MYBIGSPACE ONLINE
BLOCKSPACE ONLINE
INSPUR ONLINE
TESTSPACE ONLINE
TEST ONLINE
Line 13 has been selected.
SQL> alter tablespace mytemp rename to userspace;
Table space has changed.
SQL> select tablespace_name, status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
USERSPACE ONLINE
TEMPGROUP ONLINE
TEMPGROUP02 ONLINE
MYBIGSPACE ONLINE
BLOCKSPACE ONLINE
INSPUR ONLINE
TESTSPACE ONLINE
TEST ONLINE
Line 13 has been selected.
SQL> drop tablespace userspace
2 including contents and datafiles;
Table space has been deleted. |
|
|
|