[Oracle DataBase Server 12.1 installation on Oracle Linux 6.7]: Change default datafile location
To create folders for files:
$ mkdir -p /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/data
$ mkdir -p /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/indexes
$ mkdir -p /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/undo
$ mkdir -p /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/temp
$ sqlplus / as sysdba
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u02/oracle/oradata/12.1/orcl12/system01.dbf
/u02/oracle/oradata/12.1/orcl12/sysaux01.dbf
/u02/oracle/oradata/12.1/orcl12/undotbs01.dbf
/u02/oracle/oradata/12.1/orcl12/users01.dbf
SQL> shutdown immediate;
SQL> startup mount;
SQL> HOST mv /u02/oracle/oradata/12.1/orcl12/system01.dbf /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/data/system01.dbf
SQL> HOST mv /u02/oracle/oradata/12.1/orcl12/sysaux01.dbf /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/data/sysaux01.dbf
SQL> HOST mv /u02/oracle/oradata/12.1/orcl12/users01.dbf /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/data/users01.dbf
SQL> HOST mv /u02/oracle/oradata/12.1/orcl12/undotbs01.dbf /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/undo/undotbs01.dbf
SQL> select name from v$tempfile;
NAME
------------------------------------------------
/u02/oracle/oradata/12.1/orcl12/temp01.dbf
SQL> HOST mv /u02/oracle/oradata/12.1/orcl12/temp01.dbf /u02/oracle/oradata/12.1/${ORACLE_SID}/DATAFILE/temp/temp01.dbf
SQL> ALTER DATABASE RENAME FILE '/u02/oracle/oradata/12.1/orcl12/system01.dbf' TO '/u02/oracle/oradata/12.1/orcl12/DATAFILE/data/system01.dbf';
SQL> ALTER DATABASE RENAME FILE '/u02/oracle/oradata/12.1/orcl12/sysaux01.dbf' TO '/u02/oracle/oradata/12.1/orcl12/DATAFILE/data/sysaux01.dbf';
SQL> ALTER DATABASE RENAME FILE '/u02/oracle/oradata/12.1/orcl12/users01.dbf' TO '/u02/oracle/oradata/12.1/orcl12/DATAFILE/data/users01.dbf';
SQL> ALTER DATABASE RENAME FILE '/u02/oracle/oradata/12.1/orcl12/undotbs01.dbf' TO '/u02/oracle/oradata/12.1/orcl12/DATAFILE/undo/undotbs01.dbf';
SQL> ALTER DATABASE RENAME FILE '/u02/oracle/oradata/12.1/orcl12/temp01.dbf' TO '/u02/oracle/oradata/12.1/orcl12/DATAFILE/temptemp01.dbf';
SQL> alter database open;
SQL> quit