关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
移动数据文件,用oracle用户操作
[oracle@test ~]$ mv /u01/app/oracle/oradata/ORCL/system01.dbf /home/oracle/oradata/system01.dbf
[oracle@test ~]$ mv /u01/app/oracle/oradata/ORCL/sysaux01.dbf /home/oracle/oradata/sysaux01.dbf
[oracle@test ~]$ mv /u01/app/oracle/oradata/ORCL/redo03.log /home/oracle/oradata/redo03.log
[oracle@test ~]$ mv /u01/app/oracle/oradata/ORCL/redo02.log /home/oracle/oradata/redo02.log
[oracle@test ~]$ mv /u01/app/oracle/oradata/ORCL/redo01.log /home/oracle/oradata/redo01.log
启动到mount状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.0122E+10 bytes
Fixed Size 2237088 bytes
Variable Size 1610616160 bytes
Database Buffers 8489271296 bytes
Redo Buffers 19468288 bytes
Database mounted.
SQL> alter database rename file '/u01/app/oracle/oradata/ORCL/system01.dbf' to '/home/oracle/oradata/system01.dbf';
Database altered.
SQL> alter database rename file '/u01/app/oracle/oradata/ORCL/sysaux01.dbf' to '/home/oracle/oradata/sysaux01.dbf';
Database altered.
SQL> alter database rename file '/u01/app/oracle/oradata/ORCL/redo01.log' to '/home/oracle/oradata/redo01.log';
Database altered.
SQL> alter database rename file '/u01/app/oracle/oradata/ORCL/redo02.log' to '/home/oracle/oradata/redo02.log';
Database altered.
SQL> alter database rename file '/u01/app/oracle/oradata/ORCL/redo03.log' to '/home/oracle/oradata/redo03.log';
Database altered.
SQL> alter database open;
Database altered.
重启验证
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1.0122E+10 bytes
Fixed Size 2237088 bytes
Variable Size 1610616160 bytes
Database Buffers 8489271296 bytes
Redo Buffers 19468288 bytes
Database mounted.
Database opened.