0% found this document useful (0 votes)
12 views1 page

Table Space

The document discusses how to alter locally managed temporary tablespaces in Oracle database. It can add, take offline, or bring online tempfiles using ALTER TABLESPACE, but cannot change a permanent to temporary tablespace. ALTER DATABASE can also alter tempfiles by taking offline, bringing online, resizing, dropping including datafiles, enabling autoextend, or renaming tempfiles.

Uploaded by

dhivyaranee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Table Space

The document discusses how to alter locally managed temporary tablespaces in Oracle database. It can add, take offline, or bring online tempfiles using ALTER TABLESPACE, but cannot change a permanent to temporary tablespace. ALTER DATABASE can also alter tempfiles by taking offline, bringing online, resizing, dropping including datafiles, enabling autoextend, or renaming tempfiles.

Uploaded by

dhivyaranee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Altering a Locally Managed Temporary Tablespace :

===================================================================================
==========================================================
Note:

You cannot use the ALTER TABLESPACE statement, with the TEMPORARY keyword, to
change a locally managed permanent tablespace into a locally managed temporary
tablespace. You must use the CREATE TEMPORARY TABLESPACE statement to create a
locally managed temporary tablespace.
Except for adding a tempfile, taking a tempfile offline, or bringing a tempfile
online, as illustrated in the following examples, you cannot use the ALTER
TABLESPACE statement for a locally managed temporary tablespace.
===================================================================================
==========================================================

ALTER TABLESPACE lmtemp


ADD TEMPFILE '/u02/oracle/data/lmtemp02.dbf' SIZE 18M REUSE;

ALTER TABLESPACE lmtemp TEMPFILE OFFLINE;


ALTER TABLESPACE lmtemp TEMPFILE ONLINE;

===================================================================================
==========================================================
Note:

You cannot take a temporary tablespace offline. Instead, you take its tempfile
offline. The view V$TEMPFILE displays online status for a tempfile.
===================================================================================
==========================================================

However, the ALTER DATABASE statement can be used to alter tempfiles.

The following statements take offline and bring online tempfiles. They behave
identically to the last two ALTER TABLESPACE statements in the previous example.

ALTER DATABASE TEMPFILE '/u02/oracle/data/lmtemp02.dbf' OFFLINE;


ALTER DATABASE TEMPFILE '/u02/oracle/data/lmtemp02.dbf' ONLINE;

The following statement resizes a temporary file:


-------------------------------------------------
ALTER DATABASE TEMPFILE '/u02/oracle/data/lmtemp02.dbf' RESIZE 18M;

The following statement drops a temporary file and deletes the operating system
file:
-----------------------------------------------------------------------------------
--
ALTER DATABASE TEMPFILE '/u02/oracle/data/lmtemp02.dbf' DROP
INCLUDING DATAFILES;

The tablespace to which this tempfile belonged remains. A message is written to the
alert log for the datafile that was deleted. If an operating system error prevents
the deletion of the file, the statement still succeeds, but a message describing
the error is written to the alert log.

It is also possible to use the ALTER DATABASE statement to enable or disable the
automatic extension of an existing tempfile, and to rename (RENAME FILE) a
tempfile. See Oracle Database SQL Reference for the required syntax.

You might also like