Temporary table space creation, deletion, setting default temp table space

Source: Internet
Author: User

---Create temporary table spaces:

/* Formatted on 2009/11/20 16:03 (Formatter Plus v4.8.7) * *
CREATE Temporary tablespace temp001
Tempfile '/opt/oracle/oradata/orcl/temp001.dbf '
SIZE 200m
Autoextend on
NEXT 32m MAXSIZE 2048m
EXTENT MANAGEMENT Local;


--Delete temporary table space:
DROP tablespace temp001 including CONTENTS and datafiles;

---Note:
1) datafile: Table space data File storage path
2) SIZE: initially set to 200M
3) Uniform: The designated area size is 128k, if not specified, the zone size defaults to 64k
4 Space name temp001 and data file name TEMP001.DBF do not require the same, can be arbitrarily named
5) Autoextend On/off indicates start/stop automatic expansion of table space
6 ALTER DATABASE datafile '/opt/oracle/oradata/orcl/temp001.dbf ' RESIZE 500m; Manual modification

Data file size is 500M

Setting the default temp table space

The main idea is that Oracle must have a default temporary tablespace, set up a temporary tablespace temp1 and default it, then delete temp temporary table space, then create temp temporary tablespace, designate temp as the default temporary tablespace, and finally remove Temp1 temporary tablespace space.

/* Formatted on 2009/11/24 19:48 (Formatter Plus v4.8.7) * *
CREATE Temporary tablespace temp tempfile '/opt/oracle/oradata/orcl/temp.dbf ' SIZE 1024 m

Autoextend on NEXT m MAXSIZE Unlimited;

/* Formatted on 2009/11/24 20:09 (Formatter Plus v4.8.7) * *
ALTER DATABASE DEFAULT Temporary tablespace Temp


/* Formatted on 2009/11/24 19:50 (Formatter Plus v4.8.7) * *
ALTER DATABASE tempfile '/opt/oracle/oradata/orcl/temp.dbf ' RESIZE 1024 m;

DROP tablespace temp1 including CONTENTS and datafiles;


COMMIT;

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.