Set the default tablespace in Oracle

Source: Internet
Author: User

Set the default tablespace in Oracle

In Oracle, the user's default permanent tablespace is system, and the default temporary tablespace is temp. If all users use the default temporary tablespace, the system and temp tablespaces will undoubtedly be more competitive.

Oracle allows the use of custom tablespace as the default permanent tablespace, and the use of custom temporary tablespace as the default temporary tablespace.

The syntax for setting the default tablespace is as follows.

Alter database default [temporary] tablespace tablespace_name
If the temporary keyword is used, the default temporary tablespace is set. If this keyword is not applicable, the default permanent tablespace is set.

Query the default tablespace
Select property_name, property_value from database_properties where property_name in ('default _ PERMANENT_TABLESPACE ', 'default _ TEMP_TABLESPACE ');

PROPERTY_NAME PROPERTY_VALUE
----------------------------------------
DEFAULT_TEMP_TABLESP TEMP

DEFAULT_PERMANENT_TA USERS
As shown in the preceding query results, the default temporary tablespace is temp and the default tablespace is users.

SQL> create tablespace testpsace
2 datafile 'e: \ oracledata \ testspace. dbf'
3 size 10 m;

The tablespace has been created.

SQL> alter database default tablespace testspace;

The database has been changed.

SQL> alter database default temporary tablespace mytemp;

The database has been changed.

Query again as follows:
SQL> select property_name, property_value from database_properties where property_name in ('default _ PERMANENT_TABLESPACE ', 'de
FAULT_TEMP_TABLESPACE ');
PROPERTY_NAME PROPERTY_VALUE
----------------------------------------
DEFAULT_TEMP_TABLESPACE MYTEMP


DEFAULT_PERMANENT_TABLESPACE TESTSPACE
The default tablespace is modified.

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.