登录oracle用户su - oracle
关闭监听lsnrctl stop
关闭数据库
sqlplus / as sysdba
shutdown immediate
移动表空间文件导入新的位置
cd /u01/app/oracle/oradata/CDB1/
mv sfz.dbf to /opt/oracledata/sfz.dbf
chown -R oracle:oinstall /opt/oracledata/
挂起数据库
sqlplus / as sysdba
startup mount
修改表空间文件位置
alter database rename file '/u01/app/oracle/oradata/CDB1/sfz.dbf' to '/opt/oracledata/sfz.dbf';
打开数据库alter database open;
退出quit
启动监听lsnrctl start
查询表空间位置
select file_name,tablespace_name from dba_data_files