Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Temporary Tablespace

Posted on 2004-04-13
4
Medium Priority
?
4,554 Views
Last Modified: 2008-01-16
I have a question about temporary tables......Is there a setting, parameter or something in the database server that one sets to flush out the temporary tablespaces....It appears that when my user, Discoverer, etc use it for sorting it stays full until a reboot.....
THanks
0
Comment
Question by:Tereza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 1000 total points
ID: 10812267
·      SORT_AREA_RETAINED_SIZE specifies (in bytes) the maximum amount of the user global area (UGA) memory retained after a sort run completes. The retained size controls the size of the read buffer, which Oracle uses to maintain a portion of the sort in memory. This memory is released back to the UGA, not to the operating system, after the last row is fetched from the sort space.
Oracle may allocate multiple sort spaces of this size for each query. Usually, only one or two sorts occur at one time, even for complex queries. In some cases, however, additional concurrent sorts are required, and each sort keeps its own memory area. If the shared server is used, allocation is to the SGA until the value in SORT_AREA_RETAINED_SIZE is reached. The difference between SORT_AREA_RETAINED_SIZE and SORT_AREA_SIZE is allocated to the PGA.


Note:
Oracle does not recommend using the SORT_AREA_RETAINED_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_RETAINED_SIZE is retained for backward compatibility.  



      PGA_AGGREGATE_TARGET = integer [K | M | G]

·      PGA_AGGREGATE_TARGET specifies the target aggregate PGA memory available to all server processes attached to the instance. You must set this parameter to enable the automatic sizing of SQL working areas used by memory-intensive SQL operators such as sort, group-by, hash-join, bitmap merge, and bitmap create.
Oracle uses this parameter as a target for PGA memory. Use this parameter to determine the optimal size of each work area allocated in AUTO mode (in other words, when WORKAREA_SIZE_POLICY is set to AUTO.
Oracle attempts to keep the amount of private memory below the target specified by this parameter by adapting the size of the work areas to private memory. When increasing the value of this parameter, you indirectly increase the memory allotted to work areas. Consequently, more memory-intensive operations are able to run fully in memory and less will work their way over to disk.
When setting this parameter, you should examine the total memory on your system that is available to the Oracle instance and subtract the SGA. You can assign the remaining memory to PGA_AGGREGATE_TARGET.


0
 
LVL 23

Assisted Solution

by:seazodiac
seazodiac earned 600 total points
ID: 10813316
@tereza: --->I have a question about temporary tables......Is there a setting, parameter or something in the database server that one sets to flush out the temporary tablespaces....It appears that when my user, Discoverer, etc use it for sorting it stays full until a reboot.....



Temporary tablespace will return back to normal only after SMON process get around to clean it up and return it. As to when it does that, it's up to Oracle. but you can safely ignore that, because although it appears to be full, you can force it to be reclaimed when your user or sessions require the temp segment for sorting...

so My suggestion : pretend it does not happen....

0
 
LVL 12

Accepted Solution

by:
geotiger earned 400 total points
ID: 10813369

If you have a very busy server, you either need to have a large amount of memory to allow you to set up sort area as suggested by schwertner or to have a lot of disk space to allow Oracle automatically to allocate temporary space for sorting.  Make sure your temp tablespace is "locally managed" so that it will not grow too big.

A reboot is a thourogh way to nullify the usage of the tablespace, but it will not take back what has been allocated to the tablespace. In order to take back the disk space, you may have to drop the temp tablespace as suggested in this Q&A:

http://www.experts-exchange.com/Databases/Oracle/Q_20827160.html

GT
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question