System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a link for /var/temp to new mount point

SOLVED
Go to solution
Muthyala
Frequent Advisor

Creating a link for /var/temp to new mount point

Hi

 

I want to create a link for /var/tmp to new mount point /log/tmp.Please note that /var/tmp is currently used by oracle and it gets full very fast , due to this i want /var/tmp to point to location.How can i do it.

 

i tried doing this 

 

server:/var #ln -s /log/tmp var , but it creates a link under /var/tmp/tmp pointing ot /log/tmp 

 

What is the best way to do it .

 

TIA

5 REPLIES
Patrick Wallek
Honored Contributor

Re: Creating a link for /var/temp to new mount point

You would need to first stop all applications that are using /var/tmp, which would probably be Oracle.

 

Next move the current /var/tmp to /var/tmp.orig

 

Now you can create your link.

 

ln -s /log/tmp /var/tmp

 

Now restart your Oracle application and anything that was using /var/tmp.

 

While this will work, it should be possible to control where Oracle writes its temp files.  I cannot remember if this is an environment variable for the user that runs the Oracle processes or if it is something in the SPFILE.

Muthyala
Frequent Advisor

Re: Creating a link for /var/temp to new mount point

Can i not do it with Oracle still using the /var/tmp. I am afraid , i cannot bring down Oracle DB , since it is my production .Is there any other way to do this ?
TIA
Patrick Wallek
Honored Contributor
Solution

Re: Creating a link for /var/temp to new mount point

No, there's really no other way.

 

In order for the link to be created the /var/tmp directory itself must not exist.  You cannot turn an existing directory into a link to another directory.

 

 

Dennis Handly
Acclaimed Contributor

Re: Creating a link for /var/tmp to new mount point

>You would need to first stop all applications that are using /var/tmp

 

If you don't stop the applications, the problems would depend on whether they are continually opening and closing files there.  If they keep them open, the mv and ln would have no affect until a new file is created.

 

If they are opening and closing, they won't find the previous file.

So basically, you are gambling.

 

>it should be possible to control where Oracle writes its temp files.  I cannot remember if this is an environment variable

 

For most applications, they check TMPDIR.

Bill Hassell
Honored Contributor

Re: Creating a link for /var/temp to new mount point

The location for Oracle's files is defined by your database administrator. /var/tmp is actually a poor choice (but probably the default and your DBA did not look at best practices for temp files. However, /var/tmp is very heavily used by many, many different programs, not just Oracle. That's why your DBA needs to redefine where the Oracle files should be located. /var/tmp is a very common directory to be given a separate lvol and mountpoint. /var has other directories that could grow quite large and cause problems several applications. That's why the system administrator must check the sizes of the directories and take appropriate action. It may be to trim logfiles, fix a broken application or hardware that is creating large files, create separate mountpoints, redirect email, etc.



Bill Hassell, sysadmin