1) sqplus to the database and make sure the Tempfiles that you want to rename or change the location.
SQL> select name from v$tempfile;
2) create a pfile before making the changes.
3) shutdown the database.
4) make the directory structure where you want to move the temp files..
5) start the database in Mount.
SQL> startup mount
6) alter database rename file '+APT/TESTDB/TEMPFILE/tempabc' to '+TEMP/TESTDB/TEMPFILE/temp01.dbf'
for filesysystem also you can follow the same procedure. just give the location that you want to.
7) open the database and make sure the temp file is created at the desired location.
In 12C:-
Below are the steps to move the Temp files… for container /
PDB.
set linesize 200
col file_name for a60
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
1)
Create a tempfile of a decent size.
alter tablespace TEMP add tempfile
'+TEMP/TESTDBC/TEMPFILE/temptest.dbf' size 2G;
2)
take the tempfile offline which you want to move.
alter database tempfile
'+DATIND/TESTDBC/TEMPFILE/temp.441.943798245' offline;
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
3)
Copy the tempfile in the ‘+ASM’ to the desired location.
Note create the folders in TEMP directory.
cp '+DATIND/TESTDBC/TEMPFILE/TEMP.441.943798245' '+TEMP/TESTDBC/TEMPFILE/temp01.dbf'
4)
Rename the tempfile you already moved.
alter database rename file
'+DATIND/TESTDBC/TEMPFILE/temp.441.943798245' to
'+TEMP/TESTDBC/TEMPFILE/temp01.dbf';
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
5)
Make the tempfile online again.
alter database tempfile '+TEMP/TESTDBC/TEMPFILE/temp01.dbf'
online;
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
Note:- do these steps for other tempfiles in the temp(do
2/3/4/5 steps).
Once done drop the created tempfile in step 1.
alter database tempfile
'+TEMP/TESTDBC/TEMPFILE/temptest.dbf' offline;
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
alter tablespace TEMP drop tempfile
'+TEMP/TESTDBC/TEMPFILE/temptest.dbf';
SELECT v.file#, t.file_name, v.status FROM dba_temp_files t,
v$tempfile v WHERE t.file_id = v.file#;
Hope this helps......