Solved

Temporary Tablespace

Posted on 2004-04-13
4
4,548 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
4 Comments
 
LVL 12

Expert Comment

by:catchmeifuwant
ID: 10812200
0
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 250 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 150 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 100 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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

789 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