Oracle 10 Gb temporary tablespace Group

Source: Internet
Author: User

Overview of temporary tablespace groups

In Oracle 10 Gb, you can create multiple temporary tablespaces and form a temporary tablespace group. In this way, you can use multiple temporary tablespaces in the group for sorting, A temporary tablespace group must have at least one temporary tablespace. the maximum number of tablespaces is unlimited. The group name cannot be the same as the name of a tablespace.
A temporary tablespace group is created by specifying the group clause when creating a temporary tablespace. If you delete all temporary tablespaces in the group, the group also disappears.
We can move a tablespace from one group to another, delete a temporary tablespace from one group, or add a new tablespace to the group.
Using Temporary tablespace groups has the following advantages:
1. You can specify multiple temporary tablespace at the database level to avoid disk sorting problems when the temporary tablespace is insufficient;
2. When a user has multiple sessions at the same time, they can use different temporary tablespace;
3. In parallel operations, different subordinate processes can use different temporary tablespace
Use temporary tablespace groups
Create a temporary tablespace group:
SQL> create temporary tablespace tempts1 tempfile
2'/home/oracle/temp1_02.dbf' size 2 M tablespace group group1;
Tablespace created
SQL> create temporary tablespace tempts2 tempfile
2'/home/oracle/temp2_02.dbf' size 2 M tablespace group group2;
Tablespace created
Query temporary tablespace groups
SQL> select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME
------------------------------------------------------------
GROUP1 TEMPTS1
GROUP2 TEMPTS2
Move a tablespace from a temporary tablespace group to another temporary tablespace group:
SQL> alter tablespace tempts1 tablespace group GROUP2;
Tablespace altered
SQL> select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME
------------------------------------------------------------
GROUP2 TEMPTS1
GROUP2 TEMPTS2
Designate a temporary tablespace group to the user
SQL> alter user scott temporary tablespace GROUP2;
User altered
Set temporary tablespace at the database level
SQL> alter database <db_name> default temporary tablespace GROUP2;
Database altered.
Delete a temporary tablespace group (delete all temporary tablespaces that constitute the temporary tablespace Group)
SQL> drop tablespace tempts1 including contents and datafiles;
Tablespace dropped
SQL> select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME
------------------------------------------------------------
GROUP2 TEMPTS2
SQL> drop tablespace tempts2 including contents and datafiles;
Tablespace dropped
SQL> select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME

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.