Solved

Temporary Tablespace

Posted on 2004-04-13
4
4,544 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 47

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now