Re: How to free inodes in Linux without killing processes

From: David Robillard <david.robillard_at_gmail.com>
Date: Fri, 16 Jul 2010 09:35:20 -0400
Message-ID: <AANLkTikjbhIsOMLKP9XvgJqQBsBzC0D02VvJo-ni9Tu7_at_mail.gmail.com>



Hello everyone,

> You can truncate the file using "*> **file.trc" *that has usually worked for me.
>
> The other option is to delete the file, then connect to the background
> process which holds the file descriptor open using oradebug and issue an
> ORADEBUG CLOSE_TRACE *however* I wouldn't connect to critical background
> processes with oradebug at all, even if you're running simple commands like
> close trace.
>
> So, truncating the file is a better option...

It all depends if you prefer to keep the contents of the file or not.

If you don't care about what's in the file, then indeed truncating it as Tanel suggested is the fastest way.

But if you'd like to keep the content of the file, then you can first copy the file to another location or file name. Then copy /dev/null on it. Like this:

cp /path/to/bigfile /path/to/bigfile.copy cp /dev/null /path/to/bigfile

This both saves the file content and preserves any open file descriptor that a process might have on that particular file. Hence you don't have to use oradebug or anything like that. Plus it works great with any type of processes, not just Oracle related ones.

It's also an efficient way to free space if your file system fills up. Take /var for example when a problem arises and it starts filling the logs in /var. You need to keep the info in the log files to debug the problem, but need to free space in /var so that the system continues to work. So you just copy the file off to another file system then copy /dev/null on it. You can then debug at your own pace without the stress of a broken server.

Have a good friday!

David

> --
> Tanel Poder
> http://blog.tanelpoder.com
> http://tech.e2sn.com

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 16 2010 - 08:35:20 CDT

Original text of this message