Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • plan10g.sql good Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • reset Sequence Oracle
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • Windows based Command line mailing program like mailx (Sednmail for windows) PHP/MYSQL/Wordpress
  • Load SPM baseline from AWR Oracle
  • eplan.sql Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • TRUNCATE table and disabling referential constraints. Oracle

Temporary tablespace explaination

Posted on 10-Apr-2008 By Admin No Comments on Temporary tablespace explaination

A new mechanism to control the allocation of temporary storage space was

introduced in 7.3, initially as support for OPS, but it is equally applicable

to non-OPS environments. This requires the creation of a designated temporary

tablespace, that is one created with the designation TEMPORARY. The effect of

this is twofold:

1. No permanent objects (tables, indexes, etc.) can be stored in such a

tablespace.

2. A temporary segment created in this tablespace will not be de-allocated

at the end of the sort. Instead the extents are MARKED as free, are not

placed back on the freelist, and are retained for reuse. An element called

the Sort Extent Pool (SEP) is created in the SGA to describe them.

Subsequent sort operations will then be allocated extents from this pool

via a memory lookup, thereby avoiding most of the space management tasks

described above.

The temporary segment containing this “pool” of extents is referred to as an

“instance” and there will be one for each OPS instance opening the database.

Each instance will maintain its own SEP. The view V$SORT_SEGMENT makes these

visible. It contains information about every sort segment created in the

LOCAL instance. So, if node 1 executed a statement which created a sort

segment, node 2 will not see the entry in V$SORT_SEGMENT unless it has

already executed some statements which created a sort segment in node 2’s

instance.

The view DBA_SEGMENTS contains information about segments in the entire

database. So, if all nodes create sort segments, there will be multiple

entries in DBA_SEGMENTS, one for each node.

A single instance configuration will have just the one segment, hence one

pool of extents.

Another advantage for an OPS environment occurs when a sort requires an extent

and there are none free in the pool. The segments may grow in the usual way,

but if another instance does have a free extent, this can be re-assigned from

one pool to the other.

During a sort operation, the number of sort segment(s) created should

eventually grow to a stable point where no new extents are allocated. If

large sorts are occurring, which take up all of the available space, then

the operation may receive an ORA-1652. The solution here is to add additional

files to the tablespace.

It has also been observed that in an OPS environmemt ORA-1652 messages occur

in the alert.log while the re-assignment from one instance’s SEP free extents

to the requesting one seems to be working fine because client sessions

do not get the ORA-1652. This suggests that the re-allocation is internally

triggered by event 1652, and the ORA-1652 is not surpressed from being

written to the alert.log. This can be quite confusing for DBA’s.

SQL commands

============

1. CREATE TABLESPACE

DATAFILE …

DEFAULT STORAGE (…)

TEMPORARY;

or

ALTER TABLESPACE

TEMPORARY;

2. ALTER USER TEMPORARY TABLESPACE ;

N.B. The DEFAULT STORAGE clause governs the size of the sort extents created

within a tablespace. This should always be a multiple of the SORT_AREA_SIZE

specified in the init.ora file for each instance.

Oracle, SQL scripts

Post navigation

Previous Post: restarting network in linux
Next Post: changing kernel parameter in Oracle Enterpise Linux

Related Posts

  • find_pk.sql /* Find Primary Key */ Oracle
  • Rollback force for distributed transactions Oracle
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • How to check current redo log progress redo_progress.sql Oracle
  • Parallel DML Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Single character replacement in Unix Linux/Unix
  • Removing first line Linux/Unix
  • Finding locked objects Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Session_info.ksh Linux/Unix
  • how to find VIP from ifconfig Linux/Unix
  • Ports used by Oracle Software Oracle
  • send attachment from unix-shell script Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme