Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4555
  • Last Modified:

Temporary Tablespace

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
Tereza
Asked:
Tereza
3 Solutions
 
schwertnerCommented:
·      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
 
seazodiacCommented:
@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
 
geotigerCommented:

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now