Monday, July 13, 2015

How to move the Oracle temp file to new location?

The purpose of this topic is to explain how to move the temp files from one file system to another file system with out impacting the application. The post is tested in Oracle 11.2.0.4.

The temp files are located at /orasys/oradata The goal is to move this temp files to dedicated file system  /oratemp/oradata

Step1 Copy the parsed temp file to new location as non parsed file.
cp --sparse=never /orasys/oradata/temp01.dbf /oratemp/oradata/temp01.dbf

Step2 create the temp file with new temp files
alter tablespace temp add tempfile '/oratemp/oradata/temp01.dbf' reuse;

Step3 Drop the temp files on the original location.
ALTER DATABASE TEMPFILE '/orasys/oradata/temp01.dbf' DROP INCLUDING DATAFILES;

No comments: