Operating System - HP-UX
1748157 Members
3998 Online
108758 Solutions
New Discussion юеВ

Re: oracle tempspace full

 
SOLVED
Go to solution

oracle tempspace full

I had a tempspace with a 2 Gb file autoextend, someone made a process that made this file grow till 5 Gb and made the disk full (lvol at 100%). I added another 2 Gb file to the tempspace, but now i want to reduce the original file to 2 Gb again, so the lvol return to have free space. I use the enterprise manager console, but i don┬┤t know if i can do it with people working.
My idea is to put the 5Gb file offline, reduce it and then put it online again, but i am not sure if this could made the BD fail or be damaged
22 REPLIES 22
renarios
Trusted Contributor

Re: oracle tempspace full

Hi ignacio,

For a workaround:
Create a second temporary tablespace (i.e. temp2), write a little script to alter all users temporary tablespace is temp2.
If the users reconnect, their new tablespace will be temp2.
Drop temporary tablespace temp, create it again, alter all users back to temporary tablespace is temp.
Now drop tempspace temp2.
Don't forget removing the O.S. files manualy for db versions <10g.

Cheerio,

Renarios
Nothing is more successfull as failure

Re: oracle tempspace full

In the enterpries manager there is a tick that say Define as default tempspace, if i create anothe tempspace and mark this tick would it be enaugh.
Instead of that, can├В┬┤t i put offline the file of 5 Gb and resize it meanwhile, the new 2 Gb file i had created in the same tempspace is online ??
Indira Aramandla
Honored Contributor

Re: oracle tempspace full

Hi Iqnacio,

Temporary tablespace is used by a sort process. As your temporary tablespace is setup as autoextend, and a huge sort process mush had increased the temporary tablespace to grow. Normally when the process is completed the space should be released. But the file size will still remain in the extended size.

When you login to enterprise manager console and look at the storage----tablespaces--- and on the right-hand pane you will see the tablespaces listsing with sizes (used and used percentage). If the used percentage is 0.008 then you can reduce the file size of the temporary tablespace.

This is how you do. Right-click on the tablespace name and ------View/Edit Details----- and this will open the Edit tablespace window and you can see the tablespace size. All you need to do is to reduce to the size you want and specify in KB or MB. Then apply the chnages and Ok.

You can reduce the temporary tablespace size using the commnad as well.

SQL> ALTER DATABASE DATAFILE '/path/name of temporary tablespace.dbf' RESIZE 99 MB;

Note: You can do this if the temporary tablespace used space has been released.

If your database is not 24x 7 and you can shutdown in the evening or at any time for few minutes maintenance, then then best thing will be to shutdown the database. And if the temporary tablespace is not yet released, then SMON will take some time to clean up this space. Once the database is brought back up, then the temporary space is relased, and you can reduce the size either by Enterprice GUI or command line.

Or you can follow Renarios├в s suggestion as well.

Indir
Never give up, Keep Trying
Eric Antunes
Honored Contributor

Re: oracle tempspace full

Hi Ignacio,

Do it with a cron job!

Create a job.sh file (executable for the bd user at least) with:

ORA_ENVFILE="//[/.../].env"

DB_NAME=""

svrmgrl << EOT

connect / as sysdba;

alter database datafile '/.../temp.dbf' resize 2048000K;

quit
EOT

exit_code=$?


Regards,

Eric Antunes
Each and every day is a good day to learn.
renarios
Trusted Contributor

Re: oracle tempspace full

Hi Ignacio,

It is not possible to resize a datafile offline.
You can resize the dafiles of a tablespace, but you can't drop a file of a tablespace.
So, if you resize the datafile (in OEM or sqlplus), there will remain two datafiles. Of you like to keep 2 GB of tempspace, resize both datafiles (tempfiles) to 1 GB each (1+1=2). The other way, if you want to keep just one data(temp)file of 2GB, do it the way I explained above.
Maybe Oracle Metalink is a good place to find more resources. A link for this issue is explaind at this URL:http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=111316.1

Cheerio,

Renarios
Nothing is more successfull as failure

Re: oracle tempspace full

Hi Indira, all nigths i shutdown the database, so yesterday nigth i did it, but when i start up the BD again, the file in the tempspace it├В┬┤s still full, in the enterprise manager i see %used 99,98, althougth i know that it is not true. How can i do to change this (empty the file) and resize to 2
renarios
Trusted Contributor

Re: oracle tempspace full

Hi Ignacio,

In the OEM (Oracle Enterprise Manager) you click to , , storage, Tablespaces, Temp.
Now you see size: 5000 MB. If you change that to 2000 MB (or 2048 MB), the datafile will be altered to 2GB.
Please do it on a quit moment (performance issues)

Cheerio,

Renarios
Nothing is more successfull as failure
Eric Antunes
Honored Contributor

Re: oracle tempspace full

Ignacio,

This is normaly caused by a "bad SQL" Oracle process, you must identify it! OEM helps you to do that: enter in the Oracle TopSessions and the first session should be the one causing this!!

Best Regards,

Eric Antunes
Each and every day is a good day to learn.

Re: oracle tempspace full

Where is oracle topsessions in oem, mine is in spanish