Oracle Rename and delete tablespaces

Source: Internet
Author: User

Oracle Rename and delete tablespaces

You can modify the name of a table space as needed. Modifying the table space name does not affect the data in the table space. However, the system tablespace and sysaux names cannot be modified.
The syntax for renaming a tablespace is as follows:
Alter tablespace tablespace_name rename to new_tablespace_name;
Note:
If the tablespace status is offline, The tablespace cannot be renamed.
Delete a tablespace
To delete a tablespace, use the drop tablespace statement. The syntax is as follows:
Drop tablespace tablespace_name [including contents [and datafiles]
Syntax description:
Including contents
Deletes all database objects in the tablespace while deleting the tablespace. This option is required if the tablespace contains database objects.
And datafiles
Delete the data files corresponding to the tablespace while deleting the tablespace. If this option is not applicable, the delete tablespace only deletes information about the tablespace from the data dictionary and control file, and does not delete the data files corresponding to the tablespace in the operating system.

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
13 rows have been selected.

SQL> alter tablespace mytemp rename to userspace;

The tablespace has been 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

13 rows have been selected.

SQL> drop tablespace userspace
2 including contents and datafiles;
The tablespace has been deleted.

How to handle Undo tablespace failures

Oracle Undo tablespace reconstruction and restoration

Oracle 11g installation manual on RedHat Linux 5.8 _ x64 Platform

Installing Oracle 12C in Linux-6-64

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

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.