Solved

Clean Temporary Segments

Posted on 2014-10-24
9
182 Views
Last Modified: 2014-11-25
I can see several temporary segments eating about 485 MB in one of the schemas in my database:

SEGMENT_NAME				 TABLESPACE_NAME		SEGMENT_TYPE		   MB
---------------------------------------- ------------------------------ ------------------ ----------
4.194730				 USERS				TEMPORARY		.0625
4.194722				 USERS				TEMPORARY		.0625
4.194634				 USERS				TEMPORARY		.0625
4.194626				 USERS				TEMPORARY		.0625
4.194554				 USERS				TEMPORARY		.0625
4.194474				 USERS				TEMPORARY		.0625
4.194450				 USERS				TEMPORARY		.0625
4.194442				 USERS				TEMPORARY		.0625
6.370					 USERS				TEMPORARY		  104
6.354					 USERS				TEMPORARY		   13
4.30594 				 USERS				TEMPORARY		  104
4.122354				 USERS				TEMPORARY		   13
4.58578 				 USERS				TEMPORARY		    2
4.10322 				 USERS				TEMPORARY		   43
4.78234 				 USERS				TEMPORARY		   13
6.34810 				 USERS				TEMPORARY		   28
6.71458 				 USERS				TEMPORARY		  112
4.181154				 USERS				TEMPORARY		   53

18 rows selected.

Open in new window


I bounced the database but they are still there. Can you please help me clean them?
0
Comment
Question by:sysautomation
9 Comments
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 40403864
Hi!

Cleaning up temporary segments is done automatically by SMON for DMT.
However, you can do that manually, by
alter tablespace USERS coalesce;

http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3002.htm

Regards,
    Tomas Helgi
0
 

Author Comment

by:sysautomation
ID: 40403990
I have already tried coalesce but no change.
0
 
LVL 5

Expert Comment

by:Sanjeev Labh
ID: 40404310
I think the link below covers the issue quite nicely, with various other options to remove the temporary segments.

http://askdba.org/weblog/2009/07/cleanup-temporary-segments-in-permanent-tablespace/
0
 

Author Comment

by:sysautomation
ID: 40427822
Sorry I could not see it timely. But none of the solutions given worked for me.

SQL> select ts# from sys.ts$ where name = 'USERS';

       TS#
----------
       4

SQL> alter session set events 'immediate trace name DROP_SEGMENTS level 5';

Session altered.

But still I have temporary segments as before:

SQL>  select tablespace_name, sum(bytes/1024/1024) from dba_segments
  2* where segment_type = 'TEMPORARY' group by tablespace_name

SQL> /

TABLESPACE_NAME              SUM(BYTES/1024/1024)
------------------------------ --------------------
USERS                                 488.5625


Second method is throwing some error:

SQL> exec DBMS_SPACE_ADMIN.TABLESPACE_VERIFY('USERS');
BEGIN DBMS_SPACE_ADMIN.TABLESPACE_VERIFY('USERS'); END;

*
ERROR at line 1:
ORA-08103: object no longer exists
ORA-06512: at "SYS.DBMS_SPACE_ADMIN", line 83
ORA-06512: at line 1
0
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.

 
LVL 5

Expert Comment

by:Sanjeev Labh
ID: 40429287
You have not posted as to what type of operation was in progress. Did you try to find and see whether it was a DDL. Because for that you will not be able to drop till the time the operation finishes.
0
 

Author Comment

by:sysautomation
ID: 40429789
I am not aware of any operation going on. It has been about a month old problem and hence even if a DDL was run it should have finished by now. Also the DB was bounced a few times therefore any operation would have been killed before completion.
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 40465658
They are kept around for reuse. If you dump and reload data sure they disappear for short time DB spins up.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40465759
They probably should not have survived a database bounce.

There are many posts out there that talk about the tablespace being read only but I cannot imagine USERS being set to read only.  If it is, set it to read write and try the coalsece again.

If that isn't the case try removing ALL temp segments:
alter session set events 'immediate trace name DROP_SEGMENTS level 2147483647';

If they remain, I would probably open up an SR with Oracle Support.
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 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 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

22 Experts available now in Live!

Get 1:1 Help Now