TEMP_TSXX.dbf files [message #400966] |
Thu, 30 April 2009 13:11 |
nateholtrop
Messages: 37 Registered: May 2008
|
Member |
|
|
I have quite a few of these files and they are taking up large amounts of disk. Is it safe to remove them? How do I go about removing them safely? Thanks
-Nate
|
|
|
|
|
|
|
|
Re: TEMP_TSXX.dbf files [message #401131 is a reply to message #400966] |
Fri, 01 May 2009 14:11 |
gkrishn
Messages: 506 Registered: December 2005 Location: Putty a dark screen
|
Senior Member |
|
|
Query dba_tablespaces to see how many temporary tablespaces you have . query dba_users to see what temporary tablespaces are assigned to users. Let make one as your default tablespace,assign users to it and you may drop other .
[Updated on: Fri, 01 May 2009 14:12] Report message to a moderator
|
|
|
Re: TEMP_TSXX.dbf files [message #401136 is a reply to message #400966] |
Fri, 01 May 2009 14:57 |
nateholtrop
Messages: 37 Registered: May 2008
|
Member |
|
|
Plan of action
*create new default temp tablespace based off old version. - Done through OEM.
*blow away old and old files - done through console
*leave new temp tablespace place
I can do most of this with OEM and the CLI of my HPUX server.
Comments?
|
|
|
Re: TEMP_TSXX.dbf files [message #401193 is a reply to message #400966] |
Sat, 02 May 2009 03:51 |
gkrishn
Messages: 506 Registered: December 2005 Location: Putty a dark screen
|
Senior Member |
|
|
i would prefer to do everything in command line.you may do few test in your local database before you proceed. here are the sqls for you.
1.SELECT TABLESPACE_NAME FROM DBA_TABLESPACES
WHERE CONTENTS='TEMPORARY';
2.SELECT * FROM DATABASE_PROPERTIES where PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';
3.select username,temporary_tablespace from dba_users;
4.ALTER DATABASE DEFAULT TEMPORARY TABLESPACE <<your temporary tablespace>>
5.select username,temporary_tablespace from dba_users; -- to make sure all users are assigned default temp tablespace.
6.drop other temporary tablespaces listed in step 2.
DROP TABLESPACE <<tablespacename>>
INCLUDING CONTENTS AND DATAFILES;
|
|
|
|
Re: TEMP_TSXX.dbf files [message #426459 is a reply to message #400966] |
Thu, 15 October 2009 09:14 |
nateholtrop
Messages: 37 Registered: May 2008
|
Member |
|
|
Just to update this post for anyone searching:
alter tablespace TEMP drop tempfile '/database/oradata/cm/temp_ts02.dbf';
-Specify EXACT location of tempfile to drop
This will drop the tempfile from the tablespace and give you some space back. I do this whenever I need some space back on my drives for whatever reason.
|
|
|
Re: TEMP_TSXX.dbf files [message #426491 is a reply to message #400966] |
Thu, 15 October 2009 22:51 |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Said Mahesh Rajendran that ">> Is it safe to remove them?
Depends on what it is holding". You may identify how many session use sort in temporary tablespace.
1. Create a view
CREATE OR REPLACE VIEW temp_sort_user (
tablespace_name,
username,
sid,
serial_id,
contents,
segtype,
extents,
blocks,
bytes )
AS
SELECT
b.tablespace tablespace_name
, a.username username
, a.sid sid
, a.serial# serial_id
, b.contents contents
, b.segtype segtype
, b.extents extents
, b.blocks blocks
, (b.blocks * c.value) bytes
FROM
v$session a
, v$sort_usage b
, (select value from v$parameter
where name = 'db_block_size') c
WHERE
a.saddr = b.session_addr
/
2. Recheck
SQL> select * from temp_sort_user;
3. Create another temporary and make it as default
4. Drop the old temporary tablespace TEMP1 if there are not any session are using it.
5. If you want to re-use the TEMP1, so that, you re-create TEMP1, make it as default, drop TEMP2.
|
|
|